generate_gauss_fdata: Generation of gaussian univariate functional data

Description Usage Arguments Details Value See Also Examples

View source: R/simulation.R

Description

generate_gauss_fdata generates a dataset of univariate functional data with a desired mean and covariance function.

Usage

1
generate_gauss_fdata(N, centerline, Cov = NULL, CholCov = NULL)

Arguments

N

the number of distinct functional observations to generate.

centerline

the centerline of the distribution, represented as a one- dimensional data structure of length P containing the measurement of the centerline on grid points.

Cov

the covariance operator (provided in form of a P x P matrix) that has to be used in the generation of ε(t). At least one argument between Cov and CholCov should be different from NULL.

CholCov

the Cholesky factor of the covariance operator (provided in form of a P x P matrix) that has to be used in the generation of observations from the process ε(t). At least one argument between Cov and CholCov should be different from NULL.

Details

In particular, the following model is considered for the generation of data:

X(t) = m( t ) + ε(t), for all t in I = [a, b]

where m(t) is the center and ε(t) is a centered gaussian process with covariance function C_i. That is to say:

Cov( ε(s), ε(t) ) = C( s, t ), with s, t in I

All the functions are supposed to be observed on an evenly-spaced, one- dimensional grid of P points: [a = t_0, t_1, …, t_{P-1} = b] \subset I .

Value

The function returns a matrix containing the discretized values of the generated observations (in form of an N x P matrix).

See Also

exp_cov_function, fData, generate_gauss_mfdata

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
N = 30
P = 1e2

t0 = 0
tP = 1

time_grid = seq( t0, tP, length.out = P )

C = exp_cov_function( time_grid, alpha = 0.1, beta = 0.2 )

CholC = chol( C )

centerline = sin( 2 * pi * time_grid )

generate_gauss_fdata( N, centerline, Cov = C )

generate_gauss_fdata( N, centerline, CholCov = CholC )

roahd documentation built on May 30, 2017, 6:09 a.m.

Search within the roahd package
Search all R packages, documentation and source code