Getting MCMC residuals and their chains from RS model
Posted: Fri Jul 12, 2013 2:33 pm
Hi,
I am running a model with 8 level 2 variances (a diagonal matrix with 8 coefficients allowed to vary), on a sample of 20 level 2 units (countries), in MCMC with MLwiN. I want to output the residuals' chains (so that I can calculate things like coverage intervals around beta0+u0j).
I tried to do this through runmlwin - using the code
residuals(u, savechains("u.dta", replace))
but MLwiN crashed (the model ran fine, but it crashed once the run had finished but before it had sent the output to Stata). Any ideas why this would be? I thought it might be a memory issue but it crashes even when I only run 10 iterations... It works fine without the residuals option specified.
Thanks!
Andy
PS: my full code is:
runmlwin Y cons X1 X2 X3 X4 X5 X6 X7, ///
level2(Country: cons X1 X2 X3 X4 X5 X6 X7, diagonal) ///
level1(Year: cons) nopause
mat A = e(b)
mat A[1,15] = 0.001 //so the variance matrix is positive definte
runmlwin Y cons X1 X2 X3 X4 X5 X6 X7, ///
level2(Country: cons X1 X2 X3 X4 X5 X6 X7, ///
residuals(u, savechains("u.dta", replace)) diagonal) level1(Year: cons) ///
mcmc(chain(5000) burnin(500)) initsb(A)
I am running a model with 8 level 2 variances (a diagonal matrix with 8 coefficients allowed to vary), on a sample of 20 level 2 units (countries), in MCMC with MLwiN. I want to output the residuals' chains (so that I can calculate things like coverage intervals around beta0+u0j).
I tried to do this through runmlwin - using the code
residuals(u, savechains("u.dta", replace))
but MLwiN crashed (the model ran fine, but it crashed once the run had finished but before it had sent the output to Stata). Any ideas why this would be? I thought it might be a memory issue but it crashes even when I only run 10 iterations... It works fine without the residuals option specified.
Thanks!
Andy
PS: my full code is:
runmlwin Y cons X1 X2 X3 X4 X5 X6 X7, ///
level2(Country: cons X1 X2 X3 X4 X5 X6 X7, diagonal) ///
level1(Year: cons) nopause
mat A = e(b)
mat A[1,15] = 0.001 //so the variance matrix is positive definte
runmlwin Y cons X1 X2 X3 X4 X5 X6 X7, ///
level2(Country: cons X1 X2 X3 X4 X5 X6 X7, ///
residuals(u, savechains("u.dta", replace)) diagonal) level1(Year: cons) ///
mcmc(chain(5000) burnin(500)) initsb(A)