fData: 'S3' Class for univariate functional datasets.

Description Usage Arguments Details Value See Also Examples

View source: R/fData.R

Description

This function implements a constructor for elements of S3 class fData, aimed at implementing a representation of a functional dataset.

Usage

1
fData(grid, values)

Arguments

grid

the evenly spaced grid over which the functional observations are measured. It must be a numeric vector of length P.

values

the values of the observations in the functional dataset, provided in form of a 2D data structure (e.g. matrix or array) having as rows the observations and as columns their measurements over the 1D grid of length P specified in grid.

Details

The functional dataset is represented as a collection of measurement of the observations on an evenly spaced, 1D grid of discrete points (representing, e.g. time), namely, for functional data defined over a grid [t_0, t_1, …, t_{P-1}]:

f_{i,j} = f_i( t_0 + j h ), \quad h = \frac{t_P - t_0}{N}, \quad \forall j = 1, …, P, \quad \forall i = 1, … N.

Value

The function returns a S3 object of class fData, containing the following elements:

See Also

generate_gauss_fdata, sub-.fData

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Defining parameters
N = 20
P = 1e2

# One dimensional grid
grid = seq( 0, 1, length.out = P )

# Generating an exponential covariance function (see related help for more
# information )
C = exp_cov_function( grid, alpha = 0.3, beta = 0.4 )

# Generating a synthetic dataset with a gaussian distribution and
# required mean and covariance function:
values = generate_gauss_fdata( N,
                               centerline = sin( 2 * pi * grid ),
                               Cov = C )

fD = fData( grid, values )

roahd documentation built on Nov. 4, 2021, 1:07 a.m.