RSWP: Reverse Sweep Function

Description Usage Arguments Details Value References Examples

View source: R/swp.R

Description

RSWP performs the reverse sweep operator.

Usage

1
RSWP(V, b)

Arguments

V

A symmetric matrix to be reverse swept; this matrix cannot contain missing data or infinite values.

b

An array of integers or column names to reverse sweep.

Details

This program applies the reverse sweep operator as defined in (Dempster 1969).

Value

The reverse swept matrix V. Reverse sweeping will not occur if the column being swept has a zero-valued diagonal element.

References

Dempster, A.P. (1969). Elements of continuous multivariate analysis. Reading, MA: Addison-Wesley.

Examples

1
2
3
4
5
6
set.seed(100)
# generate symmetric positive definite matrix
Sigma <- rWishart(1,4,diag(3))[,,1]
# sweep all the columns to produce the inverse
# and then reverse sweep them all back to Sigma
Sigma2 <- RSWP(SWP(Sigma,1:3),1:3)

jlisic/isr3 documentation built on May 17, 2017, 11:23 p.m.