Skip to contents

Evaluates the integral \(\int_{\tau_i} f(t) dt\) where \(\tau_i\) are the active intervals of a categorical functional data (states 0 or 1).

Usage

evaluate_id_func_integral(
  id_df,
  func,
  id_col = "id",
  time_col = "time",
  rel_tol = .Machine$double.eps^0.5,
  subdivisions = 1000L,
  ...
)

Arguments

id_df

Dataframe for a single individual with at least columns (id, time, state).

func

The R function to integrate.

id_col

Character, name of the id column, default 'id'.

time_col

Character, name of the time column, default 'time'.

rel_tol

Relative tolerance for stats::integrate, default 1e-8.

subdivisions

Max number of subdivisions for integrate, default 100.

...

Additional arguments (ignored to prevent passing unused params to func).

Value

A dataframe with the id and the calculated integral value.