generate.random.marginal.samples: Generate marginal random samples for each variable in a...

generate.random.marginal.samplesR Documentation

Generate marginal random samples for each variable in a distribution

Description

Generates random samples for each variable in the distribution, but does NOT preserve the correlations across variables within samples. For some distribution implementations, this can be substantially faster than generating true, multivariate random samples, so this method is preferred if random samples are only needed for one variable at a time

Usage

generate.random.marginal.samples(dist, n)

Arguments

dist

An object of class Distribution or a subclass

n

The number of random samples to be generated

Details

Note to developers: this function should not be overridden. Override do.generate.random.marginal.samples instead

Value

If n==1, a numeric vector with one value for each variable in the distribution. If there is only one variable in the distribution, a numeric vector with n values. If n>1 and there is more than one variable in the distribution, a matrix with n rows, where each row represents one random sample, and each column represents a variable in the distribution


tfojo1/distributions documentation built on July 27, 2024, 3:29 p.m.