Learn R Programming

MoTBFs (version 2.0)

rescaledFunctions: Rescaling MoTBF functions

Description

A collection of function to reescale an MoTBF function to the original offset and scale. This is useful when data was standardized previously to learning.

Usage

rescaledMoTBFs(fx, data = NULL)

rescaledMOP(fx, data = NULL)

rescaledMTE(fx, data)

ToStringRe_MTE(parameters, data, num = 1)

meanMOP(fx)

rescale_motbf_fit(object, POTENTIAL_TYPE, data)

Value

An "motbf" function of the original data.

Arguments

fx

A function of class "motbf" learned from a scaled data.

data

the original data set (non-scaled)

parameters

A "numeric" vector with the coefficients to create the rescaled MoTBF.

num

A "numeric" value which contains the denominator of the coefficient in the exponential. By default it is 5.

object

and object of class motbf_fit that has been learned with scaled data

POTENTIAL_TYPE

the potential of the model (either "MOP" or "MTE")

See Also

univMoTBF

Examples

Run this code
## 1. EXAMPLE
X <- rchisq(1000, df = 8) ## data
modX <- scale(X) ## scale data

## Learning
f <- univMoTBF(modX, POTENTIAL_TYPE = "MOP", nparam=10) 
plot(f, xlim = range(modX), col=2)
hist(modX, prob = TRUE, add = TRUE)

## Rescale
origF <- rescaledMoTBFs(f, X) 
plot(origF, xlim = range(X), col=2)
hist(X, prob = TRUE, add = TRUE)
expectedValueMOP(origF) 
mean(X)

## 2. EXAMPLE 
X <- rweibull(1000, shape = 20, scale= 10) ## data
modX <- as.numeric(scale(X)) ## scale data

## Learning
f <- univMoTBF(modX, POTENTIAL_TYPE = "MTE", nparam = 9) 
plot(f, xlim = range(modX), col=2, main="")
hist(modX, prob = TRUE, add = TRUE)

## Rescale
origF <- rescaledMoTBFs(f, X) 
plot(origF, xlim = range(X), col=2)
hist(X, prob = TRUE, add = TRUE)
expectedValueMTE(origF)
mean(X)

Run the code above in your browser using DataLab