MoTBFs (version 1.4.1)

jointmotbf.learning: Joint MoTBF density learning

Description

Two functions for learning joint MoTBFs. The first one, parametersJointMoTBF(), gets the parameters by solving a quadratic optimization problem, minimizing the mean squared error between the empirical joint CDF and the estimated CDF. The density is obtained as the derivative od the estimated CDF. The second one, jointMoTBF(), fixes the equation of the joint function using the previously learned parameters and converting this "character" string into an object of class "jointmotbf".

Usage

parametersJointMoTBF(X, ranges = NULL, dimensions = NULL)

jointMoTBF(object)

Arguments

X

A dataset of class "data.frame".

ranges

A "numeric" matrix containing the range of the varibles used to fit the function, where each column corresponds to a variable. If not specified, the range of each variable is computed from the data.

dimensions

A "numeric" vector containing the number of parameters of each varible.

object

A list with the output of the function parametersJointMoTBF().

Value

parametersJointMoTBF() returns a list with the following elements: Parameters, which contains the computed coefficients of the resulting function; Dimension, which is a "numeric" vector containing the number of coefficients used for each variable; Range contains a "numeric" matrix with the domain of each variable, by columns; Iterations contains the number of iterations needed to solve the problem; Time contains the execution time.

jointMoTBF() returns an object of class "jointmotbf", which is a list whose only visible element is the analytical expression of the learned density. It also contains the other aforementioned elements, which can be retrieved using attributes()

Examples

Run this code
# NOT RUN {
## 1. EXAMPLE 
## Generate a multinormal dataset
data <- data.frame(X1 = rnorm(100), X2 = rnorm(100))

## Joint learnings
dim <- c(2,3)
param <- parametersJointMoTBF(X = data, dimensions = dim)

param$Parameters
length(param$Parameters)
param$Dimension
param$Range

P <- jointMoTBF(param)
P
attributes(P)
class(P)

###############################################################################
## MORE EXAMPLES ##############################################################
###############################################################################
# }
# NOT RUN {
## Generate a dataset
data <- data.frame(X1 = rnorm(100), X2 = rnorm(100), X3 = rnorm(100))

## Joint learnings
dim <- c(3,2,3)
param <- parametersJointMoTBF(X = data, dimensions = dim)

param$Parameters
length(param$Parameters) ## prod(dim)
param$Dimension
param$Range
param$Time

P <- jointMoTBF(param)
P
attributes(P)
class(P)
# }

Run the code above in your browser using DataLab