BEAST (2.4.5) terminates with "Fatal exceptions: Weights vector should have the same length as parameter dimension" - searched all over for solutions

155 views
Skip to first unread message

Derek Woller

unread,
May 16, 2017, 1:40:39 AM5/16/17
to beast-users
Hello, all! I have been using various versions of BEAST for a while now and every previous time I have run into an error, I have managed to find a solution (mostly from here, so many thanks!), but I have had to admit defeat this time. I am trying to run a multispecies coalescent analysis using STARBEAST and it consistently fails, both locally on my PC's version of BEAST (2.4.5) and via CIPRES' BEAST2 version. Using CIPRES, the analysis will run from a few hours to almost a day and then stop with a log file that is essentially blank.This is the error message I consistently receive when using my PC after the XML file (attached) runs for a few minutes:

"Sample      posterior ESS(posterior)     likelihood          prior
              0   -106770.4940              N   -107158.4115       102.4822 --
java.lang.IllegalArgumentException: Weights vector should have the same length as parameter dimension
at beast.evolution.operators.DeltaExchangeOperator.weights(Unknown Source)
at beast.evolution.operators.DeltaExchangeOperator.proposal(Unknown Source)
at beast.core.Operator.proposal(Unknown Source)
at beast.core.MCMC.doLoop(Unknown Source)
at beast.core.MCMC.run(Unknown Source)
at beast.app.BeastMCMC.run(Unknown Source)
at beast.app.beastapp.BeastMain.<init>(Unknown Source)
at beast.app.beastapp.BeastMain.main(Unknown Source)
at beast.app.beastapp.BeastLauncher.main(Unknown Source)
Fatal exception: Weights vector should have the same length as parameter dimension
Fatal exception: Weights vector should have the same length as parameter dimension

BEAST has terminated with an error. Please select QUIT from the menu."

Based mainly on the assistance that Remco gave a user in this thread:

it would seem that the issue lies with the "DeltaExchangeOperator" weights and proposal. Examples of these items that I can find in my XML (attached) are:

<operator id="BMT_FrequenciesExchanger.s:nad6_3" spec="DeltaExchangeOperator" delta="0.01" weight="0.1">

and

 <operator id="FixMeanMutationRatesOperator" spec="DeltaExchangeOperator" delta="0.75" weight="2.0">

You can see that the delta and weights are different, but are these the "weights vector" that should be the same length as the "parameter dimension"? If so, I don't understand because I have seen other successful XML files that have different values for "delta" and "weight". I have googled every permutation of these error messages that I can think of and only found the thread linked to above. If I'm understanding correctly, in that same thread, Remco also suggests (in BEAUTi) de-selecting "estimate" for Site Mdoel's Mutation Rate, which I tried, but received the same errors. 

For further perspective, I have run similar analyses before with no problems. The only difference that I can think of this time is that I am trying to include bModelTest for finding the best Site Models for each gene as it sounded like a better/easier option than jModelTest. However, I've also tried an analysis using bModelTest with fewer partitions and it ran fine, so I'm out of ideas to try.

Anyone have any suggestions? I'm hoping it's something simple that I'm overlooking.

Thank you!
PGMSC2.xml

Remco Bouckaert

unread,
May 16, 2017, 4:43:19 PM5/16/17
to beast...@googlegroups.com
Hi Derek,

It looks like something went wrong adding delta exchange operators for exchanging relative rates between partitions; there should be only one with id=FixMeanMutationRatesOperator but there are others with id=FixMeanMutationRatesOperator.16S_3, id=FixMeanMutationRatesOperator.18S_3, etc that should be removed. The analysis runs fine without these operators (as in the attached). It is a bit of a mystery to me how the operators were added, since they should never get an id with partition names attached. Can you remember what you did in BEAUti when setting up the analysis? Any clues can be helpful finding out what went wrong.

Cheers,

Remco

PGMSC2.xml

Remco Bouckaert

unread,
Jan 20, 2021, 1:27:39 PM1/20/21
to beast...@googlegroups.com
Hi Remco!
I came across the same error now (using BEAUti v2.6.3 with BEAST v2.6.2):
Fatal exception: Weights vector should have the same length as parameter dimension
java.lang.IllegalArgumentException: Weights vector should have the same length as parameter dimension

While this is an old post it was the only one mentioning this error I could find online.
The error occured after I modified my original xml (which runs without problems) by linking the clock models of partitions. 
I could prevent this error by linking first the clock models of partitions, then navigating to Clock Model panel and changing the clock model to different one than I wanted to use (I tried Strict clock) and then changing it back to the original clock model defined in my xml file (Relaxed Clock Log Normal).

Cheers,
Ales

<PGMSC2.xml>

-- 
You received this message because you are subscribed to the Google Groups "beast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beast-users...@googlegroups.com.
To post to this group, send email to beast...@googlegroups.com.
Visit this group at https://groups.google.com/group/beast-users.
For more options, visit https://groups.google.com/d/optout.
<PGMSC2.xml>

Reply all
Reply to author
Forward
Message has been deleted
0 new messages