funData-class: A class for (univariate) functional data

Description Usage Arguments Details Methods (by generic) Slots See Also Examples

Description

The funData class represents functional data on d-dimensional domains. The two slots represent the domain (x-values) and the values of the different observations (y-values).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## S4 method for signature 'list,array'
funData(argvals, X)

## S4 method for signature 'numeric,array'
funData(argvals, X)

## S4 method for signature 'funData'
show(object)

## S4 method for signature 'funData'
names(x)

## S4 replacement method for signature 'funData'
names(x) <- value

## S4 method for signature 'funData'
str(object, ...)

## S4 method for signature 'funData'
summary(object, ...)

Arguments

argvals

A list of numeric vectors or a single numeric vector, giving the sampling points in the domains. See Details.

X

An array of dimension N x M (for one-dimensional domains, or N x M_1 x … x M_d for higher-dimensional domains), giving the observed values for N individuals. Missing values can be included via NA. See Details.

object

A funData object.

x

The funData object.

value

The names to be given to the funData curves.

...

Other parameters passed to summary.

Details

Functional data can be seen as realizations of a random process

X: T -> IR

on a d-dimensional domain T. The data is usually sampled on a fine grid T subset of T, which is represented in the argvals slot of a funData object. All observations are assumed to be sampled over the same grid T, but can contain missing values (see below). If T is one-dimensional, argvals can be supplied either as a numeric vector, containing the x-values or as a list, containing such a vector. If T is higher-dimensional, argvals must always be supplied as a list, containing numeric vectors of the x-values in dimensions 1,…,d.

The observed values are represented in the X slot of a funData object, which is an array of dimension N x M (for one-dimensional domains, or N x M_1 x … x M_d for higher-dimensional domains). Here N equals the number of observations and M denotes the number of sampling points (for higher dimensional domains M_i denotes the number of sampling points in dimension i, i = 1,…, d). Missing values in the observations are allowed and must be marked by NA. If missing values occur due to irregular observation points, the data can be stored alternatively as an object of class irregFunData.

Generic functions for the funData class include a print method, plotting and basic arithmetics. Further methods for funData:

A funData object can be coerced to a multiFunData object using as.multiFunData(funDataObject).

Methods (by generic)

Slots

argvals

The domain T of the data. See Details.

X

The functional data samples. See Details.

See Also

irregFunData, multiFunData

Examples

 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
28
29
30
31
32
33
34
35
36
### Creating a one-dimensional funData object with 2 observations
# Basic
f1 <- new("funData", argvals = list(1:5), X = rbind(1:5,6:10))
# Using the constructor with first argument supplied as array
f2 <- funData(argvals = list(1:5), X = rbind(1:5, 6:10)) 
# Using the constructor with first argument supplied as numeric vector
f3 <- funData(argvals = 1:5, X = rbind(1:5, 6:10)) 
# Test if all the same
all.equal(f1,f2) 
all.equal(f1,f3)
# Display funData object in the console
f3 

# A more realistic object
argvals <- seq(0,2*pi,0.01)
object <- funData(argvals, outer(seq(0.75, 1.25, by = 0.05), sin(argvals)))
# Display / summary give basic information
object 
summary(object)
# Use the plot function to get an impression of the data
plot(object) 


### Higher-dimensional funData objects with 2 observations
# Basic
g1 <- new("funData", argvals = list(1:5, 1:3),
                     X = array(1:30, dim = c(2,5,3))) 
# Using the constructor
g2 <- funData(argvals = list(1:5, 1:3),
              X = array(1:30, dim = c(2,5,3)))
# Test if the same
all.equal(g1,g2)
# Display funData object in the console
g2 
# Summarize information
summary(g2)

funData documentation built on Oct. 17, 2021, 5:06 p.m.