Learn R Programming

fda.usc (version 1.1.0)

rproc2fdata: Generate random process of fdata class.

Description

Generate Functional data from: Ornstein Uhlenbeck process, Brownian process, Gaussian process or Exponential variogram process.

Usage

rproc2fdata(n,t=NULL,mu=rep(0,length(t)),sigma=1,
par.list=list("scale"=1,"theta"=1/(3*diff(rtt))),norm=FALSE,verbose=FALSE,...)

Arguments

n
Number of functional data to generate.
t
Discretization points.
mu
vector which specifies the trend values at the discretization points, by default mu=$\mu(t)=0$. If mu is a fdata class object, t$=$argvals(mu).
sigma
A positive-definite symmetric matrix, $\Sigma_{s,t}$, specifying the covariance matrix of the variables. If sigma is a scalar, creates a random Gaussian process with $\Sigma_{s,t}=$sigmaI (by default sigma=
par.list
List of parameter to process, by default "scale" $\sigma^2=1$ and "theta" $\theta=1/(3range(t))$.
norm
If TRUE the norm of random projection is 1. Default is FALSE
verbose
If TRUE, information about procedure is printed. Default is FALSE.
...
Further arguments passed to or from other methods.

Value

  • Return the functional random process of fdata class object.

Examples

Run this code
par(mfrow=c(3,2))
lent<-30
tt<-seq(0,1,len=lent)
mu<-fdata(rep(0,lent),tt)
plot(rproc2fdata(200,t=tt,sigma="OU",par.list=list("scale"=1)))
plot(rproc2fdata(200,mu=mu,sigma="OU",par.list=list("scale"=1)))
plot(rproc2fdata(200,t=tt,sigma="vexponential"))
plot(rproc2fdata(200,t=tt,sigma=1:lent))
plot(rproc2fdata(200,t=tt,sigma="brownian"))
plot(rproc2fdata(200,t=tt,sigma="wiener"))
#plot(rproc2fdata(200,seq(0,1,len=30),sigma="oo")) # this is a error

Run the code above in your browser using DataLab