Skip to content

Random effect models fail at initialization in 2.1.18 (random_effect_raw dim mismatch) #283

Description

@simonmfr

A model with a random effect fails at parameter initialization in 2.1.18. It reproduces on the counts_obj, so it doesn't seem data-specific:

library(sccomp); library(dplyr)
data("counts_obj")
counts_obj |>
  mutate(donor = sample) |>
  sccomp_estimate(~ type + (1 | donor), .sample = sample,
                  .cell_group = cell_group, .abundance = count,
                  inference_method = "hmc", cores = 1)

Error:

Chain 1 Unrecoverable error evaluating the log probability at the initial value.
Chain 1 Exception: mismatch in dimension declared and found in context; processing stage=parameter initialization; variable name=random_effect_raw; position=1; dims declared=(20,36); dims found=(20,35) (in '/tmp/RtmpBn8kxm/model-8cff8636a24e8.stan', line 348, column 2 to column 93)
Error: Fitting failed. Unable to retrieve the metadata.

Without random effect it works without any issues.

For now I will go back to 1.10.0 where it works. Any advice is appreciated.

Environment:
-sccomp 2.1.18
-cmdstanr 0.9.0, CmdStan 2.39.0
-R 4.4.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions