mat2fd: Obtain a fd object from a matrix

Description Usage Arguments Value Examples

View source: R/misc.R

Description

This function returns a fd object obtained from the discretized functional observations contained in mat_obj.

It is assumed that the functional observations contained in mat_obj are real observations, hence a poligonal base will be used to obtain the functional object.

Usage

1
mat2fd(mat_obj, range_val = c(0, 1), argvals = NULL)

Arguments

mat_obj

A matrix that contains the discretized functional observations.

range_val

A numeric vector of length 2 that contains the range of the observed functional data. By default range_val = c(0,1).

argvals

Optinal argument that contains a strictly increasing vector of argument values at which line segments join to form a polygonal line. If argvals = NULL, it is assumed a equidistant discretization vector. By default argvals = NULL.

Value

A fd object obtained from the functional observations in mat_obj.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Example 1
N <- 100
dv <- 30
v <- seq(from = 0, to = 1, length.out = dv)
set.seed(150) # For replication
mat_func_obs <- matrix(rnorm(N*dv), 
                       nrow = N, 
                       ncol = dv)
fd_func_obs <- mat2fd(mat_obj = mat_func_obs,
                      range_val = range(v),
                      argvals = v)
plot(fd_func_obs)

fdaACF documentation built on Oct. 23, 2020, 8:05 p.m.

Related to mat2fd in fdaACF...