delta: Matrix difference operator

View source: R/utils.R

deltaR Documentation

Matrix difference operator

Description

This function creates the difference operator matrix delta for subtracting a matrix row from the other matrix rows.

Usage

delta(J, i)

Arguments

J

The number of matrix rows.

i

The row number to which respect differences are computed.

Details

Given a matrix x with J rows, then delta(i,J) %*% x computes differences with respect to row i.

Value

A matrix with J-1 rows.

Examples

J <- 2
x <- matrix(1, nrow = J, ncol = 2)
RprobitB:::delta(J, 1) %*% x


RprobitB documentation built on Nov. 10, 2022, 5:12 p.m.