Description Usage Arguments Value Author(s) Examples
First order forward difference of a matrix. This function was originally developed for the empirical copula distribution in matrix form.
1 | forwardDifference(mat, i = 1)
|
mat |
An |
i |
First(X) or second variable(Y)? by row (i=1) or by columns (i=2)? |
if i=1
, an (m - 1) x n
matrix
if i=2
, an m x (n - 1)
matrix.
Francisco Mendoza-Torres (mentofran@gmail.com)
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.