simulate.B2DistHyper: Simulates a B2DistHyper distribution

View source: R/simulations.R

simulate.B2DistHyperR Documentation

Simulates a B2DistHyper distribution

Description

Simulates a B2DistHyper distribution

Usage

## S3 method for class 'B2DistHyper'
simulate(
  object,
  nsim = 1,
  seed = NULL,
  density = object$density,
  basis = object$basis,
  paramSimulator = object$paramSimulator,
  simulator = object$simulator,
  hyperparameters = object$hyperparameters,
  ...
)

Arguments

object

an B2DistHyper object as returned from B2DistHyper

nsim

the number of simulations

seed

a seed eventually to be set before the simulation (use with care!)

density

A function that can be called with a vectorized x of data values of the BayesSpace and parameters, to calculate a density.

basis

A BayesSpaceBasis (or an object that can be converted to one) of BayesSpace containing the values of the distribution (of distributions).

paramSimulator

A function to be called without arguments to simulate one set of parameters.

simulator

A function that can be called with an integer n and the parameters to create n random simulations.

hyperparameters

the list of parametrs to be given to the the parameterSimulator

...

futher unused parameters, required to fullfill the generic definition of simulate

Value

A [BDataDensities] following the given distribution.

See Also

[stats::simulate]

Examples

D = B2DistHyper(dbeta,B2Unif01Basis5,function() rexp(2),simulator=rbeta)
simulate(D,4,seed=47)


DistributionalDDA documentation built on Oct. 20, 2026, 5:06 p.m.