Learn R Programming

rwc (version 1.12)

get.Phi: Compute the precision matrix Phi of observed nodes on a graph.

Description

Given a Gaussian Markov random field defined by a precision matrix Q, this returns Phi, which is the precision matrix of the nodes indexed by 'obs.idx', computed using the Schur complement.

Usage

get.Phi(Q, obs.idx)

Value

A square matrix of dimension equal to the length of 'obs.idx'.

Arguments

Q

A precision matrix

obs.idx

A vector of unique indices of observed nodes in the graph defined by Q.

Author

Ephraim M. Hanks

References

Hanks and Hooten 2013. Circuit theory and model-based inference for landscape connectivity. Journal of the American Statistical Association. 108(501), 22-33.

Examples

Run this code
int=raster(nrow=30,ncol=30)
values(int)=1
TL.int=get.TL(int)
Q.int=get.Q(TL.int,1)
## get precision matrix of only the first 5 nodes
get.Phi(Q.int,1:5)

Run the code above in your browser using DataLab