Closed msuchard closed 9 years ago
In the screenshot t is way too large (48000) so exp(c1 * t) overflows. The issue is
that the initial t needs to be specified so that it is greater than the root time but
only a little bit. Perhaps the initial value needs to be set as rootHeight + delta?
Reported by rambaut
on 2012-02-02 07:40:42
This is very tricky part:
origin (t here) = avgInitialRootHeight * 1.1, which is not big increase during auto-rescaling.
But the problem is that avgInitialRootHeight = options.maximumTipHeight * 10.0; from
BEAUti estimation in "case TIP_CALIBRATED" of ClockModelOptions.calculateInitialRootHeightAndRate(partitions).
We spent a lot of time on this, but never getting any good estimation of init root
height for all cases.
Would you have any simple solution?
Reported by dong.w.xie
on 2012-02-03 04:05:33
The problem is the entire scale of the numbers. If the c1 * t > 700 then it will over
flow. The solution may be to scale t down by using a larger time unit?
Reported by rambaut
on 2012-02-03 07:07:38
just checked the critical equation:
res = 2.0 * (1.0 - c2 * c2) + Math.exp(-c1 * t) * (1.0 - c2) * (1.0 - c2) + Math.exp(c1
* t) * (1.0 + c2) * (1.0 + c2);
So, it is correct. However we could rewrite it:
res = Math.exp(c1 * t) * ( Math.exp(-c1 * t) * (1.0 - c2) + (1.0 + c2) ) * ( Math.exp(-c1
* t) * (1.0 - c2) + (1.0 + c2) );
meaning if we operate directly in logspace:
res = c1*t+2* Log ( Math.exp(-c1 * t) * (1.0 - c2) + * (1.0 + c2) );
so we avoid any Math.exp(c1*t) !
Reported by tanja819
on 2012-02-03 15:40:35
sorry last row is a typo, correct is:
res = c1*t+2* Log ( Math.exp(-c1 * t) * (1.0 - c2) + (1.0 + c2) );
Reported by tanja819
on 2012-02-03 15:41:40
Reported by dong.w.xie
on 2012-02-06 22:20:09
Fixed
Originally reported on Google Code with ID 569
Reported by
dong.w.xie
on 2012-02-01 22:31:36![Screen shot 2012-02-02 at 11.17.59 AM.png](https://storage.googleapis.com/google-code-attachments/beast-mcmc/issue-569/comment-0/Screen shot 2012-02-02 at 11.17.59 AM.png)