covfunc: Estimate the cov function from functional data/snippets.

Description Usage Arguments Details Value References Examples

View source: R/cov.R

Description

Estimate the cov function from functional data/snippets.

Usage

1
2
3
4
5
6
7
8
9
covfunc(
  t,
  y,
  newt = NULL,
  mu = NULL,
  weig = NULL,
  method = c("FOURIER", "PACE", "SP"),
  ...
)

Arguments

t

a list of vectors (for irregular design) or a vector (for regular design) containing time points of observations for each individual; each vector should be in ascending order.

y

a list of vectors (for irregular design) or a matrix (for regular design) containing the observed values at t; if it is a matrix, the columns correspond to the time points in the vector t.

newt

a list of vectors or a vector containing time points of observations to be evaluated; if NULL, then newt is treated as t.

mu

the known or estimated mean function object; it must be a scalar (viewed as a constant function), a function handle, or an object obtained by calling meanfunc

weig

a vector of length(t) of weight for each subject, or 'OBS' or 'SUBJ' for weighting scheme

method

estimation method, 'PACE' or 'FOURIER' or 'SP' (for semiparametric method)

...

other parameters required depending on the method and tuning; see details

tuning

tuning method to select possible tuning parameters

Details

Value

an object of the class 'covfunc' containing necessary information to predict/evaluate the estimated covariance function and the following output:

References

\insertRef

Lin2020bmcfda

\insertRef

Lin2020mcfda

\insertRef

Yao2005mcfda

Examples

1
2
3
4
5
6
7
mu <- function(s) sin(2*pi*s)
D <- synfd::sparse.fd(mu=mu, X=synfd::gaussian.process(), n=100, m=5)
mu.obj <- meanfunc(D$t,D$y,newt=NULL,method='PACE',
                   tuning='cv',weig=NULL,kernel='gauss',deg=1)
cov.obj <- covfunc(D$t,D$y,newt=NULL,mu=mu.obj,method='FOURIER',
                   tuning='cv',weig=NULL,domain=c(0,1))
cov.hat <- predict(cov.obj,regular.grid())

linulysses/mcfda documentation built on Jan. 17, 2021, 8:53 a.m.