sim_kraus: Generate partially observed functional data from Kraus....

View source: R/sim_kraus.R

sim_krausR Documentation

Generate partially observed functional data from Kraus. (2015).

Description

Partially observed functional data is generated with 51 regular grids by using the setting of Kraus(2015).

Usage

sim_kraus(
  n = 100,
  type = c("partial", "snippet", "dense"),
  num.comp = 100,
  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.

num.comp

the number of components when the data are generated. See Kraus(2015).

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

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_kraus(n = 100,
                    type = "partial",
                    num.comp = 5,
                    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.