Description Usage Arguments Value Examples
This function compute the Cumulative Density Function (cdf) value of any univariate distribution in point t, i.e. P(T ≤q t).
Unlike the common cdf's of other distributions (such as pnorm
, ppois
and etc.) the name of the introduced cdf
function is fix in which the name of distribution is considered as an argument.
So the cdf
function is applicable for any kind of distribution with a unique form but by considering the name of distribution as a parameter (argument) of cdf
function.
1 |
T.dist |
The distribution name of the random variable is determined by characteristic element |
T.dist.par |
A vector of distribution parameters with considered ordering in |
t |
A real number or a vector of real numbers. |
This function gives the value of cumulative density function (cdf) at point t
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # Example:
cdf(T.dist="norm", T.dist.par=c(0,1), 0)
cdf(T.dist="t", T.dist.par=c(7), -2)
cdf(T.dist="pois", T.dist.par=5, 0) # Equal to dpois(0,5)
cdf(T.dist="pois", T.dist.par=5, 5)
## The function is currently defined as
function (T.dist, T.dist.par, t)
{
pDis = paste("p", T.dist, sep = "", collapse = "")
if (length(T.dist.par) == 1) {
cdf.t = do.call(pDis, list(t, T.dist.par[1]))
}
else {
if (length(T.dist.par) == 2) {
cdf.t = do.call(pDis, list(t, T.dist.par[1], T.dist.par[2]))
}
else {
cdf.t = do.call(pDis, list(t, T.dist.par[1], T.dist.par[2],
T.dist.par[3]))
}
}
return(cdf.t)
}
|
Attaching package: ‘DISTRIB’
The following object is masked from ‘package:grDevices’:
pdf
The following object is masked from ‘package:base’:
q
[1] 0.5
[1] 0.04280966
[1] 0.006737947
[1] 0.6159607
function (T.dist, T.dist.par, t)
{
pDis = paste("p", T.dist, sep = "", collapse = "")
if (length(T.dist.par) == 1) {
cdf.t = do.call(pDis, list(t, T.dist.par[1]))
}
else {
if (length(T.dist.par) == 2) {
cdf.t = do.call(pDis, list(t, T.dist.par[1], T.dist.par[2]))
}
else {
cdf.t = do.call(pDis, list(t, T.dist.par[1], T.dist.par[2],
T.dist.par[3]))
}
}
return(cdf.t)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.