Commit 2af15f66 authored by Marco Inacio's avatar Marco Inacio
Browse files

Merge branch 'develop' into feature/zi_dist

No related merge requests found
Showing with 2745 additions and 2083 deletions
+2745 -2083
# Submitting an Issue
If you've clicked on the "guidelines for contributing" link from the GitHub issue tracker, you're in the right place. These guidelines will help the development team fix the issue.
Here are links to create issues for related Stan projects.
| Libraries | Interfaces | Other |
|-----------|------------|-------|
| [Math](https://github.com/stan-dev/math/issues/new) <br /> [Stan](https://github.com/stan-dev/stan/issues/new) | [CmdStan](https://github.com/stan-dev/cmdstan/issues/new) <br /> [RStan](https://github.com/stan-dev/rstan/issues/new) <br /> [PyStan](https://github.com/stan-dev/pystan/issues/new) | [shinyStan](https://github.com/stan-dev/shinystan/issues) |
#### Summary:
Please provide a short couple sentence summary.
#### Description:
Describe the issue as clearly as possible.
#### Reproducible Steps:
Please report steps to reproduce the issue. If it's not possible to reproduce, please include a description of how you discovered the issue.
If you have a reproducible example, please include it.
#### Current Output:
The current output. Knowing what is the current behavior is useful.
#### Expected Output:
Describe what you expect the output to be. Knowing the correct behavior is also very useful.
#### Additional Information:
Provide any additional information here.
#### Current Version:
v2.15.0
#### Submission Checklist
- [ ] Run unit tests: `./runTests.py test/unit`
- [ ] Run cpplint: `make cpplint`
- [ ] Declare copyright holder and open-source license: see below
#### Summary:
#### Intended Effect:
#### How to Verify:
#### Side Effects:
#### Documentation:
#### Reviewer Suggestions:
#### Copyright and Licensing
Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):
By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:
- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
# /
/demo
/models
/test
/*.dSYM
/bin
# tests
/test/*/*/*/*/*/*
/test/*/*/*/*/*
/test/*/*/*/*
/test/*/*/*
/test/*/*
/test/*
!/test/*/*/*/*/*/*/
!/test/*/*/*/*/*/
!/test/*/*/*/*/
!/test/*/*/*/
!/test/*/*/
!/test/*/
!/test/*/*/*/*/*/*.*
!/test/*/*/*/*/*.*
!/test/*/*/*/*.*
!/test/*/*/*.*
!/test/*/*.*
!/test/*.*
/test/**/*_generated_*_test.cpp
/test/**/*.xml
/test/dummy.cpp
/test/**/*.so
# other binary
*.o
*.o-*
*.exe
*.a
# /doc/
/doc/api
/doc/*.pdf
/doc/*.txt
# temporary latex files
*~
*.idx
*.ilg
*.ind
*.fdb_latexmk
*.fls
# temporary emacs files
*~
\#*#
# temporary vim files
.*.swp
# depedencies files
*.d
*.hpp.d.*
*.d.*
.Rproj.user
stan.Rproj
.kdev4/
stan.kdev4
.Rapp.history
# models:
/src/models/**
!/src/models/**.stan
!/src/models/**.R
!/src/models/**/makefile
# tests: compiled models
/src/test/test-models/*.cpp
/src/test/test-models/*/*.cpp
/src/test/test-models/*/*/*.cpp
/src/test/test-models/*/*/*/*.cpp
/src/test/test-models/*/*/*/*/*.cpp
!/src/test/test-models/**/*.stan
!/src/test/test-models/**/.gitignore
# tests: generated agrad tests
/src/test/unit-distribution/*/*/*/*_generated_test.cpp
# For the Mac
*.DS_Store
# local make include
make/local
/make/local
language: cpp
sudo: false
os:
- linux
- osx
compiler:
- clang
- gcc
env:
- RUN_TARGET=build TEST_TARGET=test-unit
# - RUN_TARGET=docs
script: make CC="$CXX" ${RUN_TARGET} ${TEST_TARGET}
branches:
only:
- develop
- master
#notifications:
# recipients:
# - mc.stanislaw@gmail.com
# email:
# on_success: change
# on_failure: always
before_script:
- echo "CC=$CXX" > make/local
matrix:
exclude: # only make docs once:
- compiler: clang
# env: RUN_TARGET=docs
script: make CC="$CXX" "${RUN_TARGET}" "${TEST_TARGET}"
fast_finish: true
env:
- TESTFOLDER=test/unit/math/memory
- TESTFOLDER=test/unit/math/prim/scal
- TESTFOLDER=test/unit/math/prim/arr
- TESTFOLDER=test/unit/math/prim/mat
- TESTFOLDER=test/unit/math/rev/scal
- TESTFOLDER=test/unit/math/rev/arr
- TESTFOLDER=test/unit/math/rev/mat
- TESTFOLDER=test/unit/math/fwd/scal
- TESTFOLDER=test/unit/math/fwd/arr
- TESTFOLDER=test/unit/math/fwd/mat
# - TESTFOLDER=test/unit/math/mix ## commenting this out due to segfault on travis
script: ./runTests.py -j2 $TESTFOLDER
<a href="http://mc-stan.org">
<img src="https://github.com/stan-dev/stan/blob/master/logos/stanlogo-main.png?raw=true" alt="Stan Logo"/>
</a>
The <b>Stan Math Library</b> is a C++, reverse-mode automatic differentiation library designed to be usable, extensive and extensible, efficient, scalable, stable, portable, and redistributable in order to facilitate the construction and utilization of algorithms that utilize derivatives.
<b>Stan</b> is a C++ and R package providing
Licensing
---------
The Stan Math Library is licensed under the [new BSD license](https://raw.githubusercontent.com/stan-dev/math/develop/licenses/stan-math-library-license.txt).
* full Bayesian inference using the No-U-Turn sampler (NUTS), a variant of Hamiltonian Monte Carlo (HMC),
* penalized maximum likelihood estimation (MLE) using L-BFGS optimization,
* a full first- and higher-order automatic differentiation library based on C++ template overloads, and
* a supporting fully-templated matrix, linear algebra, and probability special function library.
Required Libraries
------------------
Stan Math depends on three libraries:
Home Page
---------
Stan's home page, with links to everything you'll need to use Stan is:
- Boost (version 1.62.0): [Boost Home Page](http://www.boost.org)
- Eigen (version 3.2.9): [Eigen Home Page](http://eigen.tuxfamily.org/index.php?title=Main_Page)
- Cvodes (version 2.9.0): [Sundials Home Page](http://computation.llnl.gov/projects/sundials/sundials-software)
[http://mc-stan.org/](http://mc-stan.org/)
These are distributed under the `lib/` subdirectory. Only these three versions of the dependent libraries have been tested with Stan Math.
Interfaces
----------
There are separate repositories here on GitHub for interfaces:
* RStan (R interface)
* PyStan (Python interface)
* CmdStan (command-line/shell interface)
Installation
------------
The Stan Math Library is a header-only C++ library.
Source Repository
-----------------
Stan's source-code repository is hosted here on GitHub.
A simple hello world program using Stan Math is as follows:
Licensing
---------
The core Stan C++ code and CmdStan are licensed under new BSD. RStan and PyStan are licensed under GPLv3.
```
#include <stan/math.hpp>
#include <iostream>
int main() {
std::cout << "log normal(1 | 2, 3)="
<< stan::math::normal_log(1, 2, 3)
<< std::endl;
}
```
If this is in the file `/path/to/foo/foo.cpp`, then you can compile and run this with something like this, with the `path/to` business replaced with actual paths:
```
> cd /path/to/foo
> clang++ -I /path/to/stan-math -I /path/to/Eigen -I /path/to/boost foo.cpp -I /path/to/cvodes
> ./a.out
log normal(1 | 2, 3)=-2.07311
```
The `-I` includes provide paths pointing to the four necessary includes:
* Stan Math Library: path to source directory that contains `stan` as a subdirectory
* Eigen C++ Matrix Library: path to source directory that contains `Eigen` as a subdirectory
* Boost C++ Library: path to source directory that contains `boost` as a subdirectory
* Cvodes: path to source directory that contains `cvodes` as a subdirectory
Note that the paths should *not* include the final directories `stan`, `Eigen`, or `boost` on the paths. An example of a real instantiation:
```
clang++ -I ~/stan-dev/math -I ~/stan-dev/math/lib/eigen_3.2.9/ -I ~/stan-dev/math/lib/boost_1.62.0/ -I ~/stan-dev/math/lib/cvodes_2.9.0/include foo.cpp
```
The following directories all exist below the links given to `-I`: `~/stan-dev/math/stan` and `~/stan-dev/math/lib/eigen_3.2.9/Eigen` and `~stan-dev/math/lib/boost_1.62.0/boost` and `~stan-dev/math/lib/cvodes_2.9.0/include`.
Other Compilers
---------------
There's nothing special about `clang++` --- the `g++` compiler behaves the same way. You'll need to modify the commands for other compilers, which will need to be up-to-date enough to compile the Stan Math Library.
STAN VERSION 1.3.0 README
======================================================================
Stan is a C++ library for probability, optimization and sampling.
Stan License
----------------------------------------------------------------------
Stan is licensed under the new BSD license (3 clause):
$STAN/licenses/stan-license.txt
Dependencies
----------------------------------------------------------------------
The test, build, run-time dependencies and their licenses are in:
$STAN/licenses/dependencies.txt
Documentation
----------------------------------------------------------------------
Stan's user's guide and reference manual, including installation
instructions and a quick start guide, are in:
$STAN/doc/stan-reference.pdf
Stan's C++ API guide is in:
$STAN/doc/api/html/index.html
Building Stan
----------------------------------------------------------------------
Stan uses GNU make for builds, with top-level makefile:
$STAN/makefile
The make targets for building and testing are displayed by:
> cd $STAN
> make help
Demos
-------------------
For examples of Stan models, including implementations of the BUGS demos:
$STAN/src/models
This diff is collapsed.
This diff is collapsed.
#!/bin/bash
# from http://stackoverflow.com/questions/1404796/how-to-get-the-latest-tag-name-in-current-branch-in-git
PreviousAndCurrentGitTag=`git describe --tags \`git rev-list --tags --abbrev=0 --max-count=2\` --abbrev=0`
PreviousGitTag=`echo $PreviousAndCurrentGitTag | cut -f 2 -d ' '`
CurrentGitTag=`echo $PreviousAndCurrentGitTag | cut -f 1 -d ' '`
OLDVERSION=$1
if [ -z "$OLDVERSION" ]; then
OLDVERSION=$PreviousGitTag
fi
NEWVERSION=$2
if [ -z "$NEWVERSION" ]; then
NEWVERSION=$CurrentGitTag
fi
BRANCH=`git branch | grep ^*`
if [ "* master" != "$BRANCH" ]; then
echo 'You must be on the master branch to run this script'
exit 3
fi
if ! git diff-index --quiet HEAD --; then
echo "You have uncommited changes that need to be committed or stashed before running this script; aborting"
exit 4
fi
STAN_HOME=`pwd`
cd $STAN_HOME/src/docs/stan-reference
bash diff.sh $OLDVERSION $NEWVERSION
if [ $? != 0 ]; then
echo "Diffing failed, aborting"
git reset --hard HEAD
git checkout master
exit 5
fi
cd $STAN_HOME
if [ -e ${STAN_HOME}/src/docs/stan-reference/diff_patches/${OLDVERSION}_${NEWVERSION}.patch ]; then
git apply ${STAN_HOME}/src/docs/stan-reference/diff_patches/${OLDVERSION}_${NEWVERSION}.patch
if [ $? != 0 ]; then
echo "Applying patch failed, aborting"
git reset --hard HEAD
git checkout master
exit 6
fi
fi
make clean-all && make manual
if [ $? != 0 ]; then
echo "Creating diffed manual failed, aborting"
git reset --hard HEAD
git checkout master
exit 7
fi
git reset --hard HEAD
git checkout master
echo "Manual diffed successfully (in theory); you can upload stan-reference-*.pdf"
exit 0
File deleted
/**
* @namespace Eigen
* (Expert) Numerical traits for algorithmic differentiation variables.
*/
/**
* @namespace Eigen::internal
* (Expert) Product traits for algorithmic differentiation variables.
*/
/**
* @namespace Eigen
* (Expert) Numerical traits for algorithmic differentiation variables.
*/
/**
* @namespace Eigen::internal
* (Expert) Product traits for algorithmic differentiation variables.
*/
/**
* @namespace boost
* Reimplementing boost functionality.
*/
/**
* @namespace boost::math
* Reimplmeneting boost functionality for <code>stan::agrad::var</code> and
* and bugs in classification of integer types.
*
* FIXME: remove when BOOST fixes isfinite(). See ticket #6517. (Boost 1.48.0)
* https://svn.boost.org/trac/boost/ticket/6517
*/
/**
* @namespace boost
* Reimplementing boost functionality.
*/
/**
* @namespace boost::math
* Reimplmeneting boost functionality for <code>stan::math::var</code> and
* and bugs in classification of integer types.
*
* FIXME: remove when BOOST fixes isfinite(). See ticket #6517. (Boost 1.48.0)
* https://svn.boost.org/trac/boost/ticket/6517
*/
......@@ -5,7 +5,7 @@
[ <a href="http://mc-stan.org/">Stan Home Page</a> ]
</span>
<span style="float:right; margin=0 1em 0 1em;">
<i>&copy; 2011&ndash;2014,
<i>&copy; 2011&ndash;2016,
Stan Development Team.
&nbsp;&nbsp;&nbsp;&nbsp;
</i>
......
This diff is collapsed.
/**
* @mainpage
*
* This is the API documentation for the Stan Math Library.
*
* <h3>More Information</h3>
*
* <div style="width:30em;">
* <p>For more information, including pointers to narrative
* documentation, please visit Stan's home page at:
* </div>
*
* <a style="font-family: 'lucida console', courier; font-size:1.15em; font-weight:bold; margin:2em 1em 2em
1em;" href="http://mc-stan.org/">http://mc-stan.org/</a>
*
*/
/**
* @namespace stan::math
* Matrices and templated mathematical functions.
* Templated probability distributions. All paramaterizations
* are based on Bayesian Data Analysis.
* Function gradients via reverse-mode automatic differentiation.
*/
doxygen/stanlogo-main.png

8.1 KB

File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment