jointmotbf.learning {MoTBFs} | R Documentation |
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 |
ranges |
A |
dimensions |
A |
object |
A list with the output of the function |
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
## 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)
###############################################################################
## MORE EXAMPLES ##############################################################
###############################################################################
## 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)