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})=\frac{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 $\hat{\beta}_j=(\tilde{Z}_{h}^{T}\tilde{Z}_{h})^{-1}\tilde{Z}_{h}^{T}\tilde{Z}_{h}$ where $\tilde{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,\ldots,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
.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
.predict.fregre.plm
and summary.fregre.fd
Alternative methods: fregre.lm
, fregre.np
and fregre.np.cv
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)
Run the code above in your browser using DataLab