sim_delaigle: Generate partially observed functional data from Delaigle et...

View source: R/sim_delaigle.R

sim_delaigleR Documentation

Generate partially observed functional data from Delaigle et al.(2021).

Description

Partially observed functional data is generated with 51 regular grids by using the setting of Delaigle et al.(2021) with model 2.

Usage

sim_delaigle(
  n = 100,
  type = c("partial", "snippet", "dense"),
  out.prop = 0.2,
  out.type = 1,
  dist = "normal",
  noise = 0,
  d = 1.4,
  f = 0.2
)

Arguments

n

a number of curves

type

the type of generated data. "partial" means the option for partially observed data, "snippet" is short fragmented data, and "dense" means the fully observed curves.

out.prop

a proportion of outlying curves of total n curves. Only used for dist = "normal".

out.type

a outlier type, 1~3 are supported. Only used for dist = "normal".

dist

a distribution which the data is generated. "normal"(Normal distribution) and "tdist"(t-distribution) are supported. If dist = "tdist", the option of out.prop and out.type are ignored.

noise

a numeric value which is added random gaussian noises. Default is 0(No random noise).

d

a parameter for missingness when type is "partial" (See Kraus(2015))

f

a parameter for missingness when type is "partial" (See Kraus(2015))

Value

a list contatining as follows:

Ly

a list of n vectors containing the observed values for each individual.

Lt

a list of n vectors containing the observation time points for each individual corresponding to Ly

out.ind

a vector containing outlier index. 0 is non-outlier and 1 is the outlier.

x.full

a n x 51 dense matrix with n observations per 51 timepoints before making partially observed.

References

Delaigle, A., Hall, P., Huang, W., & Kneip, A. (2021). Estimating the covariance of fragmented and other related types of functional data. Journal of the American Statistical Association, 116(535), 1383-1401. Kraus, D. (2015). Components and completion of partially observed functional data. Journal of the Royal Statistical Society: Series B: Statistical Methodology, 777-801.

Examples

set.seed(100)
x.list <- sim_delaigle(n = 100,
                       type = "partial",
                       out.prop = 0.2,
                       dist = "normal")
x <- list2matrix(x.list)
matplot(t(x), type = "l")


statKim/robfpca documentation built on April 15, 2023, 10:12 p.m.