# NOT RUN {
# -------------------------------------------------------------------
# Example with Matrix Angular Central Gaussian Distribution
#
# Given a fixed Sigma, generate samples and estimate Sigma via ML.
# -------------------------------------------------------------------
## GENERATE AND MLE in St(2,5)/Gr(2,5)
# Generate data
Strue = diag(5) # true SPD matrix
sam1 = rmacg(n=50, r=2, Strue) # random samples
sam2 = rmacg(n=100, r=2, Strue) # random samples
# MLE
Smle1 = mle.macg(sam1)
Smle2 = mle.macg(sam2)
# Visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3), pty="s")
image(Strue[,5:1], axes=FALSE, main="true SPD")
image(Smle1[,5:1], axes=FALSE, main="MLE with n=50")
image(Smle2[,5:1], axes=FALSE, main="MLE with n=100")
par(opar)
# }
Run the code above in your browser using DataLab