statsmodels.distributions.copula.api.CopulaDistribution.rvs#
- CopulaDistribution.rvs(nobs=1, cop_args=None, marg_args=None, rng=None)[source]#
Draw random samples from the joint (copula) distribution.
- Parameters:
- nobs
int,optional Number of samples to generate in the parameter space. Default is 1.
- cop_args
tuple,optional Copula parameters. If None, then the copula parameters will be taken from the
cop_argsattribute created when initiializing the instance.- marg_args
listoftuples,optional Parameters for the marginal distributions. It can be None if none of the marginal distributions have parameters, otherwise it needs to be a list of tuples with the same length has the number of marginal distributions. The list can contain empty tuples for marginal distributions that do not take parameter arguments.
- rng
int, array_likeofint,numpy.random.Generator,ornumpy.random.RandomState,optional If rng is None, a new
Generatoris created using fresh entropy from the operating system. If rng is an int or array of ints, a newGeneratoris created, seeded with rng. If rng is already aGeneratororRandomStateinstance, that instance is used.- rng
int, array_likeofint,numpy.random.Generator,ornumpy.random.RandomState,optional Deprecated since version 0.15: random_state has been deprecated. In-line with SPEC-007, use rng for passing a random number generator or seed.
- nobs
- Returns:
- sample
ndarrayofshape(nobs,k_vars) Sample from the joint distribution, with marginals transformed to the distributions in
self.marginals.
- sample
Notes
The random samples are generated by creating a sample with uniform margins from the copula, and using
ppfto convert uniform margins to the one specified by the marginal distribution.