Function for generating functional data in one dimension
Source:R/simulation_models.R
sim_model_ex1.Rd
Each dataset has 2 groups with n
curves each, defined in the interval
\(t=[0, 1]\) with p
equidistant points. The first n
curves are
generated fron the following model
\(X_1(t)=E_1(t)+e(t)\) where \(E_1(t)=E_1(X(t))=30t^{ \frac{3}{2}}(1-t)\)
is the mean function and \(e(t)\) is a centered Gaussian process with
covariance matrix \(Cov(e(t_i),e(t_j))=0.3 \exp(-\frac{\lvert t_i-t_j \rvert}{0.3})\)
The remaining 50 functions are generated from model i_sim
with
i_sim
\(\in \{1, \ldots, 8\}.\)
The first three models contain changes in the mean, while the covariance
matrix does not change. Model 4 and 5 are obtained by multiplying the
covariance matrix by a constant. Model 6 is obtained from adding to
\(E_1(t)\) a centered Gaussian process \(h(t)\) whose covariance matrix
is given by \(Cov(e(t_i),e(t_j))=0.5 \exp (-\frac{\lvert t_i-t_j\rvert}{0.2})\).
Model 7 and 8 are obtained by a different mean function.
- Model 1.
\(X_1(t)=30t^{\frac{3}{2}}(1-t)+0.5+e(t).\)
- Model 2.
\(X_2(t)=30t^{\frac{3}{2}}(1-t)+0.75+e(t).\)
- Model 3.
\(X_3(t)=30t^{\frac{3}{2}}(1-t)+1+e(t).\)
- Model 4.
\(X_4(t)=30t^{\frac{3}{2}}(1-t)+2 e(t).\)
- Model 5.
\(X_5(t)=30t^{\frac{3}{2}}(1-t)+0.25 e(t).\)
- Model 6.
\(X_6(t)=30t^{\frac{3}{2}}(1-t)+ h(t).\)
- Model 7.
\(X_7(t)=30t{(1-t)}^2+ h(t).\)
- Model 8.
\(X_8(t)=30t{(1-t)}^2+ e(t).\)
Examples
sm1 <- sim_model_ex1()
dim(sm1)
#> [1] 100 30