kdens {PPMiss} | R Documentation |
Kernel density estimator
Description
The probability density function is estimated using a kernel density
approach. More specifically, first
is estimated
using
(default for the function
density
)
equally spaced points ,
, in the interval
, where
is the bandwidth for
the Gaussian kernel density estimator, chosen by applying the Silverman's
rule of thumb (the default procedure in
density
).
A cubic spline interpolation (the default method for spline
)
is then applied to the pairs to obtain
for all
.
Usage
kdens(x)
Arguments
x |
the data from which the estimate is to be computed. |
Value
a function that approximates the probability density function.
Examples
# creating a time series
trunc = 50000
cks <- arfima.coefs(d = 0.25, trunc = trunc)
eps <- rnorm(trunc+1000)
x <- sapply(1:1000, function(t) sum(cks*rev(eps[t:(t+trunc)])))
# kernel density function
dfun <- kdens(x)
# plot
curve(dfun, from = min(x), to = max(x))
[Package PPMiss version 0.1.1 Index]