coef.motbf: Extract the coefficients of an MoTBF

View source: R/motbf.R

coef.motbfR Documentation

Extract the coefficients of an MoTBF

Description

Extracts the parameters of the learned mixtures of truncated basis functions.

Usage

## S3 method for class 'motbf'
coef(object, ...)

Arguments

object

An object of class motbf.

...

other arguments.

Value

A numeric vector with the parameters of the function.

See Also

univMoTBF, coeffMOP and coeffMTE

Examples


## Data
X <- rchisq(2000, df = 5)

## Learning
f1 <- univMoTBF(X, POTENTIAL_TYPE = "MOP"); f1
## Coefficients
coef(f1)

## Learning
f2 <- univMoTBF(X, POTENTIAL_TYPE = "MTE", maxParam = 10); f2
## Coefficients
coef(f2)

## Learning
f3 <- univMoTBF(X, POTENTIAL_TYPE = "MOP", nparam=10); f3
## Coefficients
coef(f3)

## Plots
plot(NULL, xlim = range(X), ylim = c(0,0.2), xlab="X", ylab="density")
plot(f1, xlim = range(X), col = 1, add = TRUE)
plot(f2, xlim = range(X), col = 2, add = TRUE)
plot(f3, xlim = range(X), col = 3, add = TRUE)
hist(X, prob = TRUE, add= TRUE)


MoTBFs documentation built on April 18, 2022, 5:06 p.m.

Related to coef.motbf in MoTBFs...