generate_gauss_mfdata {roahd} | R Documentation |
Generation of gaussian multivariate functional data
Description
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.
Usage
generate_gauss_mfdata(
N,
L,
centerline,
correlations,
listCov = NULL,
listCholCov = NULL
)
Arguments
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 |
Details
In particular, the following model is considered for the generation of data:
X(t) = ( m_1( t ) + \epsilon_1( t ), \ldots, m_L(t) +
\epsilon_L(t)), \quad 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
\epsilon_i(t)
is a centered gaussian process with covariance function
C_i
. That is to say:
Cov( \epsilon_{i}(s), \epsilon_{i}(t) ) = C( s, t ), \quad \forall i =
1, \ldots, L, \quad \forall s, t \in I
A correlation structure among \epsilon_1(t),\ldots,\epsilon_L(t)
is
allowed in the following way:
Cor( \epsilon_i(t), \epsilon_j(t)) = \rho_{i,j}, \quad \forall
i \neq j, \quad \forall 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, \ldots, t_{P-1} = b]
\subset I
.
Value
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 \times P
matrices).
See Also
exp_cov_function
, mfData
,
generate_gauss_fdata
Examples
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 ) )