Closed cabantovalle closed 1 year ago
There are two potential problems.
The k-hat value of 1.7 is telling you that the normal approximation is not a good fit to your posterior.
Two things typically go wrong:
The posterior is not roughly normal and the variational approximation is poor. This is what Pareto k being 1.7 is telling you. This can be because of high correlation in the case of a "mean field" (diagonal) approximation.
The optimization doesn't find the best variational fit.
You can reduce step size and increase number of steps to test if (2) is the problem.
This isn't a bug report or issue, so I'm going to close this issue.
@cabantovalle for this type of help I'd suggest posting on the Stan discourse
[edit: formatted code, removed lines of
#
]I am trying to fit the basic SV model using the vb function in rstan. I simulate a SV model using an r function
This is stan model saved as sv.stan
Then this is the fit using rstan
As said before the true values for mu=0.005, phi=0.98 and sigma=0.2 and the following output:
Any idea why the code does not give me the correct results?
Best regards,
Carlos Abanto