Question on the underestimation of correlation coefficient rho in the iid2d model

163 views
Skip to first unread message

Yanzhao Wang

unread,
Jun 24, 2021, 10:27:27 PM6/24/21
to R-inla discussion group
I am recently working on a model with a latent effect, which follows an iid2d model and I am getting some inconsistent results for the hyperparameter, correlation coefficient, in the correlation matrix for the iid2d model.

To illustrate the problem, I have a toy example as attached. 

In the setup, I chose the precisions for the bivariate Gaussian variables to be big (38 and 44, which are close to the ones estimated in the research). 

Then I simulated the observations, Y, directly from the bivariate Gaussian distribution with those precisions and a correlation coefficient being .64. To mimic the research setup, the sample size for Y was 195 so there were 195 pairs of the Gaussian variables.

Then I simply fit the simulated data with an iid2d model without any other components included in the INLA model. The summary table of hyperparameters of the output gave me the estimation for the correlation coefficient to be .57. I also tried the inla.hyperpar.sample to see what the posterior mean of rho looked like, which was still around .57 and 0.57 is an underestimated result compared with the true value 0.64. 

Then I tried another approach using inla.posterior.sample to sample all the latent bivariate Gaussian effects first and then compute the sample correlations from the samples. And this outcome tended to be closer to the true value. 

So my question would be if the second approach was legit when the hyperparameter summary from inla gave an underestimate for the rho.

For some exploration trials, I also tried different parameters for the precisions and length of the Y observation. 

The first thing that I found was that when the precision parameters are small, both hyperparameter sample and computation from the correlation of sampled latent effect worked similarly well but with bigger precisions, hyperparameter sampling would give an underestimate. 

The Second thing was found to be that when I increased the length of Y simulated observations, both approaches also worked similarly well.

 Your time and response are greatly appreciated.




Toy example.zip

Helpdesk

unread,
Jun 25, 2021, 7:34:27 AM6/25/21
to Yanzhao Wang, R-inla discussion group

if you want to sample hyperparameters, then use hyperpar.sample, like

mean(inla.hyperpar.sample(1000, a_inla)[,3])

as posterior.sample is for the latent field, as it use the integration
points for the hyperparameters (hence a discrete distribution from it).
the hyperparm sample will sample from the the internal reprerentation
from which the marginals are approximated from.

otherwise, the to low correlation is due to the prior, see
inla.doc("iid2d"), if you change R_11 and R_22 from 1 to 0.1 or 0.01, as
below, then you get what you want.

a_formula= Y~-1+f(alpha,model='iid2d',n=twon, hyper = list(theta1 =
list(param = c(4, 0.01, 0.01, 0))))
> --
> You received this message because you are subscribed to the Google
> Groups "R-inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to r-inla-discussion...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/r-inla-discussion-group/bc268c38-ed74-4550-ad39-e9efd3359568n%40googlegroups.com
> .

--
Håvard Rue
he...@r-inla.org

Yanzhao Wang

unread,
Jun 25, 2021, 9:16:31 AM6/25/21
to R-inla discussion group
Thanks a lot! It makes sense!
Reply all
Reply to author
Forward
0 new messages