irreg.fd: Sample Irregular Functional Data

Description Usage Arguments Details Value References Examples

View source: R/irreg.fd.R

Description

Sample Irregular Functional Data

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
irreg.fd(
  mu = 0,
  X = wiener.process(),
  n = 100,
  m = 5,
  sig = NULL,
  snr = 5,
  domain = c(0, 1),
  delta = 1
)

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

a vector of sampling rate or scalar of average sampling rate or a function of the form f(n) generating n positive integers; 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; default value: 1.

Details

The number of observation for each trajectory is randomly generated by rpois(m)+1. For each trajectory, the reference time Oi is uniformly sampled from the interval [domain[1]+delta*L/2,domain[2]-delta*L/2], where L is the length of domain, and the design points for the trajectory is uniformly sampled from the interval [Oi-delta*L/2,Oi+delta*L/2].

Value

a list with the following members

t

list of design points sorted in increasing order for each trajectory.

y

list of vectors of observations for each trajectory.

and with attributes sig, snr, domain, delta and

y0

n*m matrix of observations without measurement errors.

References

\insertRef

Lin2020synfd

Examples

1
2
3
4
5
6
7
8
# Gaussian trajectories with constant mean function 1
Y <- irreg.fd(mu=1, X=gaussian.process(), n=10, m=5)

# trajectories froma a process defined via K-L representation
Y <- irreg.fd(mu=cos, X=kl.process(eigen.functions='FOURIER',distribution='LAPLACE'),n=10, m=5)

# trajectories with specified individual sampling rate
Y <- irreg.fd(mu=1, X=gaussian.process(cov=matern), n=10, m=rpois(10,3)+2)

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