meanfunc: Estimate the mean function from functional data/snippets

View source: R/mean.R

meanfuncR Documentation

Estimate the mean function from functional data/snippets

Description

Estimate the mean function from functional data/snippets

Usage

meanfunc(
  t,
  y,
  newt = NULL,
  method = c("PACE", "FOURIER"),
  tuning = "cv",
  weig = NULL,
  ...
)

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

method

estimation method, 'PACE' or 'FOURIER'

tuning

tuning method to select possible tuning parameters

...

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

Details

  • When method='PACE', additional parameters kernel and deg can be provided. bw as a scalar is optional. When bw is provided, the bandwidth is set to bw

  • When method='FOURIER', additional parameters q,rho,ext and domain are optional. If they are not provided, then they will be deduced from data or selected by the specified tuning method.

Value

an object of the class 'meanfunc' containing necessary information to predict the mean function

References

\insertRef

Lin2020mcfda

\insertRef

Yao2005mcfda

Examples

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)
# equivalent to
# mu.obj <- meanfunc(D$t,D$y)

# plot the object
plot(mu.obj)

ZhuolinSong/wpe documentation built on Oct. 31, 2022, 7:38 p.m.