The function can generate one-dimensional or multi-dimensional curves.
For i_sim
1 or 2, one-dimensional curves are generated.
For i_sim
3 or 4, multi-dimensional curves are generated.
Usage
sim_model_ex2(n = 50, p = 150, i_sim = 1)
Arguments
- n
Number of curves to generate for each of the two groups. Set to 50 by default.
- p
Number of grid points of the curves.
Curves are generated over the interval \([0, 1]\). Set to 150 grid point by default.
- i_sim
Integer set to \(1, \ldots, 4\)
NULL by default in which case a seed is not set.
Value
data matrix of size \(2n \times p\) if \(i\_sim \in {1,2}\)
or an array of dimensions
\(2n \times p \times 2\) if \(i\_sim \in {3, 4}\).
Examples
sm1 <- sim_model_ex2()
dim(sm1) # This should output (100, 150) by default, since n = 50 and p = 150
#> [1] 100 150
sm4 <- sim_model_ex2(i_sim = 4)
dim(sm4) # This should output (100, 150, 2) by default, since n = 50 and p = 150
#> [1] 100 150 2