Description Usage Arguments Value Author(s) References Examples
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.
1 |
Sigma |
The covariance parameter of the Generalized Wishart. |
df |
An integer specifying the degrees of freedom. |
A matrix of dimension equal to the dimension of Sigma.
Ephraim M. Hanks
McCullagh 2009. Marginal likelihood for distance matrices. Statistica Sinica 19: 631-649.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.