MoTBFs (version 1.2)

jointCDF: Cumulative Joint Distribution

Description

Functions to compute the multivariate cumulative distribution. It uses a grid data over the ranges of variables in the dataset to calculate the cumulative values.

Usage

jointCDF(data, grid)

posGrid(nrows, data, grid)

Arguments

data

The dataset as data.frame class.

grid

a data frame with the select rows to include in the grid

nrows

Number of rows.

Details

jointCDF() is the main function which uses the internal function posGrid().

Examples

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

## Grid dataset
gridX <- sapply(1:ncol(X), function(i) seq(min(X[,i]), max(X[,i]), length=10))
gridPoints <- expand.grid(gridX) ## expand gridX
ncol(gridPoints)
nrow(gridPoints)

## Joint cumulative values
jointCDF(data = X, grid = gridPoints)

## 2. EXAMPLE
## Dataset with 3 variables
X <- data.frame(rnorm(100), rexp(100), rchisq(100, df=2))

## Grid dataset
gridX <- sapply(1:ncol(X), function(i) seq(min(X[,i]), max(X[,i]), length=10))
gridPoints <- expand.grid(gridX) ## expand gridX
ncol(gridPoints)
nrow(gridPoints)

## Joint cumulative values
jointCDF(data = X, grid = gridPoints)

# }

Run the code above in your browser using DataLab