MBB-team / VBA-toolbox

The VBA toolbox
GNU General Public License v3.0
129 stars 67 forks source link

the prior hyperparameter choice for the dynamic noises #7

Closed zjwufei closed 8 years ago

zjwufei commented 9 years ago

I am using a non-informative prior setting for the gamma distributed precision of the dynamic noises in the second order differential model (VBA_StateSpaceModel). (priors.a_alpha =0.001; priors.b_alpha =0.001; priors.a_sigma =0.001; priors.b_sigma =0.001 ;) The mean value of the precision from the inferred results is in the order of 0.1 to 1, which is a quite big noise for my system.

Did I use a bad prior for the initial setting of the noise? How reliable is the inference of the hyperparameters for this toolbox?

Thank you in advance! I am looking forward to your reply.

zjwufei commented 9 years ago

And also, is there a way to constrain the measurement noise variance to a certain range or a number?

jdaunize commented 9 years ago

Dear Yan, Both measurement noise precision (sigma) and state noise precision (alpha) have prior and posterior Gamma densities. In particular, this implies that: x ~ Gamma(a,b) => E[x] = a/b and V[x]=a/b^2 So the first two moments of your priors are: E[x] = 1 and V[x] = 1000. In other words, you used almost flat priors (hge variance). To keep the same prior expectation and constrain your estimation, you should use a much bigger b value, e.g.: a=1000 and b=1000 (E[x]=1 and V[x] = 0.001). This is likely to constrain the mass of the posterior density on the precision within a tight interval around 1. Best, Jean.

zjwufei commented 9 years ago

Dear Jean,

Thank you very much for your help and detailed explanation. I followed your advice, and set the state noise precision (a=10^4, b=1) so that I got a system noise with a high precision and a wide variance ( so that if the prior is not that correct, it give flexibility to change to other values ). The free energy increases a lot and the inference of the parameters works quite accurate.

But since I don't actually know the order of the system noise for my data, my prior choice of 'a=10^4' is quite arbitrary. To justify this prior setting, I kept the value of 'b' the same, and tried different orders of 'a' from 10^0 - 10^20. I thought I could find the best prior for 'a' by finding the maximum value of free energy, but the free energy keeps going up when the order of the prior setting or 'a' increases, and becomes much much higher than the deterministic free energy (the same system but without state noise). The inference result for other parameters are quite similar except for the hyperparameters 'a' and 'b' for the state noise which almost keep the same value as the prior settings.

When I increase order of 'a' in system noise, the system should behave more like the deterministic part, so I was expecting the free energy value reaches an highest value, then drops down and converges to the deterministic free energy. But it simply seems go up forever. So I am wandering if it is correct to use free energy as an indicator to determine the optimized prior for hyperparameters? If not, are there anyway to determine the prior level of the system noise?

Thank you again for your patience. I really appreciate your help.

Best wishes,

Yan