├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── setup.sh └── test.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | *~ 35 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "stan"] 2 | path = stan 3 | url = https://github.com/stan-dev/stan 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2021, Daniel Lee 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Reimplementation of Stan algorithms 2 | 3 | This project is a collaborative effort to rewrite the Stan algorithms. 4 | 5 | 6 | The goals we have are to: 7 | 8 | 1. tbd 9 | 2. tbd 10 | 11 | 12 | If you'd like to join, please find us on Discourse (FIXME: more details). 13 | 14 | We are reimplementing the algorithms in [Stan v2.28.2](https://github.com/stan-dev/stan/tree/v2.28.2) (`4383f846f`). Although the algorithms code does not change very quickly, it's good to have a target version we are implementing against. 15 | 16 | 17 | ## Setup 18 | 19 | ``` 20 | ./setup.sh 21 | ``` 22 | 23 | There's a script for one-time setup. This will: 24 | 25 | 1. Update the git submodules for Stan. 26 | 2. Download the appropriate version of `stan/bin/stanc` that is compatible with this version of Stan. 27 | 28 | Once this script is run, the tests can run. 29 | 30 | ### Git Submodule for Stan v2.28.2 31 | 32 | The `stan` source code is included as a git submodule located in the `stan/` folder. 33 | 34 | 35 | ## Testing 36 | 37 | ``` 38 | ./test.sh 39 | ``` 40 | 41 | Currently this runs the services tests in the Stan submodule. 42 | 43 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | ## 1. Update submodules 5 | 6 | git submodule update --init --recursive 7 | 8 | 9 | ## 2. Download appropriate stanc3 v2.18.1 10 | mkdir -p stan/bin 11 | 12 | if [[ "$OSTYPE" == "linux-gnu"* ]]; then 13 | OS_TAG=linux 14 | elif [[ "$OSTYPE" == "darwin"* ]]; then 15 | OS_TAG=mac 16 | else 17 | echo "Not downloading stan/bin/stanc for OS type: $OSTYPE" 18 | error 1 19 | fi 20 | 21 | echo "Downloading stanc3 version: v2.18.1" 22 | 23 | curl -L "https://github.com/stan-dev/stanc3/releases/download/v2.28.1/${OS_TAG}-stanc" -o stan/bin/stanc --retry 5 --retry-delay 10 24 | 25 | chmod +x stan/bin/stanc 26 | -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | pushd stan 5 | 6 | ./runTests.py src/test/unit/services 7 | 8 | popd 9 | --------------------------------------------------------------------------------