Learn R Programming

MoTBFs (version 1.2)

rescaledFunctions: Rescales an MoTBF Function

Description

A collation of function to reescale an MoTBF function to the original limits and scale.

Usage

rescaledMoTBFs(fx, data)

rescaledMOP(fx, data)

ToStringRe_MOP(parameters, data)

rescaledMTE(fx, data)

ToStringRe_MTE(parameters, data, num = 5)

meanMOP(fx)

Arguments

fx

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

data

A "numeric" vector containing the original data without being 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.

Value

An "motbf" function of the original data.

See Also

univMoTBF

Examples

Run this code
# NOT RUN {
## 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)
meanMOP(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)

# }

Run the code above in your browser using DataLab