úÎ!\şŒ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | }~€‚ƒ„…†‡ˆ‰Š‹Links of Markov chains(c) Dominik Schrempf 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableNone mcmcAn , or link of the Markov chain. For reasons of computational efficiency, each state is associated with the corresponding prior and likelihood.mcmc%The current state in the state space a.mcmcThe current prior.mcmcThe current likelihood.Monitor logarithmic values(c) Dominik Schrempf, 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableSafe mcmcPrint a log value.  Monitor parameters(c) Dominik Schrempf, 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableSafeSXCmcmc)Instruction about a parameter to monitor.mcmcName of parameter.mcmc>Instruction about how to extract the parameter from the state.mcmc$Monitor integral parameters such as Œ.mcmc&Monitor real float parameters such as - with eight decimal places (half precision).mcmc&Monitor real float parameters such as  with full precision.mcmc&Monitor real float parameters such as 4 with scientific notation and eight decimal places.mcmcName of monitor.mcmc-Instruction about which parameter to monitor.mcmcName of monitor.mcmc-Instruction about which parameter to monitor.mcmcName of monitor.mcmc-Instruction about which parameter to monitor.mcmcName of monitor.mcmc-Instruction about which parameter to monitor.Monitor parameters(c) Dominik Schrempf, 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableSafeSX7¡ mcmcëInstruction about a parameter to monitor via batch means. Usually, the monitored parameter is average over the batch size. However, arbitrary functions performing more complicated analyses on the states in the batch can be provided.‚XXX: Batch monitors are slow at the moment because the monitored parameter has to be extracted from the state for each iteration.mcmc"Name of batch monitored parameter.mcmc?Instruction about how to extract the batch mean from the trace.mcmc*Batch monitor integral parameters such as Œ=. Print the mean with eight decimal places (half precision).mcmc*Batch monitor integral parameters such as Œ&. Print the mean with full precision.mcmc,Batch monitor real float parameters such as - with eight decimal places (half precision).mcmc,Batch monitor real float parameters such as  with full precision.mcmc,Batch monitor real float parameters such as 4 with scientific notation and eight decimal places.mcmc6Batch monitor parameters with custom lens and builder.mcmcName of monitor.mcmc-Instruction about which parameter to monitor.mcmcName of monitor.mcmc-Instruction about which parameter to monitor.mcmcName of monitor.mcmc-Instruction about which parameter to monitor.mcmcName of monitor.mcmc-Instruction about which parameter to monitor.mcmcName of monitor.mcmc-Instruction about which parameter to monitor.mcmcName of monitor.mcmc-Instruction about which parameter to monitor.mcmc%Function to calculate the batch mean.mcmcCustom builder.  Print time related values(c) Dominik Schrempf, 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableSafe<` mcmc;Adapted from System.ProgressBar.renderDuration of package  ?https://hackage.haskell.org/package/terminal-progress-bar-0.4.1terminal-progressbar-0.4.1.  Moves and cycles(c) Dominik Schrempf 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableNoneSXlŠ!mcmc For each key k•, store the list of accepted (True) and rejected (False) proposals. For reasons of efficiency, the lists are stored in reverse order; latest first.$mcmc In brief, a $S is a list of moves. The state of the Markov chain will be logged only after each $7, and the iteration counter will be increased by one. Moves must have unique names", so that they can be identified.-‹s are replicated according to their weights and executed in random order. That is, they are not executed in the order they appear in the $. However, if a - has weight w, it is executed exactly w times per iteration.&mcmcTune the acceptance ratio of a -; see 4, or 5.)mcmc'Simple move without tuning information.¡In order to calculate the Metropolis-Hastings ratio, we need to know the probability (density) of jumping forth, and the probability (density) of jumping back.+mcmcjInstruction about randomly moving from the current state to a new state, given some source of randomness.,mcmc7The density of going from one state to another. Set to  for symmetric moves.-mcmcA -M is an instruction about how the Markov chain will traverse the state space aM. Essentially, it is a probability density conditioned on the current state.A -| may be tuneable in that it contains information about how to enlarge or shrink the step size to tune the acceptance ratio./mcmc3Name (no moves with the same name are allowed in a $).0mcmc"The weight determines how often a -0 is executed per iteration of the Markov chain.1mcmc'Simple move without tuning information.2mcmcTuning is disabled if set to .3mcmc Create a &O. The tuning function accepts a tuning parameter, and returns a corresponding )3. The larger the tuning parameter, the larger the -, and vice versa.4mcmcTune a - . Return  if -& is not tuneable. If the parameter dt is larger than 1.0, the - is enlarged, if 0<dt<1.0>, it is shrunk. Negative tuning parameters are not allowed.5mcmc,For a given acceptance ratio, auto tune the - . For now, a -U is enlarged when the acceptance ratio is above 0.44, and shrunk otherwise. Return  if - is not tuneable.GXXX: The desired acceptance ratio 0.44 is optimal for one-dimensional -Ds; one could also store the affected number of dimensions with the -O and tune towards an acceptance ratio accounting for the number of dimensions.6mcmc Create a $ from a list of -s.7mcmc Tune the - s in the $. Tuning has no effect on -s that cannot be tuned. See 5.8mcmcSummarize the - s in the $I. Also report acceptance ratios for the given number of last iterations.9mcmc$In the beginning there was the Word.8Initialize an empty storage of accepted/rejected values.:mcmcFor key k:, prepend an accepted (True) or rejected (False) proposal.;mcmcReset acceptance storage.<mcmcSAcceptance ratios averaged over the given number of last iterations. If less than n/ iterations are available, only those are used.!"#$%&'()*+,-./0123456789:;<-./012)*+,&'(345$%678!"#9:;<!Generic interface to create moves(c) Dominik Schrempf 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableNoneSX~›Bmcmc<Generic function to create moves for continuous parameters ().CmcmcFGeneric function to create symmetric moves for continuous parameters ().Dmcmc:Generic function to create moves for discrete parameters (Œ).EmcmcDGeneric function to create symmetric moves for discrete parameters (Œ).Bmcmc,Instruction about which parameter to change.mcmcProbability distributionmcmc/Forward operator, e.g. (+), so that x + dx = y.mcmc/Inverse operator, e.g.,(-), so that y - dx = x.Cmcmc,Instruction about which parameter to change.mcmcProbability distributionmcmc/Forward operator, e.g. (+), so that x + dx = y.Dmcmc,Instruction about which parameter to change.mcmcProbability distribution.mcmc/Forward operator, e.g. (+), so that x + dx = y.mcmc/Inverse operator, e.g.,(-), so that y - dx = x.Emcmc,Instruction about which parameter to change.mcmcProbability distribution.mcmc/Forward operator, e.g. (+), so that x + dx = y.BCDEBCDE$Scaling move with Gamma distribution(c) Dominik Schrempf 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableNoneSXˆDFmcmc3Multiplicative move with Gamma distributed density.Gmcmc¥Multiplicative move with Gamma distributed density. The scale of the Gamma distributions is set to (shape)^{-1}, so that the mean of the Gamma distribution is 1.0.FmcmcName.mcmcWeight.mcmc,Instruction about which parameter to change.mcmcShape.mcmcScale.mcmcEnable tuning.GmcmcName.mcmcWeight.mcmc,Instruction about which parameter to change.mcmcShape.mcmcEnable tuning.FGFG Normally distributed move(c) Dominik Schrempf 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableNoneSX—JHmcmc0Additive move with normally distributed density.ImcmcÅAdditive move with normally distributed density with mean zero. This move is very fast, because the Metropolis-Hastings ratio does not include calculation of the forwards and backwards densities.Jmcmc·Additive move with uniformly distributed density. This move is very fast, because the Metropolis-Hastings ratio does not include calculation of the forwards and backwards densities.HmcmcName.mcmcWeight.mcmc,Instruction about which parameter to change.mcmcMean.mcmcStandard deviation.mcmcEnable tuning.ImcmcName.mcmcWeight.mcmc,Instruction about which parameter to change.mcmcStandard deviation.mcmcEnable tuning.JmcmcName.mcmcWeight.mcmc,Instruction about which parameter to change.mcmcDelta.mcmcEnable tuning.HIJHIJ Shuffle a list(c) Dominik Schrempf 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableNoneœ'KmcmcShuffle a list.LmcmcShuffle a list n times.Mmcmcgrabble xs m n is O(m*n'), where n' = min n (length xs) . Choose n' elements from xs , without replacement, and that m times.KLMKLM Trace of a Markov chain(c) Dominik Schrempf 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableNone£3NmcmcA NO passes through a list of states with associated likelihoods which are called s. New Os are prepended, and the path of the Markov chain is stored in reversed order.OmcmcThe empty trace.Pmcmc Prepend an  to a N.Qmcmc&Get the most recent item of the trace.Rmcmc)Get the N most recent items of the trace.NOPQRNOPQR Monitor a Markov chain(c) Dominik Schrempf, 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableNone¼ZmcmcFMonitor to a file, but calculate batch means for the given batch size.‚XXX: Batch monitors are slow at the moment because the monitored parameter has to be extracted from the state for each iteration.[mcmcMonitor to a file.\mcmcMonitor to standard output.]mcmcA ]™ describes which part of the Markov chain should be logged and where. Further, they allow output of summary statistics per iteration in a flexible way._mcmc#Monitor writing to standard output.`mcmcMonitors writing to files.amcmc7Monitors calculating batch means and writing to files.bmcmcMonitor to standard output.cmcmcMonitor parameters to a file.dmcmc"Monitor parameters to a file, see Z.emcmc#Open the files associated with the ].fmcmc#Open the files associated with the ] in append mode.gmcmcPrint header line of ] (standard output only).hmcmcHExecute monitors; print status information to standard output and files.imcmc$Close the files associated with the ].bmcmc+Instructions about which parameters to log.mcmcLogging period.cmcmc$Name; used as part of the file name.mcmc+Instructions about which parameters to log.mcmcLogging period.dmcmc$Name; used as part of the file name.mcmcQInstructions about which parameters to log and how to calculate the batch means.mcmc Batch size.hmcmc Iteration.mcmcStarting state and time.mcmcTrace of Markov chain.mcmc-Total number of iterations; to calculate ETA.mcmc The monitor.Z[\]^_`abcdefghi]^_`a\b[cZdefghi What is an MCMC?(c) Dominik Schrempf 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableNoneİPjmcmcThe jV contains all information to run an MCMC chain. It is constructed using the function {.lmcmc0The name of the MCMC chain; used as file prefix.mmcmc The current E of the chain combines the current state and the current likelihood.nmcmc0The iteration is the number of completed cycles.omcmcThe N8 of the Markov chain in reverse order, the most recent  is at the head of the list.pmcmc For each -Š, store the list of accepted (True) and rejected (False) proposals; for reasons of efficiency, the list is also stored in reverse order.qmcmc6Number of burn in iterations; deactivate burn in with .rmcmcGAuto tuning period (only during burn in); deactivate auto tuning with .smcmcbNumber of normal iterations excluding burn in. Note that auto tuning only happens during burn in.tmcmcSStarting time and starting iteration of chain; used to calculate run time and ETA.umcmcSave the chain? Defaults to .vmcmcThe random number generator.wmcmc`The prior function. The un-normalized posterior is the product of the prior and the likelihood.xmcmceThe likelihood function. The un-normalized posterior is the product of the prior and the likelihood.ymcmc A set of - s form a $.zmcmcA ] observing the chain.{mcmcInitialize the j# of a Markov chain Monte Carlo run.|mcmc(Do not save the Markov chain at the end.{ mcmc.Name of the Markov chain; used as file prefix.mcmcThe prior function.mcmcThe likelihood function.mcmc A list of -Hs executed in forward order. The chain will be logged after each cycle.mcmcA ] observing the chain.mcmc%The initial state in the state space a.mcmc6Number of burn in iterations; deactivate burn in with .mcmcGAuto tuning period (only during burn in); deactivate auto tuning with .mcmcbNumber of normal iterations excluding burn in. Note that auto tuning only happens during burn in. mcmc`A source of randomness. For reproducible runs, make sure to use a generator with the same seed.jkoyutlmnpqrsvwxz{|jkoyutlmnpqrsvwxz{| Save the state of a Markov chain(c) Dominik Schrempf, 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableNoneç/}mcmcSave a j to file.SSaved information: - state - iteration - trace - acceptance ratios - generatorŸImportant information that cannot be saved and has to be provided again when a chain is restored: - prior function - likelihood function - cycle - monitor~mcmcLoad a j¬ from file. Important information that cannot be saved and has to be provided again when a chain is restored: - prior function - likelihood function - cycle - monitor}~}~ Mcmc helpers(c) Dominik Schrempf, 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableNoneñ9mcmc‰An Mcmc state transformer; usually fiddling around with this type is not required, but it is used by the different inference algorithms.‚mcmcAuto tune the - s in the $ of the chain. See 5.ƒmcmcPrint short summary of -s in $. See 8.„mcmcCSet the total number of iterations, the current time and open the ]s of the chain. See e.…mcmc Report what is going to be done.†mcmcPrint header line of ] (only standard output).‡mcmc Execute the ]s of the chain. See h.ˆmcmc Close the ]s of the chain. See i.‚ƒ„…†‡ˆ‚ƒ„…†‡ˆMetropolis-Hastings at its best(c) Dominik Schrempf 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableNoneøB‰mcmcHContinue a Markov chain for a given number of Metropolis-Hastings steps.ŠmcmcCRun a Markov chain for a given number of Metropolis-Hastings steps.‰mcmc/Additional number of Metropolis-Hastings steps.mcmc"Loaded status of the Markov chain.Šmcmc-Initial (or last) status of the Markov chain.‰ŠЉ7Markov chain Monte Carlo algorithms, batteries included(c) Dominik Schrempf 2020GPL-3.0-or-laterdominik.schrempf@gmail.comunstableportableNoneSXü ‹mcmcJBecause we need a probability of zero for likelihoods of really bad moves.e!"#$%&'()*+,-./0123456789:;<FGHIJNOPQRZ[\]^_`abcdefghijkoyutlmnpqrsvwxz{|}~‰Š‹‹Safeıß‘’“”•–—˜  !"#$%&''()*+,-./011234567889:;;<=>?@ABCDEFGHIJKLMNOPQRST U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j j k l m n o p q r s t u v v w x y z { | } ~  € ‚ ƒ „ … † ‡ˆ‰Š‹Œ‘’“”•–—˜–—™š›œ–—Ÿ ¡¢£¤¥¦!mcmc-0.1.3-FM4zXFsRvy6LDfjRnF2xXG Mcmc.ItemMcmc.Monitor.LogMcmc.Monitor.ParameterMcmc.Monitor.ParameterBatchMcmc.Monitor.Time Mcmc.MoveMcmc.Move.GenericMcmc.Move.ScaleMcmc.Move.SlideMcmc.Tools.Shuffle Mcmc.Trace Mcmc.Monitor Mcmc.Status Mcmc.Save Mcmc.McmcMcmc.MetropolisMcmc Paths_mcmcItemstateprior likelihood $fFromJSONLog $fToJSONLog$fFromJSONItem $fToJSONItem$fEqItem $fOrdItem $fShowItem $fReadItem renderLogMonitorParametermpNamempFunc monitorIntmonitorRealFloatmonitorRealFloatFmonitorRealFloatSMonitorParameterBatchmbpNamembpFuncmonitorBatchMeanIntmonitorBatchMeanIntFmonitorBatchMeanRealFloatmonitorBatchMeanRealFloatFmonitorBatchMeanRealFloatSmonitorBatchCustomrenderDuration AcceptancefromAcceptanceCycle fromCycleTunertParamtFunc MoveSimplemvSample mvDensityMovemvNamemvWeightmvSimplemvTunetunertuneautotunefromList autotuneCsummarizeCycleemptyApushAresetAacceptanceRatios $fOrdMove$fEqMove $fShowMove$fFromJSONAcceptance$fToJSONAcceptancemoveGenericContinuousmoveSymmetricGenericContinuousmoveGenericDiscretemoveSymmetricGenericDiscretescale scaleUnbiasedslideslideSymmetric slideUniformshuffleshuffleNgrabbleTrace singletonTpushTheadTtakeT$fFromJSONTrace $fToJSONTrace $fMonoidTrace$fSemigroupTrace $fShowTrace $fReadTrace $fEqTrace MonitorBatch MonitorFile MonitorStdOutMonitormStdOutmFilesmBatches monitorStdOut monitorFile monitorBatchmOpenmAppendmHeadermExecmCloseStatusnameitem iterationtrace acceptanceburnInIterationsautoTuningPeriod iterationsstartsave generatorpriorF likelihoodFcyclemonitorstatusnoSave saveStatus loadStatus$fFromJSONSave $fToJSONSave mcmcAutotunemcmcSummarizeCyclemcmcInit mcmcReportmcmcMonitorHeadermcmcMonitorExec mcmcClose mhContinuemhpzeroghc-prim GHC.TypesIntDoublebase GHC.MaybeNothingTrueversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName