mvdistribution: Constructors for distribution and mvdistribution class...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

These functions create objects of class distribution and mvdistribution

Usage

1
2

Arguments

RName

A string holding the R suffix corresponding to the distribution, e.g. "pois" for the Poisson distribution

...

Additional parameters that parametrize the distribution

Details

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 ....

Value

An object of class distribution or mvdistribution.

Author(s)

Francisco Gochez <fgochez@mango-solutions.com>

See Also

sampleFrom

Examples

 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)

BLCOP documentation built on Jan. 26, 2021, 1:05 a.m.