fregre.gkam | R Documentation |
Computes functional regression between functional explanatory variables (X(t_1),...,X(t_q)) and scalar response Y using backfitting algorithm.
fregre.gkam( formula, family = gaussian(), data, weights = rep(1, nobs), par.metric = NULL, par.np = NULL, offset = NULL, control = list(maxit = 100, epsilon = 0.001, trace = FALSE, inverse = "solve"), ... )
formula |
an object of class |
family |
a description of the error distribution and link function to
be used in the model. This can be a character string naming a family
function, a family function or the result of a call to a family function.
(See |
data |
List that containing the variables in the model. |
weights |
weights |
par.metric |
List of arguments by covariate to pass to the
|
par.np |
List of arguments to pass to the |
offset |
this can be used to specify an a priori known component to be included in the linear predictor during fitting. |
control |
a list of parameters for controlling the fitting process, by
default: |
... |
Further arguments passed to or from other methods. |
inverse |
="svd" (by default) or ="solve" method. |
The smooth functions f(.) are estimated nonparametrically using a
iterative local scoring algorithm by applying Nadaraya-Watson weighted
kernel smoothers using fregre.np.cv
in each step, see
Febrero-Bande and Gonzalez-Manteiga (2011) for more details.
Consider the fitted response g(Y.est)=Hy,
where H is the weighted hat matrix.
Opsomer and Ruppert
(1997) solves a system of equations for fit the unknowns
f(.) computing the additive smoother matrix H_k
such that f.est_k(X_k)=H_k Y and
H= H_1+,...,+H_q. The additive model is fitted
as follows:
g(y.est)=∑(i:q) f.est_i(X_i)
result:
List of non-parametric estimation by covariate.
fitted.values:
Estimated scalar response.
residuals:
y
minus fitted values
.
effects:
The residual degrees of freedom.
alpha:
Hat matrix.
family:
Coefficient of determination.
linear.predictors:
Residual variance.
deviance:
Scalar response.
aic:
Functional explanatory data.
null.deviance:
Non functional explanatory data.
iter
: Distance matrix between curves.
w:
beta coefficient estimated
eqrank:
List that containing the variables in the model.
prior.weights:
Asymmetric kernel used.
y:
Scalar response.
H:
Hat matrix, see Opsomer and Ruppert(1997) for more details.
converged:
conv.
Febrero-Bande, M. and Oviedo de la Fuente, M.
Febrero-Bande M. and Gonzalez-Manteiga W. (2012). Generalized Additive Models for Functional Data. TEST. Springer-Velag. doi: 10.1007/s11749-012-0308-0
Opsomer J.D. and Ruppert D.(1997). Fitting a bivariate additive model
by local polynomial regression.Annals of Statistics, 25
, 186-211.
See Also as: fregre.gsam
, fregre.glm
and fregre.np.cv
## Not run: data(tecator) ab=tecator$absorp.fdata[1:100] ab2=fdata.deriv(ab,2) yfat=tecator$y[1:100,"Fat"] # Example 1: # Changing the argument par.np and family yfat.cat=ifelse(yfat<15,0,1) xlist=list("df"=data.frame(yfat.cat),"ab"=ab,"ab2"=ab2) f2<-yfat.cat~ab+ab2 par.NP<-list("ab"=list(Ker=AKer.norm,type.S="S.NW"), "ab2"=list(Ker=AKer.norm,type.S="S.NW")) res2=fregre.gkam(f2,family=binomial(),data=xlist, par.np=par.NP) res2 # Example 2: Changing the argument par.metric and family link par.metric=list("ab"=list(metric=semimetric.deriv,nderiv=2,nbasis=15), "ab2"=list("metric"=semimetric.basis)) res3=fregre.gkam(f2,family=binomial("probit"),data=xlist, par.metric=par.metric,control=list(maxit=2,trace=FALSE)) summary(res3) # Example 3: Gaussian family (by default) # Only 1 iteration (by default maxit=100) xlist=list("df"=data.frame(yfat),"ab"=ab,"ab2"=ab2) f<-yfat~ab+ab2 res=fregre.gkam(f,data=xlist,control=list(maxit=1,trace=FALSE)) res ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.