Thanks nhuurre for the suggestion. That’s interesting because I already tried the trick exp(n*log(x)) in the bigger version of my model, as I discussed in this thread, and this seemed to make the code slower than looping. Surprisingly, when I try the trick in the simple model above the model runs in only 12 s! It’s amazing the large effect small changes can have, and such effect can be different depending on the model.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Reduce_sum performance | 15 | 1345 | September 28, 2020 | |
Understanding reduce_sum efficiency | 10 | 850 | March 22, 2021 | |
Multilevel hurdle model -- no performance increase with reduce_sum() | 5 | 543 | September 12, 2021 | |
Reduce_sum results in much slower run times, even for large datasets | 6 | 1421 | March 17, 2022 | |
Did i implement reduce sum correctly? | 1 | 115 | June 19, 2024 |