Description Usage Arguments Value Examples
Generate functional/longitudinal data via Karhunen–Loève expansion.
1 |
n |
number of sample size. |
interval |
A |
sparse |
A |
regular |
Logical; If |
meanfun |
A function for the mean. |
score |
A n by |
eigfun |
A |
sd |
A scalar denoting the standard deviation of measurement errors. |
A list
containing the following components:
Lt |
A |
Ly |
A |
1 2 3 4 5 6 7 8 9 10 11 | n <- 100
interval <- c(0, 10)
lambda_1 <- 9 #the first eigenvalue
lambda_2 <- 1.5 #the second eigenvalue
eigfun <- list()
eigfun[[1]] <- function(x){cos(pi * x/10)/sqrt(5)}
eigfun[[2]] <- function(x){sin(pi * x/10)/sqrt(5)}
score <- cbind(rnorm(n, 0, sqrt(lambda_1)), rnorm(n, 0, sqrt(lambda_2)))
DataNew <- GenDataKL(n, interval = interval, sparse = 6:8, regular = FALSE,
meanfun = function(x){0}, score = score,
eigfun = eigfun, sd = sqrt(0.1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.