meanfunc: Estimate the mean function from functional data/snippets

Description Usage Arguments Details Value References Examples

View source: R/mean.R

Description

Estimate the mean function from functional data/snippets

Usage

1
2
3
4
5
6
7
8
9
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

Value

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

References

\insertRef

Lin2020mcfda

\insertRef

Yao2005mcfda

Examples

1
2
3
4
5
6
7
8
9
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)

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