
Compute Multivariate Sample Entropy per Participant
Source:R/compute_mvsampen.R
compute_mvsampen.RdComputes multivariate sample entropy (mvSampEn) from a pre-built state-space embedding, separately for each participant.
Input must be an experdyn_statespace object from make_statespace().
The function does not perform any additional embedding — each row of the
state-space matrix is already a trajectory point that encodes the optimal
delay τ and dimension d chosen by estimate_embedding_parameters()
and applied by make_statespace(). SampEn is then computed directly on
this sequence of trajectory points:
B = proportion of all point-pairs \((i \ne j)\) whose Chebyshev distance is \(\le r\) (same-neighbourhood).
A = proportion of consecutive point-pairs where both the current and next state-space point are simultaneously within \(r\) (trajectory-neighbourhood).
\(\text{mvSampEn} = -\log(A / B)\).
For each participant, entropy is first computed within each subseries and then aggregated (weighted by number of template pairs) to yield a single participant-level estimate.
Usage
compute_mvsampen(
data,
r = 0.2,
participant_col = "ID",
series_col = "Series_ID",
time_col = "time"
)Arguments
- data
An
experdyn_statespaceobject returned bymake_statespace().- r
[numeric(1): 0.2]
Matching tolerance. Data are z-scored within each subseries before matching, soris on a standardised scale.- participant_col
[character(1): "ID"]
Participant identifier column.- series_col
[character(1): "Series_ID"]
Subseries identifier column.- time_col
[character(1): "time"]
Optional time column used for ordering within subseries when present.
Value
An object of class experdyn_mvsampen with:
| Element | Description |
participant_entropy | One row per participant with aggregated entropy. |
series_entropy | One row per participant-subseries entropy estimate. |
dimensions | Statespace embedding dimensions used as input. |
r | Matching tolerance used. |
variables | Variables included in entropy estimation. |
See also
make_statespace()for building the state-space passed to this function.estimate_embedding_parameters()to choosedelayanddimensions.compute_rqa()for recurrence-based complexity measures.