Aggregates the squared residuals of a local polynomial kernel smoothing into the regular grid of discretization points, i.e. computes the functional residual variance (using \(n\) as denominator) and the sample size.

npf.bin.res2(x)

Arguments

x

local polynomial fit (npf.locpol-class object).

Value

Returns an S3 object of class npf.bin.res2 extending npsp::bin.data (bin data + grid par.).

See also

Examples

fd <- npf.data(ozone, dimnames = "day")
# Linear Local trend estimate
lp <- locpol(fd, h = 35)
# Bandwidth selection for variance estimation
bin.res2 <- npf.bin.res2(lp)
h.cv(bin.res2)
#> $h
#>          [,1]
#> [1,] 6.947037
#> 
#> $value
#> [1] 358771.2
#> 
#> $objective
#> [1] "CV"
#>