MoTBFs (version 1.2)

jointmotbf.learning: Learning Joint Functions

Description

Two functions for learning joint MoTBFs. The first one, parametersJointMoTBF(), gets the parameters by solving a quadratic optimization problem, minimizing the error of the empirical cumulative joint values versus the estimated ones. Finally it derives these parameters in order to obtain parameters of the joint density function. The second one, jointMoTBF(), fixes the equation of the joint function using the previously learned parameters and converting this "character" string in 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 by columns with the ranges of the varibles where fitting the function.

dimensions

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

object

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

Value

parametersJointMoTBF() returns a list with the 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 a number of iterations needed to solve the problem; Time contains the time that the functions spent to solve the problem.

jointMoTBF() retunrs an object of class "jointmotbf"; It is a list whose unique visible element is the mathematical expression, furthermore it contains the other elements of the output of the parametersJointMoTBF() function.

Examples

Run this code
# NOT RUN {
## 1. EXAMPLE 
## Load the mnormt package to generate a multinormal dataset
## Dataset
Mean <- 0; nVar <- 2; ro <- 0
varcov <- matrix(c(rep(c(1, rep(ro, nVar)), nVar-1),1), nrow=nVar)
means <- rep(Mean, nVar)
X <- rmnorm(100,means,varcov) 
data <- standardizeDataset(data.frame(X))

## 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)
# }
# NOT RUN {
###############################################################################
## MORE EXAMPLES ##############################################################
###############################################################################
# }
# NOT RUN {
## Load the mnormt package to generate a multinormal dataset
## Dataset
Mean <- 1; nVar <- 3; ro <- 0.5
varcov <- matrix(c(rep(c(1, rep(ro, nVar)), nVar-1),1), nrow=nVar)
means <- rep(Mean, nVar)
X <- rmnorm(200,means,varcov)
data <- standardizeDataset(data.frame(X))

## Joint learnings
dim <- c(3,2,4,2)
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 DataCamp Workspace