lmoffatt / macro_dr

GNU General Public License v3.0
1 stars 1 forks source link

levenberg is not working properly #194

Closed lmoffatt closed 3 months ago

lmoffatt commented 6 months ago

compared to thermo it does not perform well.

lmoffatt commented 6 months ago

1st I will test if logLikelihood and diff_logLikelihood returns the same logL.

I did it and it returned the same value.

lmoffatt commented 6 months ago

Then there might be something wrong with the levenberg.

I looked into the formula and it was wrong:

 double logA =    (logL_candidate + logP_backward  ) - (logL_current +logP_forward );

instead of the right code:

  double logA =     (logL_candidate + logP_forward ) - (logL_current + logP_backward);
lmoffatt commented 6 months ago

I was wrong with the correction, the original proposition

double logA =    (logL_candidate + logP_backward  ) - (logL_current +logP_forward );

was the right one.

lmoffatt commented 6 months ago

I found out where the problem was: in thermo jump specifically in the iteration through betas.