Learn R Programming

funcy (version 1.0.1)

regFuncy: Converts irregular data into regular.

Description

Converts irregular data into regular by projecting it to a basis or interpolating it.

Usage

regFuncy(data, timeNr = 10, method = "project", baseType = NULL, nbasis = 4, plot = TRUE)

Arguments

data

Dataset in "Format1" (see funcit).

timeNr

Number of time points the regular dataset shall be evaluated at.

method

Method to tranform regularization with one of "project" or "interpolate". See Details.

baseType

Base type. Only used if method="project".

nbasis

Number of basis functions.

plot

Plot the result?

Value

data

Numeric matrix of "Format1" (see formatFuncy).

time

Vector of evaluation time points.

Details

Data is either interpolated or projected to a basis. For all methods, curve evaluation takes place on time points calculated by makeCommonTime.

References

Christina Yassouridis and Dominik Ernst and Friedrich Leisch. Generalization, Combination and Extension of Functional Clustering Algorithms: The R Package funcy. Journal of Statistical Software. 85 (9). 1--25. 2018

F. Yao and H.G. M<U+00FC>ller and J.L. Wang. Functional data analysis for sparse longitudinal data. J. American Statistical Association. 100. 577--590. 2005 URL: http://www.stat.ucdavis.edu/PACE/

Examples

Run this code
# NOT RUN {
##Generate irregular dataset
set.seed(2705)
ds <- sampleFuncy(reg=FALSE, obsNr=100, timeNrMin=5, timeNrMax=10)


reg <- regFuncy(Data(ds), timeNr=10, baseType="splines",nbasis=5, method="project")

reg <- regFuncy(Data(ds),timeNr=10, method="interpolate")

# }
# NOT RUN {
reg <- regFuncy(Data(ds), timeNr=10, baseType="eigenbasis", nbasis=5,
method="project")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab