
Extract Fitted Values from bbnp_regression Object
fitted.bbnp_regression.RdExtracts the fitted conditional expectation values \(E[Y|X=x]\)
Usage
# S3 method for class 'bbnp_regression'
fitted(object, ...)Value
Numeric vector of fitted values for range estimation, or a single numeric value for point estimation
Examples
# \donttest{
set.seed(1)
x <- runif(500) + runif(500)
y <- 2 * x - x^2 + rnorm(length(x), sd = 0.3)
fit <- bias_bound_regression(x, y, bw = 0.1)
#> Warning: Fitted envelope slope r-hat = 1.84 is below the smoothness floor r >= 2 the method assumes: the Fourier transform does not show a clear power-law decay over the window (likely a supersmooth density or a non-power-law/non-monotone cross-spectrum). The returned envelope dominates the fitted frequency grid, but Schennach's coverage theorem may not apply. Inspect plot(fit, type = "ft").
fitted(fit)
#> [1] -0.01631556 0.03971758 0.08880370 0.13286582 0.17325616 0.21086803
#> [7] 0.24634785 0.28009574 0.31247658 0.34372845 0.37401238 0.40349033
#> [13] 0.43229551 0.46050684 0.48816882 0.51535628 0.54208085 0.56836813
#> [19] 0.59421710 0.61960689 0.64449822 0.66881815 0.69251910 0.71552898
#> [25] 0.73779173 0.75925843 0.77987787 0.79957759 0.81828656 0.83598573
#> [31] 0.85263756 0.86823686 0.88277705 0.89626919 0.90872478 0.92018180
#> [37] 0.93068414 0.94027918 0.94901801 0.95695920 0.96414541 0.97061010
#> [43] 0.97639486 0.98155430 0.98612068 0.99010711 0.99352152 0.99636315
#> [49] 0.99861858 1.00027131 1.00128840 1.00164118 1.00127653 1.00014885
#> [55] 0.99819412 0.99535131 0.99157345 0.98680715 0.98099846 0.97408932
#> [61] 0.96605389 0.95688184 0.94658020 0.93517079 0.92269298 0.90920950
#> [67] 0.89478241 0.87951398 0.86349902 0.84685117 0.82968111 0.81209955
#> [73] 0.79420901 0.77610273 0.75787281 0.73960201 0.72135711 0.70315151
#> [79] 0.68502696 0.66698975 0.64904836 0.63121991 0.61350006 0.59586359
#> [85] 0.57828602 0.56074973 0.54322480 0.52567952 0.50810778 0.49048710
#> [91] 0.47280888 0.45503981 0.43722134 0.41936567 0.40155105 0.38385140
#> [97] 0.36628591 0.34892827 0.33194043 0.31550449
# }