
Computes functional regression between functional explanatory variable
fregre.basis(
fdataobj,
y,
basis.x = NULL,
basis.b = NULL,
lambda = 0,
Lfdobj = vec2Lfd(c(0, 0), rtt),
weights = rep(1, n),
...
)
fdata
class object.
Scalar response with length n
.
Basis for functional explanatory data fdataobj
.
Basis for functional beta parameter.
A roughness penalty. By default, no penalty lambda=0
.
See eval.penalty.
weights
Further arguments passed to or from other methods.
Return:
call The matched call.
coefficients A named vector of coefficients
residuals y
minus fitted values
.
fitted.values Estimated scalar response.
beta.est beta parameter estimated of class fd
weights(only for' weighted fits) the specified weights.
df The residual degrees of' freedom.
r2 Coefficient of determination.
sr2 Residual' variance.
Vp Estimated covariance matrix for the parameters.
H Hat matrix.
y Response.
fdataobj Functional explanatory data of class fdata
.
a.est Intercept parameter estimated
x.fd Centered functional explanatory data of class fd
.
basis.b Basis used' for beta parameter estimation.
lambda.opt A roughness penalty.
Lfdobj Order of a derivative or a linear differential operator.
P Penalty matrix.
lm Return lm
object
The function uses the basis representation proposed by Ramsay and Silverman (2005) to model the
relationship between the scalar response and the functional covariate by
basis representation of the observed functional data
The functional linear models estimated by the expression:
If fregre.basis
incorporates a
roughness penalty:
This function allows covariates of class fdata
, matrix
,
data.frame
or directly covariates of class fd
. The function
also gives default values to arguments basis.x
and basis.b
for
representation on the basis of functional data
If basis=
NULL
creates the bspline
basis by
create.bspline.basis
. If the functional covariate
fdataobj
is a matrix or data.frame, it creates an object of class
"fdata" with default attributes, see fdata
. If
basis.x$type=``fourier''
and basis.b$type=``fourier''
, the
basis are orthonormal and the function decreases the number of fourier basis
elements on the basis.x
and basis.b
respectively.
Ramsay, James O., and Silverman, Bernard W. (2006), Functional Data Analysis, 2nd ed., Springer, New York.
Febrero-Bande, M., Oviedo de la Fuente, M. (2012). Statistical Computing in Functional Data Analysis: The R Package fda.usc. Journal of Statistical Software, 51(4), 1-28. http://www.jstatsoft.org/v51/i04/
See Also as: fregre.basis.cv
,
summary.fregre.fd
and predict.fregre.fd
.
Alternative method: fregre.pc
and fregre.np
.
# NOT RUN {
# fregre.basis
data(tecator)
names(tecator)
absorp=tecator$absorp.fdata
ind=1:129
x=absorp[ind,]
y=tecator$y$Fat[ind]
tt=absorp[["argvals"]]
res1=fregre.basis(x,y)
summary(res1)
basis1=create.bspline.basis(rangeval=range(tt),nbasis=19)
basis2=create.bspline.basis(rangeval=range(tt),nbasis=9)
res5=fregre.basis(x,y,basis1,basis2)
summary(res5)
x.d2=fdata.deriv(x,nbasis=19,nderiv=1,method="bspline",class.out="fdata")
res7=fregre.basis(x.d2,y,basis1,basis2)
summary(res7)
# }
Run the code above in your browser using DataLab