Getting unconstrained parameters from stanfit object?

Posting out loud clears the brain, answer is:

clist=apply(cmat,1,function(x) relist(flesh = x,skeleton = fit@inits[[1]]))
ulist=lapply(clist,function(x) unconstrain_pars(fit,x))

Handy for generating quantities separately, with this extra step:

ygen = lapply(ulist, function(x) constrain_pars(sfgen,x))

where sfgen is a stanfit object with the same parameters and data but different generated quantities / other bits.

1 Like

In PyStan you can. Check following test for example

But I believe you are interested about RStan

Edit. You answered already :)

1 Like