This function evaluate the integral for a state (0, 1) functional data : int( X(t) func(t) )dt. This function works ONLY for a one state CFD!
Usage
evaluate_id_func_integral_deprecated(
id_df,
func,
mode = 1,
id_col = "id",
time_col = "time",
nb_pt = 10,
subdivisions = 100
)Arguments
- id_df
a single id dataframe of at least named columns (id, time)
- func
the function to integrate
- mode
select the integration mode 1 for R function integrate, 2 for pracma::trapz. default value : 1
- id_col
col_name of df for the id
- time_col
col_name of df for the time
- nb_pt
number of points for the integration, default value : 10
- subdivisions
default parameter of R function integrate; default value : 100
Examples
id_df = data.frame(id=rep(1,5), time=seq(0, 40, 10), state=c(0, 1, 1, 0, 1))
evaluate_id_func_integral(id_df, function(t){t})
#> id integral
#> 1 1 400
