rfd: Sample Functional Data

Description Usage Arguments Details Value References Examples

View source: R/rfd.R

Description

Sample Functional Data

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
rfd(
  mu = 0,
  X = wiener.process(),
  n = 100,
  m = 5,
  sig = NULL,
  snr = 5,
  domain = c(0, 1),
  delta = 1,
  grid = seq(domain[1], domain[2], length.out = m),
  type = "irregular"
)

Arguments

mu

function, scalar or a vector defining the mean function; default value: 0.

X

centered stochastic process defined by a function of the form X(tObs,n) and returning n*length(tObs) matrix, where each row represents observations from a trajectory. Default value: wiener.process().

n

sample size; default value: 100.

m

average sampling rate; default value: 5.

sig

standard deviation of measurement errors; if NULL then determined by snr.

snr

signal to noise ratio to determine sig; default value: 5.

domain

the domain; default value: c(0,1).

delta

the proportion of the domain to be observed for each trajectory; only required when type="irregular"; default value: 1.

grid

vector of design points; only required when type="regular". default value: NULL.

type

the data type, either "regular" or "irregular"; default value: "irregular".

Details

This is a unified interface for reg.fd and irreg.fd; see the manual for these functions for details.

Value

a list with the following members

t

design points sorted in increasing order for each trajectory; if type="irregular" then a list; otherwise a vector.

y

observations for each trajectory; if type="irregular" then a list; otherwise, a matrix.

and with attributes sig, snr, domain, delta, grid and

y0

the measurement-error-free counterpart of y.

References

\insertRef

Lin2020synfd

Examples

1
2
3
4
5
# irregularly observed Gaussian trajectories with constant mean function 1
Y <- rfd(mu=1, X=gaussian.process(), n=10, m=5)

# regularly observed trajectories with a K-L representation
Y <- rfd(X=kl.process(eigen.functions='FOURIER',distribution='LAPLACE'), type='regular')

synfd documentation built on July 1, 2020, 6:04 p.m.

Related to rfd in synfd...