Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in importPosteriorFromHPC for GPP/Hmsc-hpc models with alignPost = TRUE #188

Open
elgabbas opened this issue May 13, 2024 · 1 comment

Comments

@elgabbas
Copy link

elgabbas commented May 13, 2024

Hello,

I am receiving the following error when using importPosteriorFromHPC to merge posteriors for multiple MCMC chains.

Error in cpL[[j]]$Alpha[[r]] <- abind(cpL[[j]]$Alpha[[r]], rep(1, nfMax -  : 
  more elements supplied than there are to replace

I noticed that this error occurred when setting alignPost = TRUE for some models. The error comes from the alignPosterior(m) part of the function.

Could you please explain what alignPost does and is it necessary to set it to TRUE in the importPosteriorFromHPC function?

Thanks

@elgabbas
Copy link
Author

UPDATE

I have uploaded the unfitted models along with the outputs of the Hmsc-HPC models in this link.

load("Mod_Init_Example.RData")
ListPost3 <- list.files("", pattern = "GPP30_NoTree_.+_post.rds$", full.names = TRUE) %>%
  sort() %>%
  snow::parLapply(cl = c1, x = ., fun = GetPosts)
# save(ListPost3, file = "ListPost3.RData")
# This failed
Model_Fit3 <- Hmsc::importPosteriorFromHPC(
  m = Mod_Init_DE, postList = ListPost3, nSamples = 1000, thin = 5, transient = 2000, alignPost = TRUE)

# This worked
Model_Fit3 <- Hmsc::importPosteriorFromHPC(
  m = Mod_Init_DE, postList = ListPost3, nSamples = 1000, thin = 5, transient = 2000, alignPost = FALSE)

This did not happen for me for other model variants created using almost identical scripts. Is there a specific reason for these model objects?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant