Description Usage Arguments Details Value Author(s) See Also Examples
These functions create objects of class distribution
and mvdistribution
1 2 | mvdistribution(RName, ...)
distribution(RName, ...)
|
RName |
A string holding the R suffix corresponding to the distribution, e.g. "pois" for the Poisson distribution |
... |
Additional parameters that parametrize the distribution |
In general any distribution with a corresponding sampling function can be used. This function should
have the name given in RName
but preceded with an "r", e.g. rnorm
for the normal
distribution. When the constructors are called, they check that the given sampling function exists
and that it takes the arguments that were passed in the ...
.
An object of class distribution
or mvdistribution
.
Francisco Gochez <fgochez@mango-solutions.com>
1 2 3 4 5 6 7 8 9 10 | ## Not run:
# create a uniform distribution object and sample from it
myUnif <- distribution("unif", min = -0.1, max = 0.1)
hist(sampleFrom(myUnif, 1000))
mvNormal <- mvdistribution("mnorm", mean = c(1, 5), varcov = diag(c(2, 0.1)))
x <- sampleFrom(mvNormal, 1000)
plot(x[,1] ~ x[,2])
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.