Open fweber144 opened 3 years ago
Following up on this based on https://discourse.mc-stan.org/t/projpred-error/37314/3. Sorry I never saw this previously. As a non-Windows user I'm not quite sure how to fix this. It seems like the issue here is that tau0
would need to be included in clusterExport()
, but tau0
is just in the global environment. How would we know which variables in the global environment we need to export (assuming we wouldn't want to export everything since there could be large irrelevant objects in the global environment)?
Summary:
On Windows, the parallelization of
kfold()
across the CV folds doesn't always work (throws an error).Description:
The issue mentioned in "Summary" occurs if the
stan_<...>()
call uses objects in some arguments (see "Reproducible Steps" below). Perhaps the reason is that there are no exports after the following lines?: https://github.com/stan-dev/rstanarm/blob/45e0707b0ab8c8e16d65e7f2af70a98bfaa93363/R/loo-kfold.R#L226-L227Reproducible Steps:
Now inner parallelization via
kfold.stanreg()
's internal objectstan_cores
works (doesn't throw an error) and gives the (correct) messagesFitting model 1 out of 4
, ...,Fitting model 4 out of 4
:However, outer parallelization across CV folds via
kfold.stanreg()
's internal objectkfold_cores
doesn't work:That last line gives the (correct) message
Fitting K = 4 models distributed over 4 cores
, but throws the errorRStanARM Version:
2.21.2 (from https://mc-stan.org/r-packages/)
R Version:
4.1.1
Operating System:
Windows 10 x64