`crps.numeric` does not pass `permutations` correctly to `crps.matrix`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
Research direction
The issue is in R/crps.R line 97 where permutations is not passed correctly. Start by examining the crps.numeric function and its call to crps.matrix. Ensure the permutations argument is explicitly passed. Also check scrps.numeric for the same pattern. Run the provided reproducible example to verify the fix.
Written by the indexing model from the issue text.
Description
Minimal reproducible example:
paste("loo version:", packageVersion("loo"), "\n") |> cat()
N = 1000000
cat("crps.numeric:\n")
system.time(
loo:::crps.numeric(1:3, 4:6, 5, permutations=N)
)
cat("crps.matrix:\n")
system.time(
loo:::crps.matrix(as.matrix(1:3), as.matrix(4:6), 5, permutations=N)
)
Output on my machine:
loo version: 2.10.1
crps.numeric:
user system elapsed
0.007 0.002 0.009
crps.matrix:
user system elapsed
6.954 0.033 6.989
I believe the issue is with this line:
https://github.com/stan-dev/loo/blob/df27ade95093db66cebf19d55530439386ac1a97/R/crps.R#L97
The permutations argument gets absorbed into the ...; I believe it needs to be passed as a named argument.
Also applies to scrps.numeric.
- Dominant language
- R
- Stars
- 157
- Forks
- 38
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 2
Contributor guide
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 stan-dev/loo
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Clean up issues Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
robjhyndman/forecast#1220 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
JamesHWade/deputy#192 ·
-
bug triage_needed
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pharmaverse/rtables#1123 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100