Learn R Programming

fda.usc (version 0.9.4)

fregre.np: Functional regression with scalar response using non-parametric kernel estimation

Description

Computes functional regression between functional explanatory variables and scalar response using kernel estimation.

Usage

fregre.np(fdataobj,y,h=NULL,Ker=AKer.norm,metric=metric.lp,
type.S=S.NW,...)

Arguments

fdataobj
fdata class object.
y
Scalar response with length n.
h
Smoothing parameter or bandwidth.
Ker
Type of asymmetric kernel used, by default asymmetric normal kernel.
metric
Metric function, by default metric.lp.
type.S
Type of smothing matrix S. By default S is calculated by Nadaraya-Watson kernel estimator (S.NW).
...
Arguments to be passed for metric.lp o other metric function.

Value

  • Return:
  • callThe matched call.
  • fitted.valuesEstimated scalar response.
  • HHat matrix.
  • residualsy minus fitted values.
  • dfThe residual degrees of freedom.
  • r2Coefficient of determination.
  • sr2Residual variance.
  • yResponse.
  • fdataobjFunctional explanatory data.
  • mdistDistance matrix between x and newx.
  • KerAsymmetric kernel used.
  • h.optsmoothing parameter or bandwidth.

Details

The distance between curves is calculated using the metric.lp although any other semimetric could be used (see semimetric.basis or semimetric.NPFDA functions). Different asymmetric kernels can be used, see Kernel.asymmetric.

References

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.

See Also

See Also as: fregre.np.cv, summary.fregre.fd and predict.fregre.fd . Alternative method: fregre.basis,cand fregre.pc.

Examples

Run this code
data(tecator)
absorp=tecator$absorp.fdata
ind=1:129
x=absorp[ind,]
y=tecator$y$Fat[ind]

res.np=fregre.np(x,y,Ker=AKer.epa)
summary.fregre.fd(res.np)
res.np2=fregre.np(x,y,Ker=AKer.tri)
summary.fregre.fd(res.np2)

# with other semimetrics.
res.pca1=fregre.np(x,y,Ker=AKer.tri,metri=semimetric.pca,q=1)
summary.fregre.fd(res.pca1)
res.deriv=fregre.np(x,y,metri=semimetric.deriv)
summary.fregre.fd(res.deriv)
x.d2=fdata.deriv(x,nderiv=1,method="fmm",class.out='fdata')
res.deriv2=fregre.np(x.d2,y)
summary.fregre.fd(res.deriv2)
x.d3=fdata.deriv(x,nderiv=1,method="bspline",class.out='fdata')
res.deriv3=fregre.np(x.d3,y)
summary.fregre.fd(res.deriv3)

Run the code above in your browser using DataLab