Spline {pkmon} | R Documentation |
Random generation and distribution function of k-monotone densities
Description
Random generation and distribution function for the spline of the basis from Lefevre and Loisel (2013), and mixtures of splines.
Usage
rSpline(n=1, supp, k)
dSpline(supp, k)
rmixSpline(n=1, supp, k,prob)
dmixSpline(supp, k, prob)
Arguments
supp |
Support of the spline, or vector of the supports of the splines for the mixture of splines |
n |
Number of random values to return |
k |
Degree of monotony |
prob |
Vector of probabilities for the mixture of splines |
Details
See BaseNorm for details on the spline basis.
Value
rSpline and rmixSpline generates random deviates from the splines and mixtures of splines.
dSpline and dmixSpline gives the distribution function.
Author(s)
Jade Giguelay
References
Giguelay, J., (2016), Estimation of a discrete distribution under k-monotony constraint, in revision, (arXiv:1608.06541)
Lefevre C., Loisel S. (2013) <DOI:10.1239/jap/1378401239> On multiply monotone distributions, continuous or discrete, with applications, Journal of Applied Probability, 50, 827–847.
See Also
Examples
x=rSpline(n=100, 20, 3)
p=dSpline(20, 3)
xmix=rmixSpline(n=100, c(5, 20), 3, c(0.5, 0.5))
pmix=dmixSpline(c(5, 20), 3, c(0.5, 0.5))
par(mfrow=c(1, 2))
hist(x, freq=FALSE)
lines(p, col="red")
hist(xmix, freq=FALSE)
lines(pmix, col="red")