beast-dev / beast-mcmc

Bayesian Evolutionary Analysis Sampling Trees
http://beast.community
GNU Lesser General Public License v2.1
192 stars 73 forks source link

BEAUti should explicitly generate uniform priors #418

Closed msuchard closed 9 years ago

msuchard commented 9 years ago

Originally reported on Google Code with ID 409

Currently, BEAUti generates uniform priors between bounds by setting upper and lower
attributes on the parameters. This should change to adding a <uniformPrior> element
to the priors block so all priors are explicitly defined in one place. As a consequence
the 'upper' and 'lower' attributes of a parameter should reflect the actual range of
values the parameter can take (i.e., in most cases these will be some combination of
-Inf, +Inf, 0 or 1).

Reported by rambaut on 2010-09-30 21:58:04

msuchard commented 9 years ago
But it seems some BEAUti default boundaries have problem:

- <logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
  <parameter idref="CP1+2.kappa" /> 
  </logNormalPrior>
- <logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
  <parameter idref="CP3.kappa" /> 
  </logNormalPrior>
- <uniformPrior lower="0.0" upper="Infinity">
  <parameter idref="CP1+2.mu" /> 
  </uniformPrior>
- <uniformPrior lower="0.0" upper="Infinity">
  <parameter idref="CP3.mu" /> 
  </uniformPrior>
- <uniformPrior lower="0.0" upper="1.0">
  <parameter idref="CP1+2.frequencies" /> 
  </uniformPrior>
- <uniformPrior lower="0.0" upper="1.0">
  <parameter idref="CP3.frequencies" /> 
  </uniformPrior>
- <uniformPrior lower="0.0" upper="1000.0">
  <parameter idref="CP1+2.alpha" /> 
  </uniformPrior>
- <uniformPrior lower="0.0" upper="1000.0">
  <parameter idref="CP3.alpha" /> 
  </uniformPrior>
- <oneOnXPrior>
  <parameter idref="exponential.popSize" /> 
  </oneOnXPrior>
- <uniformPrior lower="-Infinity" upper="Infinity">
  <parameter idref="exponential.growthRate" /> 
  </uniformPrior>
  <coalescentLikelihood idref="coalescent" /> 

Result:

 CompoundLikelihood(compoundModel)=(
    DistributionLikelihood=-1.8654, 
    DistributionLikelihood=-1.8654, 
    DistributionLikelihood=-Inf, 
    DistributionLikelihood=-Inf, 
    DistributionLikelihood=0.0, 
    DistributionLikelihood=0.0, 
    DistributionLikelihood=-6.9078, 
    DistributionLikelihood=-6.9078, 
    OneOnX(exponential.popSize)=4.0174, 
    DistributionLikelihood=-Inf, 
    CoalescentLikelihood(coalescentLikelihood)=54.4972
  ), 
  CompoundLikelihood(compoundModel)=(
    TreeLikelihood(treeLikelihood)=-2061.0466, 
    TreeLikelihood(treeLikelihood)=-916.1405
  )

Reported by dong.w.xie on 2010-10-08 02:02:55


msuchard commented 9 years ago
Do not add explicit uniform prior if one or other bound is infinity. The issue was if
you (say) set a uniform prior on clock.rate of [0, 100], BEAUti generates this by setting
the upper limit on the parameter which obscures the fact this prior is there. I think
the upper and lower on the parameters should only be used to define 'hard' bounds.

Reported by rambaut on 2010-10-08 06:44:14

msuchard commented 9 years ago

Reported by dong.w.xie on 2011-03-20 23:00:26