Learn R Programming

shallot (version 0.4.1)

mass: Mass, Discount, and Temperature Parameters

Description

These functions set the mass, discount, and temperature parameters and, in the case of them being random, specify the parameters of their distribution.

Usage

mass(..., fixed = TRUE)
discount(..., fixed = TRUE)
temperature(..., fixed = TRUE)
# S3 method for shallot.mass
print(x, ...)
# S3 method for shallot.discount
print(x, ...)
# S3 method for shallot.temperature
print(x, ...)

Arguments

...

A number greater than 0.0 representing the value of the mass, discount, or temperaure parameters. Or, in the case of them being random, a vector of two numbers representing either: i. the shape and rate parameters of the gamma distribution for the mass or temperature, or ii. the shape parameters of the beta distribution for the discount. This argument is currently ignored for the associated print functions.

x

An object from the mass, discount, or temperature functions.

fixed

If TRUE, the parameter is fixed. If FALSE, the parameter value is samples from either: i. a gamma distribution for the mass or temperature, or ii. a beta distribution for the discount.

Value

An object of class shallot.mass, shallot.discount, or shallot.temperature.

Details

If no parameters are specified, the mass parameter defaults to 1.2, the discount parameter defaults to 0.05, the temperature parameter defaults to 3.0. If the mass parameter is random, the default shape and rate parameters of the gamma distribution are 2.5 and 2, respectively. If the discount parameter is random, the default shape parameters of the beta distribution are 1.0 and 1.0. If the temperature parameter is random, the default shape and rate parameters of the gamma distribution are 2 and 0.5, respectively.

Examples

Run this code
# NOT RUN {
mass()
mass(1.0)
mass(1.4, fixed=FALSE)
mass(0.5, 1, fixed=FALSE)
discount()
discount(0.2)
discount(1, 3, fixed=FALSE)
temperature()
temperature(2)
temperature(2, 4, fixed=FALSE)
# }

Run the code above in your browser using DataLab