Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prior for sv is not specified unless the model is hierarchical #364

Closed
igrahek opened this issue Mar 4, 2024 · 1 comment · Fixed by #366
Closed

Prior for sv is not specified unless the model is hierarchical #364

igrahek opened this issue Mar 4, 2024 · 1 comment · Fixed by #366
Assignees

Comments

@igrahek
Copy link

igrahek commented Mar 4, 2024

The code below works, but breaks with the following error if hierarchical=False

Error: ValueError: Please specify the prior or bounds for sv.

# Load a package-supplied dataset
data = hssm.load_data("cavanagh_theta")
data['response'] = data['response'].replace(0, -1)

# Specify the model
model = hssm.HSSM(
    model="ddm_sdv",
    loglik_kind="analytical",
    hierarchical=True,
    prior_settings="safe",
    data=data,
    p_outlier={"name": "Uniform", "lower": 0.01, "upper": 0.05},
    lapse=bmb.Prior("Uniform", lower=0.0, upper=5.0),
)

modelObject = model.sample(sampler="nuts_numpyro", 
                                cores=4,
                                chains=4,
                                draws=100,
                                tune=100,)

Including the prior on sv fixes the error, but it would be nice if there were defaults. Especially because sv was not hierarchical by default in HDDM I think.

Fix:

        {
            "name": "sv",
            "prior": {"name": "HalfNormal", "sigma": 2.0},
        },
@digicosmos86
Copy link
Collaborator

Yep! This is a bug on our end. Very easy to fix. Thanks for spotting this, @igrahek!

@digicosmos86 digicosmos86 self-assigned this Mar 6, 2024
@digicosmos86 digicosmos86 linked a pull request Mar 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants