View source: R/simulate_functional_data.R
simulate_functional_data | R Documentation |
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 )
lambda1 |
Standard deviation for PC1 scores. |
lambda2 |
Standard deviation for PC2 scores. |
I |
Number of subjects. Defaults is 50. |
D |
Number of grid points per subject. Default is 100. |
seed |
Seed for reproducibility. Default is 1988. |
vary_D |
Indicates if grid length vary by subject. If FALSE all subjects have grid length D. |
A list containing:
Y |
Simulated dataframe with variables id, value, index, and latent_mean. |
psi1 |
True values for first principal component. |
psi2 |
True values for second principal component. |
alpha |
True values for population-level mean. |
A list containing:
Y |
A dataframe of simulated data. |
psi1 |
The first simulated eigenfunction. |
psi2 |
The second simulated eigenfunction. |
alpha |
The population mean. |
Julia Wrobel julia.wrobel@cuanschutz.edu
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.