| rvar-dist | R Documentation |
The probability density function (density()), cumulative distribution
function (cdf()), and quantile function / inverse CDF (quantile()) of
an rvar.
## S3 method for class 'rvar'
density(x, at, ...)
## S3 method for class 'rvar_factor'
density(x, at, ...)
## S3 method for class 'rvar'
cdf(x, q, ...)
## S3 method for class 'rvar_factor'
cdf(x, q, ...)
## S3 method for class 'rvar_ordered'
cdf(x, q, ...)
## S3 method for class 'rvar'
quantile(x, probs, ...)
## S3 method for class 'rvar_factor'
quantile(x, probs, ...)
## S3 method for class 'rvar_ordered'
quantile(x, probs, ...)
x |
(rvar) An |
... |
Additional arguments passed onto underlying methods:
|
q, at |
(numeric vector) One or more quantiles. |
probs |
(numeric vector) One or more probabilities in |
If x is a scalar rvar, returns a vector of the same length as the input
(q, at, or probs) containing values from the corresponding function
of the given rvar.
If x has length greater than 1, returns an array with dimensions
c(length(y), dim(x)) where y is q, at, or probs, where each
result[i,...] is the value of the corresponding function,f(y[i]), for
the corresponding cell in the input array, x[...].
set.seed(1234)
x = rvar(rnorm(100))
density(x, seq(-2, 2, length.out = 10))
cdf(x, seq(-2, 2, length.out = 10))
quantile(x, ppoints(10))
x2 = c(rvar(rnorm(100, mean = -0.5)), rvar(rnorm(100, mean = 0.5)))
density(x2, seq(-2, 2, length.out = 10))
cdf(x2, seq(-2, 2, length.out = 10))
quantile(x2, ppoints(10))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.