append_mfData {roahd}R Documentation

Append two compatible multivariate functional datasets

Description

This is a convenience function that simplifies the task of appending multivariate functional observations of two datasets to a unique multivariate functional dataset.

Usage

append_mfData(mfD1, mfD2)

Arguments

mfD1

is the first multivariate functional dataset, stored into an mfData object.

mfD2

is the second multivariate functional dataset, stored into an mfData object.

Details

The two original datasets must be compatible, i.e. must have same number of components (dimensions) and must be defined on the same grid. If we denote with X_1^(i), \ldots, X_n^(i), i=0, \ldots, L the first dataset, defined over the grid I = t_1, \ldots, t_P, and with Y_1^(i), \ldots, Y_m^(i), i=0, \ldots, L the second functional dataset, the method returns the union dataset obtained by taking all the n + m observations together.

Value

The function returns a mfData object containing the union of mfD1 and mfD2

See Also

append_fData, mfData

Examples

# Creating two simple bivariate datasets

grid = seq(0, 2 * pi, length.out = 100)

values11 = matrix( c(sin(grid),
                     sin(2 * grid)), nrow = 2, ncol = length(grid),
                   byrow=TRUE)
values12 = matrix( c(sin(3 * grid),
                     sin(4 * grid)), nrow = 2, ncol = length(grid),
                   byrow=TRUE)
values21 = matrix( c(cos(grid),
                     cos(2 * grid)), nrow = 2, ncol = length(grid),
                   byrow=TRUE)
values22 = matrix( c(cos(3 * grid),
                     cos(4 * grid)), nrow = 2, ncol = length(grid),
                   byrow=TRUE)

mfD1 = mfData( grid, list(values11, values12) )
mfD2 = mfData( grid, list(values21, values22) )

# Appending them to a unique dataset
append_mfData(mfD1, mfD2)


[Package roahd version 1.4.3 Index]