irregFunData-class: A class for irregularly sampled functional data

irregFunData-classR Documentation

A class for irregularly sampled functional data

Description

The irregFunData class represents functional data that is sampled irregularly on one-dimensional domains. The two slots represent the observation points (x-values) and the observed function values (y-values).

Usage

irregFunData(argvals, X)

## S4 method for signature 'list,list'
irregFunData(argvals, X)

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

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

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

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

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

Arguments

argvals

A list of numerics, corresponding to the observation points for each realization X_i (see Details).

X

A list of numerics, corresponding to the observed functions X_i (see Details).

object

An irregFunData object.

x

The irregFunData object.

value

The names to be given to the irregFunData curves.

...

Other parameters passed to summary.

Details

Irregular functional data are realizations of a random process

X: \mathcal{T} \to \mathrm{IR},

where each realization X_i of X is given on an individual grid T_i \subset \mathcal{T} of observation points. As for the funData class, each object of the irregFunData class has two slots; the argvals slot represents the observation points and the X slot represents the observed data. In contrast to the regularly sampled data, both slots are defined as lists of vectors, where each entry corresponds to one observed function:

  • argvals[[i]] contains the vector of observation points T_i for the i-th function,

  • X[[i]] contains the corresponding observed data X_i(t_{ij}), t_{ij} \in T_i.

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

  • dimSupp, nObs: Informations about the support dimensions and the number of observations,

  • getArgvals, extractObs: Getting/setting slot values (instead of accessing them directly via irregObject@argvals, irregObject@X) and extracting single observations or data on a subset of the domain,

  • integrate, norm: Integrate all observations over their domain or calculating the L^2 norm.

An irregFunData object can be coerced to a funData object using as.funData(irregObject). The regular functional data object is defined on the union of all observation grids of the irregular object. The value of the new object is marked as missing (NA) for observation points that are in the union, but not in the original observation grid.

Methods (by generic)

  • irregFunData(argvals = list, X = list): Constructor for irregular functional data objects.

  • show(irregFunData): Print basic information about the irregFunData object in the console. The default console output for irregFunData objects.

  • names(irregFunData): Get the names of the irregFunData object.

  • names(irregFunData) <- value: Set the names of the irregFunData object.

  • str(irregFunData): A str method for irregFunData objects, giving a compact overview of the structure.

  • summary(irregFunData): A summary method for irregFunData objects.

Functions

  • irregFunData(): Constructor for irregular functional data objects

Slots

argvals

A list of numerics, representing the observation grid T_i for each realization X_i of X.

X

A list of numerics, representing the values of each observation X_i of X on the corresponding observation points T_i.

Warning

Currently, the class is implemented only for functional data on one-dimensional domains \mathcal{T} \subset \mathrm{IR}.

See Also

funData, multiFunData

Examples

# Construct an irregular functional data object
i1 <- irregFunData(argvals = list(1:5, 2:4), X = list(2:6, 3:5))
# Display in the console
i1
# Summarize
summary(i1)

# A more realistic object
argvals <- seq(0,2*pi, 0.01)
ind <- replicate(11, sort(sample(1:length(argvals), sample(5:10,1)))) # sample observation points
argvalsIrreg <- lapply(ind, function(i){argvals[i]})
i2 <- irregFunData(argvals = argvalsIrreg, X = mapply(function(x, a){a * sin(x)},
             x = argvalsIrreg, a = seq(0.75, 1.25, by = 0.05)))
# Display/summary gives basic information
i2
summary(i2)
# Use the plot function to get an impression of the data
plot(i2) 

ClaraHapp/funData documentation built on Feb. 20, 2024, 6:07 p.m.