Learn R Programming

mistr (version 0.0.6)

Distribution_transformation: Transformation of a Distribution Object

Description

The methods for arithmetic operators +, -, *, /, ^, log, exp, sqrt, which perform a transformation of a given random variable.

Usage

# S3 method for univdist
+(e1, e2 = NULL)

# S3 method for trans_univdist +(e1, e2 = NULL)

# S3 method for univdist *(e1, e2)

# S3 method for trans_univdist *(e1, e2)

# S3 method for dist /(e1, e2)

# S3 method for dist -(e1, e2 = NULL)

# S3 method for dist sqrt(x)

# S3 method for univdist log(x, base = exp(1))

# S3 method for trans_univdist log(x, base = exp(1))

# S3 method for univdist exp(x)

# S3 method for trans_univdist exp(x)

# S3 method for univdist ^(e1, e2)

# S3 method for trans_univdist ^(e1, e2)

# S3 method for normdist +(e1, e2)

# S3 method for normdist *(e1, e2)

# S3 method for normdist exp(x)

# S3 method for expdist *(e1, e2)

# S3 method for expdist ^(e1, e2)

# S3 method for unifdist +(e1, e2)

# S3 method for unifdist *(e1, e2)

# S3 method for tdist ^(e1, e2)

# S3 method for fdist ^(e1, e2)

# S3 method for betadist -(e1, e2 = NULL)

# S3 method for binomdist -(e1, e2 = NULL)

# S3 method for gammadist *(e1, e2)

# S3 method for cauchydist +(e1, e2)

# S3 method for cauchydist *(e1, e2)

# S3 method for cauchydist ^(e1, e2)

# S3 method for lnormdist *(e1, e2)

# S3 method for lnormdist log(x, base = exp(1))

# S3 method for lnormdist ^(e1, e2)

# S3 method for weibulldist *(e1, e2)

# S3 method for gumbeldist +(e1, e2)

# S3 method for gumbeldist *(e1, e2)

# S3 method for frechetdist +(e1, e2)

# S3 method for frechetdist *(e1, e2)

# S3 method for paretodist *(e1, e2)

# S3 method for GPDdist +(e1, e2)

# S3 method for GPDdist *(e1, e2)

Value

Object representing a transformed random variable.

Arguments

e1

distribution object or numeric of length one.

e2

distribution object or numeric of length one.

x

distribution object.

base

a positive number: the base with respect to which logarithms are computed.

Details

The offered arithmetic operators +, -, *, /, ^, log, exp, sqrt create an object that represents transformed random variable.

The functions, using the expressions manipulation, prepare expressions for transformation, inverse transformation, derivative of the inverse transformation and print. These expressions are then used later when the distribution is evaluated.

The transformation framework also keeps track on history of the transformations and so is able to recognize some inverse transformations of previous transformations or update the last transformation. Additionally, the methods are able to recognize some invariant and direct transformations, and so rather change the parameters or distribution family than to loose this information.

Examples

Run this code
# transformation
B  <- binomdist(10, 0.3)
B2 <- - 3*log(B)
B2

# invariant transformation
N  <- normdist(1, 3)
N2 <- - 3*N + 5
N2

# direct transformation
N3 <- exp(N2)
N3

# recognize inverse
B3 <- exp(B2/-3)
B3
# update
B4 <- B + 5
B4 + 3

Run the code above in your browser using DataLab