fast_history_compute {bistablehistory}R Documentation

Computes cumulative history

Description

Computes cumulative history based on common history values and normalized_tau and mixed_state that are defined for each random cluster / individual.

Usage

fast_history_compute(df, normalized_tau, mixed_state, history_init)

Arguments

df

DataFrame with "state" (integer, 1 and 2 clear state, 3 - mixed state), "duration" (double), "irandom" (integer, 1-based index of a random cluster), "run_start" (integer, 1 for the first entry of the run, 0 otherwise), "session_tmean" (double)

normalized_tau

DoubleVector A normalized tau value for each random cluster / individual. Thus, its length must be equal to the number of unique indexes in df["irandom"].

mixed_state

DoubleVector A values used for the mixed state for each random cluster / individual. Thus, its length must be equal to the number of unique indexes in df["irandom"].

history_init

DoubleVector, size 2. Initial values of history for a run.

Value

NumericMatrix, size df.nrows() × 2. Computed history values for each state.

Examples

df <- preprocess_data(br_singleblock, state="State", duration="Duration")
fast_history_compute(df, 1, 0.5, c(0, 0))

[Package bistablehistory version 1.1.2 Index]