# Getting Error using ModelComparisonSimulator in BF 2.0.1

**URL:** <https://discuss.bayesflow.org/t/getting-error-using-modelcomparisonsimulator-in-bf-2-0-1/150>\
**Category:** General\
**Created:** [April 25, 2025, 9:14am UTC](https://discuss.bayesflow.org/t/getting-error-using-modelcomparisonsimulator-in-bf-2-0-1/150 "2025-04-25T09:14:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dizyd](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@dizyd](https://discuss.bayesflow.org/u/dizyd)\
**Post date:** [April 25, 2025, 9:14am UTC](https://discuss.bayesflow.org/t/getting-error-using-modelcomparisonsimulator-in-bf-2-0-1/150/1 "2025-04-25T09:14:52Z")

</div>

Hey,

I am trying to use the new BayesFlow version (2.0.1) and workflow to make individual-level comparisons between a set of some cognitive process models. I oriented myself on the “_Simple Model Comparison - One Sample T-Test_” - Example, which runs without problems so far.

However, when I use models with different sets of parameters, I run into an error. Here is one minimal working example:

```auto
def prior_1():
    return dict(w=rng.uniform())

def prior_2():
    return dict(c=rng.uniform())

def model_1(w):
    return dict(x = w)

def model_2(c):
    return dict(x = c)

simulator_1 = bf.make_simulator([prior_1,model_1])
simulator_2 = bf.make_simulator([prior_2,model_2])

simulator = bf.simulators.ModelComparisonSimulator(simulators=[simulator_1, simulator_2])
simulator.sample(10)

```

The error I am getting is: `dictionary key mismatch; expected key(s): ['w', 'x'], got key(s): ['c', 'x'], missing key(s): ['w'], extra key(s): ['c']`

Maybe I have overlooked something in the documentation, but any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![valentin](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.bayesflow.org/valentin/32/103_2.png) [@valentin](https://discuss.bayesflow.org/u/valentin)\
**Post date:** [April 25, 2025, 10:14am UTC](https://discuss.bayesflow.org/t/getting-error-using-modelcomparisonsimulator-in-bf-2-0-1/150/2 "2025-04-25T10:14:37Z")

</div>

Hey,  
welcome to the forum and thanks for reaching out. I can reproduce the error with your example, it looks like a bug in the way the outputs of the simulators are combined. The current implementation seems not to be able to deal with different parameter names from prior functions. I’m not sure if this is intended behavior, but even then it should produce a meaningful warning/error. I have opened [an issue](https://github.com/bayesflow-org/bayesflow/issues/441), and hope we can fix this soon. For now, you could resort to producing the same dicts in the two priors, and just setting the ones that are not needed to zero (or any other arbitrary value).
