Giter Club home page Giter Club logo

statastan's Introduction

Stan Logo

StataStan is the Stata interface to Stan.

Current status

StataStan comprises a command stan, a command windowsmonitor (which is required for stan if you are using Windows), and a developing set of template functions under stan_examples that write your data to specific models, so that Stata users can become familiar with Stan without having to write the model code immediately. We invite all Stata users to test it out and give us feedback, either here on Github, or by email to Robert Grant at [email protected].

As of September 2015, there are some basic issues to fix and then the commands will be submitted to the Stata repository SSC.

stan will fit a Stan model by Hamiltonian Monte Carlo. You can also ask for the posterior mode, which is found by optimization with the BFGS (or L-BFGS) algorithm. We intend to create more Stata commands, allowing CODA-style diagnostics and plotting after a model has been fitted and chains stored.

Getting Started

  1. Download and install CmdStan. Make sure you read the installation instructions and platform-specific appendix before installing. In particular, if you are using 32-bit Windows, you will need to add a file called 'local' to the 'make' folder before you run the make command, which should simply contain the text: BIT=32
  2. Download the .ado and.sthlp files and save them in your Stata personal ado folder (click here if you don't know where this is)
  3. Try out the different examples in the stan-example.do file, or under help stan
  4. Try your own data and model. The Stan modelling manual is essential reading for this! Options are listed in detail under help stan.
  5. You can pass your current data (the stuff you see when you type browse in Stata) into Stan, but also you can send matrices and global macros, by specifying their names or typing 'all' in the matrices and globals options. Unlike BUGS / JAGS, Stan just ignores data that your model doesn't use.

Testing

StataStan has been tested with CmdStan 2.6.2 and 2.7.0, Stata versions from 11.2 to 14.0, and Stata flavors IC and SE. We have not added multicore capacity yet, but it is on the to-do list and is easy to do (see Stan manual).

We have run it successfully on Linux, Mac and Windows, but we would like to hear from you if it works (or not) with Windows 10 or versions of Stata older then 11.0.

Other notes

  • Non-existent globals and matrices, and non-numeric globals, get quietly ignored
  • Missing values are removed casewise by default (but you can change this)
  • Users need to take care not to leave output file names as defaults if they have anything precious called output.csv or modes.csv etc. - these files will be overwritten

Licensing

StataStan is licensed under BSD.

statastan's People

Contributors

robertgrant avatar syclik avatar

Watchers

James Cloos avatar William Buchanan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.