Skip to content

Issue with link function in Mundlak Machine bonus content #450

@GuiMarthe

Description

@GuiMarthe

Hello folks

There seems to be a bug somewhere in the link function or model definition in the Mundlack Machine script.

In line 151 from https://github.com/rmcelreath/stat_rethinking_2024/blob/main/scripts/12_bonus_mundlak.r#L151 you are creating predictions from the posterior samples on top of the data.

But I keep getting the following error

> pf0 <- link(mf,data=list(g=1:N_groups,X=rep(0,N_groups)))
Error in Z[TRUE, g[i]] : incorrect number of dimensions

And it seems due to the usage of g as an index variable, but I couldn't figure it out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions