forwardDifference: First order forward difference of a matrix

Description Usage Arguments Value Author(s) Examples

Description

First order forward difference of a matrix. This function was originally developed for the empirical copula distribution in matrix form.

Usage

1
forwardDifference(mat, i = 1)

Arguments

mat

An m x n matrix. Maybe a result from the function empiricalCDF2Dcounts.

i

First(X) or second variable(Y)? by row (i=1) or by columns (i=2)?

Value

if i=1, an (m - 1) x n matrix if i=2, an m x (n - 1) matrix.

Author(s)

Francisco Mendoza-Torres (mentofran@gmail.com)

Examples

1
2
3
4
5
6
7
set.seed(123)
xe <- matrix(rpois(12, 3), nrow = 4, ncol = 3)
print(xe)
efdx  <- forwardDifference(xe,   i = 1); print(efdx)
efdy  <- forwardDifference(xe,   i = 2); print(efdy)
efdxy <- forwardDifference(efdx, i = 2); print(efdxy) # mixed forward difference
forwardDifference(xe^2)/forwardDifference(xe) # finite differences of the function y=x^2

mathphysmx/empiricalDistribution documentation built on May 7, 2019, 10:55 p.m.