Description Usage Arguments Value See Also Examples
These functions calculate a penalized or unpenalized spline basis decomposition for functional data on onedimensional domains based on the gam function in the mgcv package.
1 2 3 4  splineBasis1D(funDataObject, bs = "ps", m = NA, k = 1)
splineBasis1Dpen(funDataObject, bs = "ps", m = NA, k = 1,
parallel = FALSE)

funDataObject 
An object of class 
bs 
A character string, specifying the type of basis functions to be
used. Defaults to 
m 
A numeric, the order of the spline basis. Defaults to 
k 
A numeric, the number of basis functions used. Defaults to

parallel 
Logical (only for 
scores 
A matrix of scores (coefficients) with dimension

B 
A matrix containing the scalar product of all pairs of basis functions. 
ortho 
Logical, set to 
functions 

settings 
A list with entries 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  # generate some data
dat < simFunData(argvals = seq(0,1,0.01), M = 5,
eFunType = "Poly", eValType = "linear", N = 100)$simData
# calculate spline basis decomposition
dataDec < MFPCA:::splineBasis1D(dat) # use mgcv's default parameters
str(dataDec)
# add some noise to the data
noisyDat < addError(dat, sd = 0.5)
# calculate spline basis decomposition with penalization to reduce noise
noisyDataDec < MFPCA:::splineBasis1Dpen(dat) # use mgcv's default parameters
str(noisyDataDec)
# check if noise has been filtered out by penalization
all.equal(noisyDataDec$scores, dataDec$scores, check.attributes = FALSE)
# > have almost the same coefficients

Loading required package: funData
Attaching package: 'funData'
The following object is masked from 'package:stats':
integrate
List of 5
$ scores : num [1:100, 1:10] 1.4283 0.2946 0.0229 1.5949 0.2489 ...
.. attr(*, "dimnames")=List of 2
.. ..$ : NULL
.. ..$ : chr [1:10] "dM(Intercept)" "dM" "dM" "dM" ...
$ B : num [1:10, 1:10] 1 0.002757 0.000219 0.001111 0.001111 ...
$ ortho : logi FALSE
$ functions: NULL
$ settings :List of 3
..$ bs: chr "ps"
..$ k : num 10
..$ m : num [1:2] 2 2
List of 5
$ scores : num [1:100, 1:10] 1.4283 0.2946 0.0229 1.5949 0.2489 ...
.. attr(*, "dimnames")=List of 2
.. ..$ : chr [1:100] "result.1" "result.2" "result.3" "result.4" ...
.. ..$ : chr [1:10] "(Intercept)" "s(x).1" "s(x).2" "s(x).3" ...
$ B : num [1:10, 1:10] 1 0.002757 0.000219 0.001111 0.001111 ...
$ ortho : logi FALSE
$ functions: NULL
$ settings :List of 3
..$ bs: chr "ps"
..$ k : num 10
..$ m : num [1:2] 2 2
[1] "Mean relative difference: 3.933435e06"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.