Retrieve or set the names of random variables in the case of a probability distribution.

The model is represented by its generating sequence of discrete probability distribution. Each distribution is defined over a set of variables. This function returns the set of all variables in the model

variables(x)
variables(x) <- value
getVariables(x)
setVariables(x, value)

# S3 method for Distribution
variables(x)

# S3 method for Distribution
variables(x) <- value

# S3 method for Model
variables(x)

Arguments

x

distribution

x

compositional model

Value

character

Details

A discrete distribution describes the probability of occurrence of each value of a discrete random variable. Multidimensional discrete distribution describe probability of occurrence of a combination of values of discrete random variables. For our use, the random variables are named. Using functions variables and variables<- you can read and set the distribution data matrix.

Methods (by class)

  • Distribution: Retrieve vector of random variables

  • Distribution: Set vector of random variables

  • Model: Retrieve vector of random variables

See also

Examples

# Distribution class data(Pi) variables(Pi)
#> [1] "A" "B"
variables(Pi) <- c("C", "D") dTable(Pi)
#> C D MUDIM.frequency #> 1: 0 0 0.1 #> 2: 0 1 0.2 #> 3: 1 0 0.3 #> 4: 1 1 0.4
# Model class data(m) variables(m)
#> [1] "D" "N" "R" "T" "W" "U" "B"