fregre.np. The output $y$
is scalar. A functional covariate $X$ and a multivariate non functional covariate $Z$ are considered.$$y =\emph{r(X)}+\sum_{j=1}^{p}{Z_j\beta_j}+\epsilon$$
The unknown smooth real function $r$ is estimated by means of $$\hat{r}_{h}(X)=\sum_{i=1}^{n}{w_{n,h}(X,X_{i})(Y_{i}-Z_{i}^{T}\hat{\beta}_{h})}$$ where $W_h$ is the weight function:
$w_{n,h}(X,X_i)= K( d( X , X_i )/h ) / \sum_(j=1:n) K( d( X, X_j )/h )$ with smoothing parameter $h$, an asymmetric kernel $K$ and a metric or semi-metric $d$. In fregre.plm() by default $W_h$ is a functional version of the Nadaraya-Watson-type weights (type.S=S.NW) with asymmetric normal kernel (Ker=AKer.norm) in $L_2$ (metric=metric.lp with p=2). The unknown parameters $\beta_j$ for the multivariate non functional covariates are estimated by means of $\beta.est_j=(Z_h'Z_h)^{-1} Z_h^{T}Z_h$ where $Z_h=(I-W_h)Z$ with the smoothing parameter $h$. The errors $\epsilon$ are independent, with zero mean, finite variance $\sigma^2$ and $E[\epsilon|Z_1,...,Z_p,X(t)]=0$.
fregre.plm(formula,data,h=NULL,Ker=AKer.norm,metric=metric.lp,
type.CV = GCV.S,type.S=S.NW,par.CV=list(trim=0,draw=FALSE),
par.S=list(w=1),...)formula (or one that can be coerced to that class): a symbolic description of the model to be fitted. The details of model specification are given under Details.h>0. Default argument values are provided as the sequence of length 51 from 2.5%--quantile to 25%--quantile of the distance between the functional data, see h.default.metric.lp.GCV.S method.S. By default S is calculated by Nadaraya-Watson kernel estimator (S.NW).type.CV: trim, the alpha of the trimming
and draw=TRUE.type.S: w, the weights.y minus fitted values.data list is called "df" and is a data frame with the response and non functional explanatory variables, as link{lm}. If non functional data into the formula then lm regression is performed.
Functional variable (fdata or fd class) is introduced in the second item in the data list. If only functional variable into the formula then fregre.np.cv is performed.
The function estimates the value of smoothing parameter or the bandwidth h through Generalized Cross-validation GCV criteria.
It computes the distance between curves using the metric.lp, although you can also use other metric function.
Different asymmetric kernels can be used, see Kernel.asymmetric.
Ferraty, F. and Vieu, P. (2006). Nonparametric functional data analysis. Springer Series in Statistics, New York.
Hardle, W. Applied Nonparametric Regression. Cambridge University Press, 1994.
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/
predict.fregre.plm and summary.fregre.fd
Alternative methods: fregre.lm, fregre.np and fregre.np.cv
## Not run:
# data(tecator)
# x=tecator$absorp.fdata[1:129]
# dataf=tecator$y[1:129,]
#
# f=Fat~Water+x
# ldata=list("df"=dataf,"x"=x)
# res.plm=fregre.plm(f,ldata)
# summary(res.plm)
#
# # with 2nd derivative of functional data
# x.fd=fdata.deriv(x,nderiv=2)
# f2=Fat~Water+x.fd
# ldata2=list("df"=dataf,"x.fd"=x.fd)
# res.plm2=fregre.plm(f2,ldata2)
# summary(res.plm2)
# ## End(Not run)
Run the code above in your browser using DataLab