Creates an empty discrete probability distribution, i.e. a probability distribution defined over an empty set of variables. Dimension of the empty distribution is 0. The constructor is based on Object function from R.oo package.

Distribution(name, info = "")

Arguments

name

Name of the new Distribution (for your information about the distribution only). One word is fine enough.

info

Information about the new Distribution (for your information about the distribution only)

Value

Reference to an empty distribution

Details

Distribution class is an object with 5 private variables: name, info, variables, dim, data

Slots

name

Name of the distribution

info

Information about Distribution

variables

Vector of discrete variables used in the distribution (like: "A" "B" "C", default:NULL)

dim

Dimension of the distribution, ie. number of variables \(n\)

data

Data.table of \(n+1\) columns where \(n\) is the number of random variables from variables. The last column represents a probability of a respective row - see the following table

ABCDMUDIM.frequency
00010.25
01010.05
10010.15
11010.35
10110.10
Each row represents a unique combination of random discrete variables - its probability is stored in the last column. Missing combinations are expected to have zero probability.

See also

Examples

d <- Distribution("new",info="demo distribution"); d; #as.character...
#> Probability distribution #> * Name:new #> * Info:demo distribution #> * Variables: #> * Non-empty items: #> NULL
dim(d); #dimension of empty distribution is 0
#> [1] 0