lpdensity
lpdensity_fn
implements the local polynomial density estimator. This
function is for internal use, and there is no error handling or robustness check.
lpdensity_fn(
data,
grid,
bw,
p,
q,
v,
kernel,
Cweights,
Pweights,
massPoints,
showSE = TRUE
)
grid points.
bandwidth for each grid point.
Effective sample size for each grid point.
Density estimates on the grid with local polynomial of order p
,
with the same length as grid
.
Density estimates on the grid with local polynomial of order q
,
with the same length as grid
. This is reported only if q
is greater than
0.
Standard errors corresponding to hat_p
.
Standard errors corresponding to hat_q
. This is reported only
if q
is greater than 0.
Numeric vector or one dimensional matrix/data frame, the raw data.
Numeric vector or one dimensional matrix/data frame, the grid on which density is estimated.
Numeric vector or one dimensional matrix/data frame, the bandwidth
used for estimation. Should be strictly positive, and have the same length as
grid
.
Integer, nonnegative, the order of the local-polynomial used to construct point estimates.
Integer, nonnegative, the order of the local-polynomial used to construct confidence interval (a.k.a. the bias correction order).
Integer, nonnegative, the derivative of distribution function to be estimated. 0
for
the distribution function, 1
(default) for the density funtion, etc.
String, the kernel function, should be one of "triangular"
,
"uniform"
or "epanechnikov"
.
Numeric vector or one dimensional matrix/data frame, the weights used for counterfactual distribution construction. Should have the same length as sample size.
Numeric vector or one dimensional matrix/data frame, the weights used in sampling. Should have the same length as sample size, and nonnegative.
Boolean, whether whether point estimates and standard errors should be corrected if there are mass points in the data.
TRUE
(default) or FALSE
, whether standard errors should be computed.
Recommend: use lpdensity
.