StanMCMCChains.jl

This package is deprecated.
Author StanJulia
Popularity
1 Star
Updated Last
2 Years Ago
Started In
February 2019

StanMCMCChains

Build Status

Coverage Status

codecov.io

Introduction

This package converts the output produced by CmdStan.jl to a TuringLang/Chains object suitable for further processing by the MCMCChains package.

Usage

In the definition of the Stanmodel, request the output_format=:mcmcchains:

  stanmodel = Stanmodel(num_samples=1200, thin=2, name="bernoulli", 
    model=bernoullimodel, output_format=:mcmcchains);

The subsequent call to stan() will now return a MCMCChains.Chains object in chains as in the included Bernoulli example:

... (snipped)

  rc, chains, cnames = stan(stanmodel, observeddata, ProjDir, diagnostics=false,
    CmdStanDir=CMDSTAN_HOME);
    
... (snipped)

It is also possible to do this conversion after the call to stan():

  stanmodel = Stanmodel(num_samples=1200, thin=2, name="bernoulli", 
    model=bernoullimodel);

  rc, sims, cnames = stan(stanmodel, observeddata, ProjDir, diagnostics=false,
    CmdStanDir=CMDSTAN_HOME);
  
  chains = convert_a3d(sims, cnames, Val(:mcmcchains))

The bernoulli example also demonstrated how a Chains object can be saved and restored.

Further examples

Several more examples will be contained in StanMCMCChainsExamples.jl.

Used By Packages

No packages found.