Description Usage Arguments Value See Also Examples
This functions simulates (univariate) functional data f_1,…, f_N based on a truncated KarhunenLoeve representation:
f_i(t) = ∑_{m = 1}^M ξ_{i,m} φ_m(t).
The eigenfunctions (basis functions) φ_m(t) are generated
using eFun
, the scores ξ_{i,m} are simulated
independently from a normal distribution with zero mean and decreasing
variance based on the eVal
function.
1  simFunData(argvals, M, eFunType, ignoreDeg = NULL, eValType, N)

argvals 
A numeric vector, containing the observation points (a fine grid on a real interval) of the functional data that is to be simulated. 
M 
An integer, giving the number of unvariate basis functions to use. See Details. 
eFunType 
A character string specifying the type of univariate
orthonormal basis functions to use. See 
ignoreDeg 
A vector of integers, specifying the degrees to ignore when
generating the univariate orthonormal bases. Defaults to 
eValType 
A character string, specifying the type of
eigenvalues/variances used for the generation of the simulated functions
based on the truncated KarhunenLoeve representation. See

N 
An integer, specifying the number of multivariate functions to be generated. 
simData 
A 
trueFuns 
A 
trueVals 
A vector of numerics, representing the true eigenvalues used for simulating the data. 
funData
, eFun
, eVal
,
addError
, sparsify
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  oldPar < par(no.readonly = TRUE)
# Use Legendre polynomials as eigenfunctions and a linear eigenvalue decrease
test < simFunData(seq(0,1,0.01), M = 10, eFunType = "Poly", eValType = "linear", N = 10)
plot(test$trueFuns, main = "True Eigenfunctions")
plot(test$simData, main = "Simulated Data")
# The use of ignoreDeg for eFunType = "PolyHigh"
test < simFunData(seq(0,1,0.01), M = 4, eFunType = "Poly", eValType = "linear", N = 10)
test_noConst < simFunData(seq(0,1,0.01), M = 4, eFunType = "PolyHigh",
ignoreDeg = 1, eValType = "linear", N = 10)
test_noLinear < simFunData(seq(0,1,0.01), M = 4, eFunType = "PolyHigh",
ignoreDeg = 2, eValType = "linear", N = 10)
test_noBoth < simFunData(seq(0,1,0.01), M = 4, eFunType = "PolyHigh",
ignoreDeg = 1:2, eValType = "linear", N = 10)
par(mfrow = c(2,2))
plot(test$trueFuns, main = "Standard polynomial basis (M = 4)")
plot(test_noConst$trueFuns, main = "No constant basis function")
plot(test_noLinear$trueFuns, main = "No linear basis function")
plot(test_noBoth$trueFuns, main = "Neither linear nor constant basis function")
par(oldPar)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs in the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.