ML estimation by using BEUTI 1.8

332 views
Skip to first unread message

sarah afreen

unread,
May 21, 2015, 3:04:36 AM5/21/15
to beast...@googlegroups.com
Hello
I am trying to do ML estimation through path sampling. I am using beuti v1.8 in which i can select the option for ml estimation through path sampling/stepping stone sampling. The problem is that beast is not able to use the samples logged into the mle.file for Marginal Likelihood estimation. it says that it can not find the file [mle] whereas i can open the file in notepad and can see the values of
state    pathLikelihood.delta    pathLikelihood.source    pathLikelihood.destination    & pathLikelihood.theta.
the column   pathLikelihood.pathLikelihood remains empty

I can not understand what is wrong with the file and how can it be corrected?
I will be highly obliged by any help in this matter.


Guy Baele

unread,
May 21, 2015, 5:49:37 AM5/21/15
to beast...@googlegroups.com
Hi Sarah,

Can you post the XML blocks of the marginalLikelihoodEstimator, pathSamplingAnalysis and steppingStoneAnalysis elements?
And perhaps also the first few lines of the mle.file?

Best regards,
Guy


Op donderdag 21 mei 2015 09:04:36 UTC+2 schreef sarah afreen:

sarah afreen

unread,
May 21, 2015, 10:34:28 AM5/21/15
to beast...@googlegroups.com
Hi Dr. Baele
 
Thank you for your response. I am extremely sorry to say that the problem was actually in the xml file. This is the error message--------
 
Attempting theta (98/101) = 8.389527766075414E-6 for 1000000 iterations + 100000 burnin.
Attempting theta (99/101) = 2.171534093275924E-6 for 1000000 iterations + 100000 burnin.
Attempting theta (100/101) = 2.1544346900318824E-7 for 1000000 iterations + 100000 burnin.
Attempting theta (101/101) = 0.0 for 1000000 iterations + 100000 burnin.
3 file(s) found with marginal likelihood samples
dr.xml.XMLParseException: Error parsing '<pathSamplingAnalysis>' element with id, 'null':
File 'C:\Users\Sikandar\Documents\second bayesian analysis\denv-1' can not be opened for pathSamplingAnalysis element.
 at dr.xml.AbstractXMLObjectParser.parseXMLObject(Unknown Source)
 at dr.xml.XMLParser.convert(Unknown Source)
 at dr.xml.XMLParser.convert(Unknown Source)
 at dr.xml.XMLParser.parse(Unknown Source)
 at dr.app.beast.BeastMain.<init>(Unknown Source)
 at dr.app.beast.BeastMain.main(Unknown Source)
May 21, 2015 8:47:27 AM dr.app.beast.BeastMain <init>
SEVERE: Parsing error - poorly formed BEAST file, denv-1 strict bayesian.xml:
Error parsing '<pathSamplingAnalysis>' element with id, 'null':
File 'C:\Users\Sikandar\Documents\second bayesian analysis\denv-1' can not be opened for pathSamplingAnalysis element.
java.lang.RuntimeException: Terminate
 at dr.app.beast.BeastMain.<init>(Unknown Source)
 at dr.app.beast.BeastMain.main(Unknown Source)
BEAST has terminated with an error. Please select QUIT from the menu.
 
 
 
These are the xml blocks of the concerned file
 
 
<!--
 START Marginal Likelihood Estimator                                     
  -->
- <!--
 Define marginal likelihood estimator settings                           
  -->
- <marginalLikelihoodEstimator chainLength="1000000" pathSteps="100" pathScheme="betaquantile" alpha="0.3">
- <samplers>
  <mcmc idref="mcmc" />
  </samplers>
- <pathLikelihood id="pathLikelihood">
- <source>
  <posterior idref="posterior" />
  </source>
- <destination>
  <prior idref="prior" />
  </destination>
  </pathLikelihood>
- <log id="MLELog" logEvery="1000" fileName="denv-1 strict bayesian.mle.log">
  <pathLikelihood idref="pathLikelihood" />
  </log>
  </marginalLikelihoodEstimator>
- <!--
 Path sampling estimator from collected samples                          
  -->
- <pathSamplingAnalysis fileName="denv-1 strict bayesian.mle.log">
  <likelihoodColumn name="pathLikelihood.delta" />
  <thetaColumn name="pathLikelihood.theta" />
  </pathSamplingAnalysis>
- <!--
 Stepping-stone sampling estimator from collected samples                
  -->
- <steppingStoneSamplingAnalysis fileName="denv-1 strict bayesian.mle.log">
  <likelihoodColumn name="pathLikelihood.delta" />
  <thetaColumn name="pathLikelihood.theta" />
  </steppingStoneSamplingAnalysis>
- <!--
 END Marginal Likelihood Estimator                                       
  -->
- <report>
- <property name="timer">
  <mcmc idref="mcmc" />
  </property>
  </report>
  </beast>
 
 
First few lines of the mle file
 
# BEAST v1.8.1, r6542
# Generated Wed May 20 23:45:11 IST 2015 [seed=1432138736004]
state pathLikelihood.delta pathLikelihood.source pathLikelihood.destination pathLikelihood.theta pathLikelihood.pathLikelihood
100000 -2459.4502030120375 -7568.197477308087 -5108.74727429605 1.0 -7568.197477308087
101000 -2449.3076364727212 -7557.721830809901 -5108.41419433718 1.0 -7557.721830809901
102000 -2447.913228985204 -7560.33326055104 -5112.420031565836 1.0 -7560.33326055104
103000 -2443.5134459617884 -7547.766004477944 -5104.252558516156 1.0 -7547.766004477944
104000 -2458.9397058205295 -7570.346895138111 -5111.4071893175815 1.0 -7570.346895138111
105000 -2449.961104361034 -7562.945440774977 -5112.984336413943 1.0 -7562.945440774977
106000 -2444.7838659186173 -7556.575840562156 -5111.791974643539 1.0 -7556.575840562156
107000 -2451.8810488224326 -7560.5195169028675 -5108.638468080435 1.0 -7560.5195169028675
 
 
 
I hope this information will help in identifying the problem. Kindly help me in carrying out the path sampling analysis.
Thanks in advance.
 
Best Regards
Sarah Afreen

Guy Baele

unread,
May 21, 2015, 6:03:28 PM5/21/15
to beast...@googlegroups.com
Hi Sarah,

You should not use spaces in the file name of the log file in the pathSamplingAnalysis and steppingStoneSamplingAnalysis XML elements.
A space-delimited list of files can also be used to combine multiple runs, so spaces in the file names themselves will indeed not work.

Best regards,
Guy


Op donderdag 21 mei 2015 16:34:28 UTC+2 schreef sarah afreen:

sarah afreen

unread,
May 22, 2015, 12:42:19 PM5/22/15
to beast...@googlegroups.com
Hi Dr. Baele

Thank you for your help in this matter. I have done a few analyses for which I have mle files generated but not the marginal likelihood estimate. Could you suggest a way of using these mle files for ML estimation directly. I tried to edit the xml file but BEAST could not recognize the edited file.

Best Regards
Sarah Afreen

Guy Baele

unread,
May 23, 2015, 4:47:41 AM5/23/15
to beast...@googlegroups.com
You can simply create a very short BEAST XML file, which only contains the pathSamplingAnalysis and steppingStoneSamplingAnalysis XML elements.
But don't forget to put them within the <beast> and </beast> elements.
Then simply run this short XML file in the directory where your log file was generated.

Best regards,
Guy


Op vrijdag 22 mei 2015 18:42:19 UTC+2 schreef sarah afreen:

sarah afreen

unread,
May 23, 2015, 7:43:59 AM5/23/15
to beast...@googlegroups.com
Thank you very much Dr. Baele. ML analysis is running fine when i use file names without spaces. Further i could also generate the shortened xml file and carry out ML estimation with the mle files. Thank you very very much.

Best Regards
Sarah Afreen
Reply all
Reply to author
Forward
0 new messages