| coercion-motbf | R Documentation |
Converts 'motbf' and 'jointmotbf' objects into character string expressions or executable R functions.
## 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, ...)
x |
An object of class |
... |
Further arguments passed to or from other methods. Not used currently. |
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.
## 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.