BaseDistribution: Base distribution class

BaseDistributionR Documentation

Base distribution class

Description

This class defines the base distribution class from which all other distributions inherit. It provides a common interface for fitting the distribution to data and generating random samples.

Methods

Public methods


BaseDistribution$fit()

Fit the distribution to the data.

Usage
BaseDistribution$fit(x)
Arguments
x

A numeric vector of data to fit the distribution to.

Returns

Internally sets the parameters of the distribution. Returns nothing.


BaseDistribution$random()

Generate random samples from the distribution.

Usage
BaseDistribution$random(n)
Arguments
n

An integer specifying the number of samples to generate.

Returns

A numeric vector of size n containing the random samples.


BaseDistribution$get_mean()

Compute the mean of the distribution.

Usage
BaseDistribution$get_mean()
Returns

A numeric value storing the mean of the distribution.


BaseDistribution$get_variance()

Compute the variance of the distribution.

Usage
BaseDistribution$get_variance()
Returns

A numeric value storing the variance of the distribution.


BaseDistribution$clone()

The objects of this class are cloneable with this method.

Usage
BaseDistribution$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


midi documentation built on July 6, 2026, 1:08 a.m.