Description Usage Arguments Value References Examples
Estimation of the functional parameters in a multiple functional regression. The smoothing parameters and the number of basis is assumed to be known.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | funcreg(form, create_basis=create.bspline.basis, LD=2, lambda,
k, regularized=TRUE, CstInt=FALSE, CV=FALSE, data=NULL,
alpha=1e-5, optAlpha=FALSE,
controlAlpha=list(), ...)
## S3 method for class 'funcreg'
print(x, ...)
## S3 method for class 'funcreg'
summary(object, ...)
## S3 method for class 'funcreg'
fitted(object, ...)
## S3 method for class 'funcreg'
residuals(object, ...)
|
x |
An object of class "funcreg" |
object |
An object of class "funcreg" |
form |
A formula for the functional regression. Arguments are
objects of class "myfda" obtained either by |
create_basis |
The function used to create the basis object (see
|
LD |
Either a nonnegative integer defining an order of a
derivative or a linear differential operator (see
|
lambda |
A vector of regularization parameters that penalizes for the absence of
smoothness. The dimention is 2 times the number of regressors plus 1
if there is an intercept and if |
k |
A vector of integers representing the number of basis for each
functional parameter. The first is for the intercept (if there is an
intercept and that |
regularized |
If |
CstInt |
If |
CV |
if |
data |
An optional list of |
alpha |
The regularization parameter. The value is added to the diagonal of the regression matrix to make sure it is positive definite. |
optAlpha |
If |
controlAlpha |
A list of tuning parameter for the choice of the
optimal |
... |
For |
It returns an object of 'class' "funcreg"
The object of class "funcreg" is a list containing at least:
X |
The list of functional regressors. |
Y |
The functional response. |
data |
A list with element "t" for time units of the observed data and "Y" for the matrix of observed response varable. |
Ramsay, James O., & Silverman, Bernard W. (2005), Functional Data Analysis, Springer, New York.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | data(GDPv56)
## We just create response and a covariate artificialy from the GDP
## series
y <- GDPv56[,1:30]
x <- GDPv56[,31:60]
t <- seq(0,1,len=nrow(y))
## First we create the "myfda" objects
yfd <- coefEst(y, t, .0004, 15, 2)
xfd <- coefEst(x, t, .0004, 15, 2)
## we just set lambda and k to arbitrary values
res <- funcreg(yfd~xfd, k=c(5,5), lambda=c(.001,.001,.001))
res
summary(res)
plot(fitted(res))
plot(residuals(res))
## Getting the optimal regularization parameter
res <- funcreg(yfd~xfd, k=c(5,5), lambda=c(.001,.001,.001),
optAlpha=TRUE)
res
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.