This function simulates functional data. The data it outputs is generated from a mean function and two orthogonal principal component basis functions. The mean and principal components are based on sine and cosine functions. Subject-specific scores for each PC are drawn from normal distributions with standard deviation lambda1 and lambda2.
simulate_functional_data(
lambda1 = 2,
lambda2 = 1,
I = 50,
D = 100,
seed = 1988,
vary_D = FALSE
)
A list containing:
Simulated dataframe with variables id, value, index, and latent_mean.
True values for first principal component.
True values for second principal component.
True values for population-level mean.
A list containing:
A dataframe of simulated data.
The first simulated eigenfunction.
The second simulated eigenfunction.
The population mean.
Standard deviation for PC1 scores.
Standard deviation for PC2 scores.
Number of subjects. Defaults is 50.
Number of grid points per subject. Default is 100.
Seed for reproducibility. Default is 1988.
Indicates if grid length vary by subject. If FALSE all subjects have grid length D.
Julia Wrobel julia.wrobel@cuanschutz.edu