Open renhamm opened 1 year ago
SpaceMix uses an "auto-tuning" approach to adaptively update the scale of the various tuning parameters to aim for an optimal acceptance ratio (that's why the acceptance rate plot for the nugget parameters looks kind of like a dampened sine wave converging on 45%). So, if you're not seeing good mixing behavior, there's not much you can tweak to change the acceptance rate. You could try one of a few alternative approaches:
Sorry I don't see an easy fix here!
When running my Spacemix Model, I don't think my chains are mixing correctly (no fuzzy caterpillar). In other packages, I have tried running the model longer, but that hasn't seem to improve anything. How can I go about optimizing the run.spacemix.analysis parameters to fix this? Below I have included my run code and various troubleshooting graphs
run.spacemix.analysis(n.fast.reps = 10, fast.MCMC.ngen = 1e5, fast.model.option = "source_and_target", long.model.option = "source_and_target", data.type = "sample.frequencies", sample.frequencies = allele.frequencies, mean.sample.sizes = mean.sample.sizes, counts = NULL, sample.sizes = NULL, sample.covariance= NULL, target.spatial.prior.scale=NULL, source.spatial.prior.scale=NULL, spatial.prior.X.coordinates = LonLat_sorted[,1], spatial.prior.Y.coordinates = LonLat_sorted[,2], round.earth = TRUE, long.run.initial.parameters=NULL, k = nrow(allele.frequencies), loci = ncol(allele.frequencies), ngen = 1e6, printfreq = 1e2, samplefreq = 1e3, mixing.diagn.freq = 50, savefreq = 1e5, directory=NULL, prefix = "G4t90_110")