katylettuce / beast-mcmc

Automatically exported from code.google.com/p/beast-mcmc
0 stars 0 forks source link

BEAGLE rescaling options, always and delayed, should exhibit identical chains but they don't #653

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The BEAGLE options scaling=always and scaling=delayed should give identical 
sequence of samples with the same seed but the example below shows differences 
(delayed option is also causing issues with most proposals being rejected). 
Delayed option should switch to always rescaling after the first overflow. In 
the example below, the chains diverge after the first rescaling.

-beagle-scaling=always

# BEAST v1.7.3, r5082
# Generated Mon Aug 06 09:15:03 CEST 2012 [seed=666]
state   Posterior       Prior           Likelihood      rootHeight  
    H5N1_HA.clock.rate  location.clock.rate location.nonZeroRates
0   -24514.9033     -156.9704       -24357.9329     9.34899         1E-3            1.00000     
    21.0000         -
1000    -15471.2796     -476.4849       -14994.7946     15.6432         6.76034E-3      0.20111   
    15.0000         -
2000    -14011.5906     -457.0697       -13554.5209     14.3375         5.56877E-3      0.17667   
    13.0000         -
3000    -13013.0361     -471.5018       -12541.5343     13.8249         5.64865E-3      0.29129   
    11.0000         -
4000    -12255.2879     -493.2464       -11762.0415     13.7469         4.2075E-3       0.22652   
    10.0000         -
5000    -11640.6458     -488.2280       -11152.4178     13.7771         4.04717E-3      0.19745   
    9.00000         -
6000    -11252.6570     -489.6100       -10763.0470     12.7436         3.65386E-3      0.17715   
    8.00000         -
7000    -10798.5852     -484.4701       -10314.1152     12.8490         3.28632E-3      0.27200   
    8.00000         -
8000    -10640.6497     -484.7473       -10155.9024     13.2884         3.25761E-3      0.15837   
    8.00000         -
9000    -10492.4090     -472.1255       -10020.2835     13.1403         3.00606E-3      0.42279   
    7.00000         -
10000   -10331.1762     -472.3470       -9858.8292      12.2513         2.90086E-3      0.27055  
    8.00000         -
11000   -10277.8168     -467.8113       -9810.0055      13.0357         3.13293E-3      0.26710  
    9.00000         0.31 hours/million states
12000   -10216.6234     -476.2130       -9740.4105      12.9934         3.17816E-3      0.23485  
    8.00000         0.31 hours/million states
13000   -10011.4421     -472.9405       -9538.5016      12.4807         2.85854E-3      0.31746  
    8.00000         0.32 hours/million states
14000   -9819.5106      -465.9173       -9353.5933      12.4323         2.87137E-3      0.25766  
    8.00000         0.32 hours/million states
15000   -9764.5859      -462.6480       -9301.9379      13.5435         2.68654E-3      0.21090  
    7.00000         0.32 hours/million states

beagle-scaling=delayed (default)

state   Posterior       Prior           Likelihood      rootHeight  
    H5N1_HA.clock.rate  location.clock.rate location.nonZeroRates
0   -24514.9033     -156.9704       -24357.9329     9.34899         1E-3            1.00000     
    21.0000         -
1000    -15471.2796     -476.4849       -14994.7946     15.6432         6.76034E-3      0.20111   
    15.0000         -
2000    -14011.5906     -457.0697       -13554.5209     14.3375         5.56877E-3      0.17667   
    13.0000         -
3000    -13013.0361     -471.5018       -12541.5343     13.8249         5.64865E-3      0.29129   
    11.0000         -
4000    -12255.2879     -493.2464       -11762.0415     13.7469         4.2075E-3       0.22652   
    10.0000         -
Underflow calculating likelihood. Attempting a rescaling...
5000    -11628.9072     -490.1584       -11138.7488     13.7771         3.86248E-3      0.24620   
    9.00000         -
6000    -11309.7820     -491.2228       -10818.5592     12.5178         3.93683E-3      0.24620   
    9.00000         -
7000    -11021.4019     -486.7653       -10534.6366     13.2535         3.32617E-3      0.30061   
    7.00000         -
8000    -10897.4901     -483.7151       -10413.7749     13.6087         3.15399E-3      0.21106   
    7.00000         -
9000    -10751.8445     -481.0416       -10270.8029     12.5061         3.28353E-3      0.27954   
    7.00000         -
10000   -10646.2304     -480.9474       -10165.2830     13.0714         3.00987E-3      0.27954  
    7.00000         -
11000   -10449.7673     -475.0085       -9974.7587      12.9057         3.10199E-3      0.27954  
    7.00000         0.13 hours/million states
12000   -10276.5621     -472.1868       -9804.3753      12.9617         2.96764E-3      0.27954  
    7.00000         0.12 hours/million states
13000   -10169.3354     -469.6392       -9699.6961      15.3789         3.29927E-3      0.27954  
    7.00000         0.13 hours/million states
14000   -9974.3920      -464.0892       -9510.3028      12.3560         3.05065E-3      0.27954  
    7.00000         0.13 hours/million states
15000   -9819.3912      -460.4138       -9358.9774      13.4242         3.02624E-3      0.27954  
    7.00000         0.13 hours/million states

Original issue reported on code.google.com by ramb...@gmail.com on 6 Aug 2012 at 7:51

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Delayed scaling doesn't work as it should - after its first underflow and 
rescaling it doesn't seem to do any further rescaling.

Original comment by ramb...@gmail.com on 10 Aug 2012 at 9:27

GoogleCodeExporter commented 9 years ago
This was a actually an artefact of the test xml being used. All the scaling 
options seem to work now. Scaling=always gives better precision and so may give 
a sequence of states that diverge from the others for a given seed because an 
acceptance path may differ based on the difference in precision. This shouldn't 
affect MCMC results because the precision differences are small.

Original comment by ramb...@gmail.com on 15 Aug 2012 at 10:48