Description Usage Arguments Details Value See Also Examples
These functions calculate a penalized or unpenalized tensor product spline
basis representation for functional data on twodimensional domains based on
the gam
/bam
functions in the
mgcv package. See Details.
1 2 3 4  splineBasis2D(funDataObject, bs = "ps", m = NA, k = 1)
splineBasis2Dpen(funDataObject, bs = "ps", m = NA, k = 1,
parallel = FALSE)

funDataObject 
An object of class 
bs 
A vector of character strings (or a single character string),
specifying the type of basis functions to be used. Defaults to 
m 
A numeric vector (or a single number), the order of the spline
basis. Defaults to 
k 
An numeric vector (or a single number), the number of basis
functions used. Defaults to 
parallel 
Logical (only for function 
If the basis representation is calculated without penalization
(splineBasis2D
), the coefficients are computed using the
gam
function from the mgcv package. In the case of
penalization (splineBasis2Dpen
), the function bam
(for large GAMs) is used instead.
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 
univDecomp
, splineBasis1D
,
gam
, bam
,
foreach
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23  # simulate image data for N = 100 observations
N < 100
b1 < eFun(seq(0,1,0.01), M = 7, type = "Poly")
b2 < eFun(seq(pi, pi, 0.03), M = 8, type = "Fourier")
b < tensorProduct(b1,b2) # 2D basis functions
scores < matrix(rnorm(N*56), nrow = N)
# calculate observations (= linear combination of basis functions)
dat < MFPCA:::expandBasisFunction(scores = scores, functions = b)
# calculate 2D spline basis decomposition (needs some time)
# use 5 basis functions in each direction
dataDec < MFPCA:::splineBasis2D(dat, k = c(5,5))
# add some noise to the data
noisyDat < addError(dat, sd = 0.5)
# calculate 2D spline basis decomposition with penalization (needs A LOT more time)
# use 5 basis functions in each direction
noisyDataDec < MFPCA:::splineBasis2Dpen(noisyDat, k = c(5,5))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.