rGenWish {rwc} | R Documentation |
Simulate realizations from the Generalized Wishart distribution
Description
Simulates Wishart random variables, then computes the induced distance of the simulated Wishart random variables. The result is a random matrix distributed as a Generalized Wishart random variable.
Usage
rGenWish(Sigma, df)
Arguments
Sigma |
The covariance parameter of the Generalized Wishart. |
df |
An integer specifying the degrees of freedom. |
Value
A matrix of dimension equal to the dimension of Sigma.
Author(s)
Ephraim M. Hanks
References
McCullagh 2009. Marginal likelihood for distance matrices. Statistica Sinica 19: 631-649.
Examples
ras=raster(nrow=30,ncol=30)
extent(ras) <- c(0,30,0,30)
values(ras) <- 1
int=ras
cov.ras=ras
## get precision matrix of entire graph
B.int=get.TL(int)
Q.int=get.Q(B.int,1)
## get precision at a few nodes
Phi=get.Phi(Q.int,obs.idx=1:20)
S=ginv(as.matrix(Phi))
## simulate distance matrix
Dsim=rGenWish(df=20,Sigma=S)
image(Dsim)
## calculate log-likelihood
ll=dGenWish(Dsim,S,df=20,log=TRUE)
ll
[Package rwc version 1.11 Index]