Learn R Programming

MoTBFs (version 1.4.2)

integralJointMoTBF: Integration with MoTBFs

Description

Integrate a "jointmotbf" object over an non defined domain. It is able to get the integral of a joint function over a set of variables or over all the variables in the function.

Usage

integralJointMoTBF(P, var = NULL)

Value

A multiintegral of a joint function of class "jointmotbf".

Arguments

P

A "jointmotbf" object.

var

A "character" vector containing the name of the variables that will be integrated out. Instead of the names, the position of the variables can be given. By default it's NULL then all the variables are integrated out.

Examples

Run this code
## 1. EXAMPLE
## Dataset with 2 variables
X <- data.frame(rnorm(100), rnorm(100))

## Joint function
dim <- c(2,3)
param <- parametersJointMoTBF(X, dimensions = dim)
P <- jointMoTBF(param)

## Integral
integralJointMoTBF(P)
integralJointMoTBF(P, var="x")
integralJointMoTBF(P, var="y")

##############################################################################
## MORE EXAMPLES #############################################################
##############################################################################
# \donttest{
## Dataset with 3 variables
X <- data.frame(rnorm(50), rnorm(50), rnorm(50))

## Joint function
dim <- c(2,1,3)
param <- parametersJointMoTBF(X, dimensions = dim)
P <- jointMoTBF(param)
 
## Integral
integralJointMoTBF(P)
integralJointMoTBF(P, var="x")
integralJointMoTBF(P, var="y")
integralJointMoTBF(P, var="z")
integralJointMoTBF(P, var=c("x","z"))
# }

Run the code above in your browser using DataLab