`generate_gauss_mfdata`

generates a dataset of multivariate functional
data with a desired mean and covariance function in each dimension and a
desired correlation structure among components.

1 2 | ```
generate_gauss_mfdata(N, L, centerline, correlations, listCov = NULL,
listCholCov = NULL)
``` |

`N` |
the number of distinct functional observations to generate. |

`L` |
the number of components of the multivariate functional data. |

`centerline` |
the centerline of the distribution, represented as a 2-dimensional data structure with L rows (one for each dimension) having the measurements along the grid as columns. |

`correlations` |
is the vector containing the
that is to say, the row-wise, upper triangular part of the correlation matrix without the diagonal. |

`listCov` |
a list containing the |

`listCholCov` |
the Cholesky factor of the |

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

* X(t) = ( m_1( t ) +
ε_1(t), ..., m_L(t) + ε_L(t) ), for all t in I = [a, b] *

where *L* is the number of components of the multivariate functional
random variable, *m_i(t)* is the *i-*th component of the center and
*ε_i(t)* is a centered gaussian process with covariance function
*C_i*. That is to say:

*Cov( ε_i(s),
ε_i(t) ) = C( s, t ), with i =
1, …, L, and with s, t in I*

A correlation structure among *ε_1(t),…,ε_L(t)* is
allowed in the following way:

* Cor( ε_i(t), ε_j(t) ) =
ρ_ij, for all i != j and for all 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 *.

The function returns a list of L matrices, one for each component of
the multivariate functional random variable, containing the discretized
values of the generated observations (in form of *N x P*
matrices).

`exp_cov_function`

, `mfData`

,
`generate_gauss_fdata`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ```
N = 30
P = 1e2
L = 3
time_grid = seq( 0, 1, length.out = P )
C1 = exp_cov_function( time_grid, alpha = 0.1, beta = 0.2 )
C2 = exp_cov_function( time_grid, alpha = 0.2, beta = 0.5 )
C3 = exp_cov_function( time_grid, alpha = 0.3, beta = 1 )
centerline = matrix( c( sin( 2 * pi * time_grid ),
sqrt( time_grid ),
10 * ( time_grid - 0.5 ) * time_grid ),
nrow = 3, byrow = TRUE )
generate_gauss_mfdata( N, L, centerline,
correlations = c( 0.5, 0.5, 0.5 ),
listCov = list( C1, C2, C3 ) )
CholC1 = chol( C1 )
CholC2 = chol( C2 )
CholC3 = chol( C3 )
generate_gauss_mfdata( N, L, centerline,
correlations = c( 0.5, 0.5, 0.5 ),
listCholCov = list( CholC1, CholC2, CholC3 ) )
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.