Issue with link function in Mundlak Machine bonus content
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
Research direction
Start with scripts/12_bonus_mundlak.r around line 151, where link(mf) is called with a data list containing g and X. Reproduce the error, then check the dimensions of the posterior array Z and how g is used to index it inside link. Done means the call returns predictions for each group without the 'incorrect number of dimensions' error, and the script still runs.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- R
- Stars
- 2.4k
- Forks
- 632
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rmcelreath/rethinking
-
Typo: p.381Open
Difficulty 1/5 Under an hour Newbie friendliness 95/100
rmcelreath/rethinking#482 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
rmcelreath/rethinking#476 ·
-
Typo: p.302Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
rmcelreath/rethinking#475 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
rmcelreath/rethinking#474 ·
-
Comma splice: p.557Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
rmcelreath/rethinking#471 ·
All issues in rmcelreath/rethinking
Similar issues
-
1.7
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pharmaverse/admiral#3235 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
SticsRPacks/CroPlotR#185 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day