B2DistHyper: A distribution of distributions based a distribution family...

View source: R/simulations.R

B2DistHyperR Documentation

A distribution of distributions based a distribution family with random hyperparameters.

Description

A distribution of distributions based a distribution family with random hyperparameters.

Usage

B2DistHyper(
  density,
  basis,
  paramSimulator,
  ...,
  simulator = NULL,
  .hyperparameters = list(...)
)

Arguments

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.

...

parameters to be given to parametersimulator

simulator

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

This function creates a distribution, which can be used to simulate distributional objects according to the random hyperparameters.

.hyperparameters

the list of parametrs to be given to the the parameterSimulator

Value

A B2DistHyper object encoding the distribution.

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.