View source: R/PackageOxygen.R
pparetoCP | R Documentation |
Distribution function, quantile function and random generation for the Pareto change point distribution with a0
equal to the shape of the first pareto distribution, a1
equal to the shape of the second pareto distribution, x0
equal to the scale and x1
equal to the change point.
pparetoCP(x, a0 = 1, a1 = 2, x0 = 1, x1 = 6)
qparetoCP(p, a0 = 1, a1 = 2, x0 = 1, x1 = 6)
rparetoCP(n, a0 = 1, a1 = 2, x0 = 1, x1 = 6)
x |
a vector of quantiles. |
a0 |
a vector of shape parameter of the Pareto distribution before |
a1 |
a vector of shape parameter of the Pareto distribution after |
x0 |
a vector of scale parameter of the function. |
x1 |
a vector of change point value. |
p |
a vector of probabilities. |
n |
a number of observations. If length(n) > 1, the length is taken to be the number required. |
If not specified, a0, a1, x0
and x1
are taking respectively the values 1, 2, 1
and 6
The cumulative Pareto change point distribution is given by :
F(x) = (x <= x1)* (1 - x^{-a0}) + (x > x1) * ( 1 - x^{-a1} * x1^{-a0 + a1})
pparetoCP gives the distribution function, qparetoCP gives the quantile function, and rparetoCP generates random deviates.
The length of the result is determined by n for rparetoCP, and is the maximum of the lengths of the numerical arguments for the other functions.
The numerical arguments other than n are recycled to the length of the result. Only the first elements of the logical arguments are used.
par(mfrow = c(2,1))
plot(function(x) pparetoCP(x), 0, 5,ylab="distribution function",
main = " Pareto change point Cumulative ")
mtext("pparetoCP(x)", adj = 0)
plot(function(x) qparetoCP(x), 0, 1,ylab="quantiles",
main = " Pareto change point Quantile")
mtext("qparetoCP(x)", adj = 0)
#generate a sample of pareto distribution of size n
n <- 100
x <- rparetoCP(n)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.