coercion-motbf: Coerce MOTBF Objects to Character or Function

coercion-motbfR Documentation

Coerce MOTBF Objects to Character or Function

Description

Converts 'motbf' and 'jointmotbf' objects into character string expressions or executable R functions.

Usage

## S3 method for class 'motbf'
as.character(x, ...)

## S3 method for class 'motbf'
as.function(x, ...)

## S3 method for class 'jointmotbf'
as.character(x, ...)

## S3 method for class 'jointmotbf'
as.function(x, ...)

Arguments

x

An object of class 'motbf' or 'jointmotbf'.

...

Further arguments passed to or from other methods. Not used currently.

Value

  • as.character: Returns a character string representing the mathematical expression of the object.

  • as.function: Returns an executable R function that accepts numeric arguments to evaluate the MoTBF expression.

Examples


## Example 1
X <- rchisq(5000, df = 3)
P <- univMoTBF(X, POTENTIAL_TYPE = "MOP"); P
as.function(P)(10)

## Example 2
data <- data.frame(X = rnorm(100), Y = rexp(100))
dim <- c(3,2)
P <- jointmotbf.fit(data, dimensions = dim)
density <- as.function(P)(data[,1], data[,2])
sum(log(density))


MoTBFs documentation built on Oct. 6, 2026, 1:06 a.m.