This function performs the smoothing of a curve using the Nadaraya-Watson estimator given a particular kernel.

estimate_curve(
  curve,
  grid,
  bandwidth,
  bandwidth_times = NULL,
  kernel_name = "epanechnikov",
  n_obs_min = 1
)

Arguments

curve

List, with two entries:

  • $t Sampling points.

  • $x Observed points.

grid

Vector, sampling points at which the curve is estimated.

bandwidth

Vector, estimation of the bandwidth. If a unique element is provided, we use a unique bandwidth for the curve. However, if a vector is given, the bandwidth changes depending on the sampling points.

bandwidth_times

Vector (default = NULL), times at which the bandwidths have been estimated. Only used if the parameter bandwidth is a vector.

kernel_name

String (default = 'epanechnikov'), the kernel used for the estimation:

  • epanechnikov

  • uniform

  • biweight

n_obs_min

Integer (default = 1), minimum number of observation for the smoothing.

Value

List, with two entries:

  • $t Sampling points.

  • $x Estimated points.