All Projects → brian-lau → Matlabstan

brian-lau / Matlabstan

Licence: bsd-3-clause
Matlab interface to Stan, a package for Bayesian inference

Programming Languages

matlab
3953 projects

Projects that are alternatives of or similar to Matlabstan

Projpred
Projection predictive variable selection
Stars: ✭ 76 (+28.81%)
Mutual labels:  statistics, bayesian, stan
stan4bart
Uses Stan sampler and math library to semiparametrically fit linear and multilevel models with additive Bayesian Additive Regression Tree (BART) components.
Stars: ✭ 13 (-77.97%)
Mutual labels:  bayesian, stan
stantargets
Reproducible Bayesian data analysis pipelines with targets and cmdstanr
Stars: ✭ 31 (-47.46%)
Mutual labels:  bayesian, stan
Bayesplot
bayesplot R package for plotting Bayesian models
Stars: ✭ 276 (+367.8%)
Mutual labels:  bayesian, stan
geostan
Bayesian spatial analysis
Stars: ✭ 40 (-32.2%)
Mutual labels:  bayesian, stan
bayesian
Bindings for Bayesian TidyModels
Stars: ✭ 33 (-44.07%)
Mutual labels:  bayesian, stan
BayesHMM
Full Bayesian Inference for Hidden Markov Models
Stars: ✭ 35 (-40.68%)
Mutual labels:  statistics, bayesian
Knitr case studies
Inference case studies in knitr
Stars: ✭ 110 (+86.44%)
Mutual labels:  statistics, stan
Bayadera
High-performance Bayesian Data Analysis on the GPU in Clojure
Stars: ✭ 342 (+479.66%)
Mutual labels:  statistics, bayesian
Orbit
A Python package for Bayesian forecasting with object-oriented design and probabilistic models under the hood.
Stars: ✭ 346 (+486.44%)
Mutual labels:  bayesian, stan
Pydlm
A python library for Bayesian time series modeling
Stars: ✭ 375 (+535.59%)
Mutual labels:  statistics, bayesian
Elfi
ELFI - Engine for Likelihood-Free Inference
Stars: ✭ 208 (+252.54%)
Mutual labels:  statistics, bayesian
Statistical Rethinking
An interactive online reading of McElreath's Statistical Rethinking
Stars: ✭ 123 (+108.47%)
Mutual labels:  statistics, bayesian
walker
Bayesian Generalized Linear Models with Time-Varying Coefficients
Stars: ✭ 38 (-35.59%)
Mutual labels:  bayesian, stan
Psycho.r
An R package for experimental psychologists
Stars: ✭ 113 (+91.53%)
Mutual labels:  statistics, bayesian
cmdstanr
CmdStanR: the R interface to CmdStan
Stars: ✭ 82 (+38.98%)
Mutual labels:  bayesian, stan
Stan
Stan development repository. The master branch contains the current release. The develop branch contains the latest stable development. See the Developer Process Wiki for details.
Stars: ✭ 2,177 (+3589.83%)
Mutual labels:  bayesian, stan
Bda py demos
Bayesian Data Analysis demos for Python
Stars: ✭ 781 (+1223.73%)
Mutual labels:  bayesian, stan
Rstanarm
rstanarm R package for Bayesian applied regression modeling
Stars: ✭ 285 (+383.05%)
Mutual labels:  bayesian, stan
Bda r demos
Bayesian Data Analysis demos for R
Stars: ✭ 409 (+593.22%)
Mutual labels:  bayesian, stan

MatlabStan

Stan Logo

A Matlab interface to Stan, a package for Bayesian inference.

For more information on Stan and its modeling language, see the Stan User's Guide and Reference Manual at http://mc-stan.org/.

Installation

Details can be found in the Getting started page of the wiki.

Example

The following is the classic 'eight schools' example from Section 5.5 of Gelman et al (2003). The output can be compared to that obtained using the Rstan and Pystan interfaces.

schools_code = {
   'data {'
   '    int<lower=0> J;         // number of schools '
   '    real y[J];              // estimated treatment effects'
   '    real<lower=0> sigma[J]; // s.e. of effect estimates '
   '}'
   'parameters {'
   '    real mu; '
   '    real<lower=0> tau;'
   '    real eta[J];'
   '}'
   'transformed parameters {'
   '    real theta[J];'
   '    for (j in 1:J)'
   '    theta[j] = mu + tau * eta[j];'
   '}'
   'model {'
   '    eta ~ normal(0, 1);'
   '    y ~ normal(theta, sigma);'
   '}'
};
  
schools_dat = struct('J',8,...
                     'y',[28 8 -3 7 -1 1 18 12],...
                     'sigma',[15 10 16 11 9 11 10 18]);

fit = stan('model_code',schools_code,'data',schools_dat);

print(fit);

eta = fit.extract('permuted',true).eta;
mean(eta)

A collection of Matlab-specific examples is available in the wiki.

Need help?

You may be able to find a solution in the wiki. Otherwise, open an issue.

Contributions

MatlabStan Copyright (c) 2017 Brian Lau [email protected], BSD-3

PSIS package Copyright (c) 2015 Aki Vehtari, GPL-3

Please feel free to fork and contribute!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].