| cdf2density | R Documentation |
The function tries to keep the (open) support, by using a one sided derivative at limits of the support, while using a two sided in the middle of the support.
cdf2density(cdf, ..., .args = list(...), eps = 1e-07, cdf2 = NULL)
cdf |
the cummulative distribution function to be derived |
... |
futher named parameters for cdf |
.args |
the further named parameters given as a list |
eps |
the distance to be used in the numerical derivative |
cdf2 |
a function representing the cdf of the reference measure. NULL uses a simplification for Lebesque reference. |
a vectorized function giving the density obtained by numerically differentiating 'cdf' (a one-sided difference at the boundaries of the support, a two-sided difference in the interior). If 'cdf2' is supplied the result is the density relative to that reference measure instead of the Lebesgue density.
dUnif = cdf2density(punif,min=-0.2,0.4)
x=seq(-1,2,by=0.01)
plot(x,dUnif(x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.