-
Notifications
You must be signed in to change notification settings - Fork 4
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
Predict failure when using hpc implementation #10
Comments
At which state do you get this error? When running in R or after taking the object to the HPC platform? |
Hi, Thanks for the positive feedback! I am aware of this issue that you have run into. It comes from duality of certain matrix vs list of vector representations in JSON, which is used to transfer posterior from TF to R. E.g. [[1,2],[3,4]] can be both 2x2 matrix and two-element list with vectors of length 2. So far such misbehaviour has happened only for alpha parameter in some contexts, but theoretically it can manifest for other parameters as well. This bug will be properly fixed in the next update to the Hmsc-HPC package, which is coming soon. Meanwhile, I would suggest to apply a post-hoc correction to the imported posterior samples just before you call
|
Hi! fitSepTF = importPosteriorFromHPC(m, chainList, samples, thin, transient)
for(cInd in 1:nChains){
if(m$nr==1){
for(i in 1:samples){
fitSepTF$postList[[cInd]][[i]]$Alpha = list(fitSepTF$postList[[cInd]][[i]]$Alpha[1,])
}
}
if(is.matrix(fitSepTF$postList[[cInd]][[1]]$Alpha)){
for(i in 1:samples){
x = fitSepTF$postList[[cInd]][[i]]$Alpha
fitSepTF$postList[[cInd]][[i]]$Alpha = lapply(seq_len(nrow(x)), function(i) x[i,])
}
}
}
fitSepTF Best regards |
Hi!
Thank you for your great work with this package. I am trying to make a spatial prediction with a model calibrated using the hpc implementation (engine = "HPC"), but I am getting an error which is not present when using the traditional approach "Error in if (alphapw[alpha[h], 1] > 0) { : absent value where TRUE/FALSE is necessary". Just wanted to know if you have tested the predict function in this situation or it is not still allowed within this approach.
Best regards,
Daniel Romera
The text was updated successfully, but these errors were encountered: