# NOT RUN {
# -------------------------------------------------------------------
# Example with Angular Central Gaussian Distribution
#
# Given a fixed A, generate samples and estimate A via ML.
# -------------------------------------------------------------------
## GENERATE AND MLE in R^5
# Generate data
Atrue = diag(5) # true SPD matrix
sam1 = racg(50, Atrue) # random samples
sam2 = racg(100, Atrue)
# MLE
Amle1 = mle.acg(sam1)
Amle2 = mle.acg(sam2)
# Visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3), pty="s")
image(Atrue[,5:1], axes=FALSE, main="true SPD")
image(Amle1[,5:1], axes=FALSE, main="MLE with n=50")
image(Amle2[,5:1], axes=FALSE, main="MLE with n=100")
par(opar)
# }
Run the code above in your browser using DataLab