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).
class
funData(argvals, X)## 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 NxM (for one-dimensional domains, or c("NxM1xldotsx\n", "Md") 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→IRX:T−>IR
on a d-dimensional domain T. The data is usually sampled on a fine grid TsubsetofT, 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 NxM (for one-dimensional domains, or c("Nx\n", "M1xldotsxMd") for higher-dimensional domains). Here N equals the number of observations and M denotes the number of sampling points (for higher dimensional domains Mi 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:
dimSupp, nObs: Informations about the support dimensions and the number of observations,
getArgvals, extractObs: Getting/Setting slot values (instead of accessing them directly via funData@argvals, funData@X) and extracting single observations or data on a subset of the domain,
integrate, norm: Integrate all observations over their domain or calculating the L2 norm.
A funData object can be coerced to a multiFunData object using as.multiFunData(funDataObject).
Methods (by generic)
funData(argvals = list, X = array): Constructor for functional data objects with argvals given as list.
funData(argvals = numeric, X = array): Constructor for functional data objects with argvals
given as vector of numerics (only valid for one-dimensional domains).
show(funData): Print basic information about the funData object in the console. The default console output for funData objects.
names(funData): Get the names of the funData object.
names(funData) \<- value: Set the names of the funData object.
str(funData): A str method for funData objects, giving a compact overview of the structure.
summary(funData): A summary method for funData objects.
Functions
funData(): Constructor for functional data objects, first argument (argvals) passed as list or vector of numerics
Slots
argvals: The domain T of the data. See Details.
X: The functional data samples. See Details.
Examples
### Creating a one-dimensional funData object with 2 observations# Basicf1 <- new("funData", argvals = list(1:5), X = rbind(1:5,6:10))# Using the constructor with first argument supplied as arrayf2 <- funData(argvals = list(1:5), X = rbind(1:5,6:10))# Using the constructor with first argument supplied as numeric vectorf3 <- funData(argvals =1:5, X = rbind(1:5,6:10))# Test if all the sameall.equal(f1,f2)all.equal(f1,f3)# Display funData object in the consolef3
# A more realistic objectargvals <- seq(0,2*pi,0.01)object <- funData(argvals, outer(seq(0.75,1.25, by =0.05), sin(argvals)))# Display / summary give basic informationobject
summary(object)# Use the plot function to get an impression of the dataplot(object)### Higher-dimensional funData objects with 2 observations# Basicg1 <- new("funData", argvals = list(1:5,1:3), X = array(1:30, dim = c(2,5,3)))# Using the constructorg2 <- funData(argvals = list(1:5,1:3), X = array(1:30, dim = c(2,5,3)))# Test if the sameall.equal(g1,g2)# Display funData object in the consoleg2
# Summarize informationsummary(g2)