rmcminds / stan_models

collection of models written in Stan, with data wrangling code to run the models on real data
1 stars 2 forks source link

implement QR #28

Open rmcminds opened 5 years ago

rmcminds commented 5 years ago

i had abandoned the QR parameterization a while ago because the way it's used in the manual doesn't allow each column of the model matrix to have its own variance, and I couldn't see how to implement it. Have now done so for one portion of the model that could use it - the rawNodeEffects on one dimension. Not entirely sure it will help given the Stan people's limiting its use the way they have, but I keep getting the pesky single divergence out of 1250 transitions, and it's worth a shot to get rid of the others and maybe improve the scaling of the model.

rmcminds commented 5 years ago

consider looking at bjork model for how they transform 'loadings' (model matrix) into a correlation matrix. could reverse-engineer.

rmcminds commented 5 years ago

problem with QR is that it assumes the variance of all the effects in the model matrix is equal. this is of course far from the truth in our model. maybe it would still be useful to perform qr on the model matrix as it's scaled according to defaults? currently it's all 1's and 0's, but even the prior expectations (defaults) are not equal because of nestedness and phylogenetic information. given the way i implement the scaling, trying this has been tricky