Abstract class that cannot be constructed directly.

Value

Returns error. Abstract classes cannot be constructed directly.

Details

Wrappers in distr6 use the composite pattern (Gamma et al. 1994), so that a wrapped distribution has the same methods and fields as an unwrapped one. After wrapping, the parameters of a distribution are prefixed with the distribution name to ensure uniqueness of parameter IDs.

Use listWrappers function to see constructable wrappers.

References

Gamma, Erich, Richard Helm, Ralph Johnson, and John Vlissides. 1994. “Design Patterns: Elements of Reusable Object-Oriented Software.” Addison-Wesley.

Super class

distr6::Distribution -> DistributionWrapper

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage

DistributionWrapper$new(
  distlist = NULL,
  name,
  short_name,
  description,
  support,
  type,
  valueSupport,
  variateForm,
  parameters = NULL,
  outerID = NULL
)

Arguments

distlist

(list())
List of Distributions.

name

(character(1))
Wrapped distribution name.

short_name

(character(1))
Wrapped distribution ID.

description

(character())
Wrapped distribution description.

support

([set6::Set])
Wrapped distribution support.

type

([set6::Set])
Wrapped distribution type.

valueSupport

(character(1))
Wrapped distribution value support.

variateForm

(character(1))
Wrapped distribution variate form.

parameters

([param6::ParameterSet])
Optional parameters to add to the internal collection, ignored if distlist is given.

outerID

([param6::ParameterSet])
Parameters added by the wrapper.


Method wrappedModels()

Returns model(s) wrapped by this wrapper.

Usage

DistributionWrapper$wrappedModels(model = NULL)

Arguments

model

(character(1))
id of wrapped Distributions to return. If NULL (default), a list of all wrapped Distributions is returned; if only one Distribution is matched then this is returned, otherwise a list of Distributions.


Method clone()

The objects of this class are cloneable with this method.

Usage

DistributionWrapper$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.