I am new to Stan but I am in awe of it. Thanks so much for this great piece of software.

When it comes to programming my first proper Stan program, my problem is that I have a covariance matrix, Omega:

parameters {

cov_matrix[3] Omega;

}

and I would like to impose constraints on it plus priors that observe these constraints. Specifically, I would like to normalize Omega[2:3, 2:3] to be an identity matrix and Omega[1,2:3] (and thus Omega[2:3,1]) to be positive. I don’t know how to do while ensuring that Omega remains positive definite and does not mess up the HMC sampling. I would appreciate any help or pointers you could give me.

For context, I am trying to implement a network econometric model in Stan (reference below) for my research, and this is the last bit missing, I think. In coding the model, I observed the advice to start with the most simple model, incrementally adding layers of complexity, making sure I am able to recover parameters from simulated data.

–Christian

Reference

Hsieh, C. S., & Lee, L. F. (2016). A social interactions model with endogenous friendship formation and selectivity. Journal of Applied Econometrics, 31(2), 301-319.