Learn R Programming

fdapace (version 0.1.1)

Lwls2D: Two dimensional local linear kernel smoother.

Description

Two dimensional local weighted least squares smoother. Only local linear smoother for estimating the original curve is available (no higher order, no derivative).

Usage

Lwls2D(bw, kern = "epan", xin, yin, win = NULL, xout1 = NULL,
  xout2 = NULL, xout = NULL, subset = NULL, crosscov = FALSE)

Arguments

bw
A scalar or a vector of length 2 specifying the bandwidth.
kern
Kernel used: 'gauss', 'rect', 'gausvar', 'epan' (default), 'quar'.
xin
An n by 2 dataframe or matrix of x-coordinate.
yin
A vector of y-coordinate.
win
A vector of weights on the observations.
xout1
a p1-vector of first output coordinate grid. Defaults to the input gridpoints if left unspecified.
xout2
a p2-vector of second output coordinate grid. Defaults to the input gridpoints if left unspecified.
xout
alternative to xout1 and xout2. A matrix of p by 2 specifying the output points (may be inefficient if the size of xout is small).
subset
a vector with the indeces of x-/y-/w-in to be used (Default: NULL)
crosscov
using function for cross-covariance estimation (Default: FALSE)

Value

  • a p1 by p2 matrix of fitted values if xout is not specified. Otherwise a vector of length p corresponding to the rows of xout.