View source: R/kde1d-methods.R
dkde1d | R Documentation |
Density, distribution function, quantile function and random generation for a 'kde1d' kernel density estimate.
dkde1d(x, obj)
pkde1d(q, obj)
qkde1d(p, obj)
rkde1d(n, obj, quasi = FALSE)
x |
vector of density evaluation points. |
obj |
a |
q |
vector of quantiles. |
p |
vector of probabilities. |
n |
integer; number of observations. |
quasi |
logical; the default ( |
dkde1d()
gives the density, pkde1d()
gives
the distribution function, qkde1d()
gives the quantile function,
and rkde1d()
generates random deviates.
The length of the result is determined by n
for rkde1d()
, and
is the length of the numerical argument for the other functions.
The density, distribution function or quantile functions estimates
evaluated respectively at x
, q
, or p
, or a sample of n
random
deviates from the estimated kernel density.
kde1d()
set.seed(0) # for reproducibility
x <- rnorm(100) # simulate some data
fit <- kde1d(x) # estimate density
dkde1d(0, fit) # evaluate density estimate (close to dnorm(0))
pkde1d(0, fit) # evaluate corresponding cdf (close to pnorm(0))
qkde1d(0.5, fit) # quantile function (close to qnorm(0))
hist(rkde1d(100, fit)) # simulate
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.