Learn R Programming

rdecision (version 1.1.2)

ConstModVar: A constant model variable

Description

An R6 class representing a constant in a model.

Arguments

Author

Andrew Sims andrew.sims@newcastle.ac.uk

Super class

rdecision::ModVar -> ConstModVar

Methods

Inherited methods


Method new()

Create a new constant model variable.

Usage

ConstModVar$new(description, units, const)

Arguments

description

A character string description of the variable and its role in the model. This description will be used in a tabulation of the variables linked to a model.

units

A character string description of the units, e.g. "GBP", "per year".

const

The constant numerical value of the object.

Returns

A new ConstModVar object.


Method is_probabilistic()

Tests whether the model variable is probabilistic.

Usage

ConstModVar$is_probabilistic()

Details

Does the random variable follow a distribution, or is it an expression involving' random variables, some of which follow distributions?

Returns

TRUE if probabilistic


Method clone()

The objects of this class are cloneable with this method.

Usage

ConstModVar$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

A ModVar with no uncertainty in its value. Its distribution is treated as a Dirac delta function \(\delta(x-c)\) where \(c\) is the hyperparameter (value of the constant). The benefit over using a regular numeric variable in a model is that it will appear in tabulations of the model variables associated with a model and therefore be explicitly documented as a model input. Inherits from class ModVar.