Description Usage Arguments Value Examples
Asymptotic confidence intervals for the local polynomial estimator
1 2 3 4 5 6 7 8 9 | confidence_intervals_LP(
x,
X,
Y,
kernel = epanechnikov,
bw,
degree = 1L,
alpha = 0.05
)
|
x |
Evaluation points (vector). |
X |
Data for the regressor (vector). |
Y |
Data for the regressand (vector). |
kernel |
Kernel (function). Default is |
bw |
Bandwidth (scalar). |
degree |
Degree of the locally fitted polynomial (integer). Default is |
alpha |
Significance level (scalar). Default is |
List containing:
confidence_intervals_lower |
Lower points for the (1 - alpha) asymptotic confidence intervals (vector). |
confidence_intervals_upper |
Upper points for the (1 - alpha) asymptotic confidence intervals (vector). |
1 2 3 4 5 6 7 8 9 10 11 12 13 | m_fun <- function(x) {sin(2*pi*x)} # True regression function
n <- 100 # Sample size
X <- seq(0, 1, length.out = n) # Data for the regressor
m_X <- m_fun(X) # True values of regression function
epsilon <- rnorm(n, sd = 0.25) # Error term
Y <- m_X + epsilon # Data for the regressand
bw <- 0.2 # Bandwidth
x <- seq(0, 1, length.out = n/2) # Evaluation points
output_confidence_intervals_LP <- confidence_intervals_LP(x = x, X = X, Y = Y, bw = bw,
alpha = 0.05)
confidence_intervals_lower <- output_confidence_intervals_LP$confidence_intervals_lower
confidence_intervals_upper <- output_confidence_intervals_LP$confidence_intervals_upper
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.