Skip to content

Latest commit

 

History

History
72 lines (49 loc) · 2.02 KB

README.md

File metadata and controls

72 lines (49 loc) · 2.02 KB

StanOptimize.jl

Project Status Build Status

Important note

StanOptimize.jl v3 is a breaking change.

While in StanOptimize.jl v2 one could select Bfgs as optimization algorithm:

 om = OptimizeModel("bernoulli",  bernoulli_model;
  method=StanOptimize.Optimize(;method=StanOptimize.Bfgs()),
  #tmpdir = joinpath(@__DIR__, "tmp"));
  tmpdir = mktempdir());
rc = stan_optimize(om; data, init)

In StanOptimize.jl v3:

om = OptimizeModel("bernoulli",  bernoulli_model)
rc = stan_optimize(om; data, init, algorithm=:bfgs)

See ??OptimizeModel and ??stan_optimize.

Installation

This package is registered. Install with

pkg> add StanOptimize

You need a working cmdstan installation, the path of which you should specify in either CMDSTAN or JULIA_CMDSTAN_HOME, eg in your ~/.julia/config/startup.jl` have a line like

# CmdStan setup
ENV["CMDSTAN"] = expanduser("~/src/cmdstan-2.35.0/") # replace with your path

This package is derived from Tamas Papp's StanRun.jl package.

Usage

It is recommended that you start your Julia process with multiple worker processes to take advantage of parallel sampling, eg

julia -p auto

Otherwise, stan_sample will use a single process.

Use this package like this:

using StanOptimize

See the docstrings (in particular ?StanOptimize) for more.