Skip to content

Instantly share code, notes, and snippets.

@bbbales2
bbbales2 / constrain.hpp
Created March 5, 2021 22:47
Constrain model
// Code generated by stanc 4f8f010
#include <stan/model/model_header.hpp>
namespace constrain_model_namespace {
inline void validate_positive_index(const char* var_name, const char* expr,
int val) {
if (val < 1) {
std::stringstream msg;
--- Translating Stan model to C++ code ---
bin/stanc --o=lv.hpp lv.stan
--- Compiling, linking C++ code ---
clang++ -std=c++1y -D_REENTRANT -Wno-sign-compare -Wno-ignored-attributes -I stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DBOOST_DISABLE_ASSERTS -c -include-pch stan/src/stan/model/model_header.hpp.gch -x c++ -o lv.o lv.hpp
In file included from lv.hpp:1:
In file included from stan/src/stan/model/model_header.hpp:4:
In file included from /home/bbales2/tmp/cmdstan-ode-adjoint-v3/stan/lib/stan_math/stan/math.hpp:19:
In file included from /home/bbales2/tmp/cmdstan-ode-adjoint-v3/stan/lib/stan_math/stan/math/rev.hpp:11:
In file included from /home/bbales2/tmp/cmdstan-ode-adjoint-v3/stan/lib/stan_math/stan/math/rev/functor.hpp:20:
@bbbales2
bbbales2 / timeseries.py
Last active January 10, 2023 16:08
Timeseries model
from functools import reduce
from sortedcontainers import SortedSet, SortedDict
from typing import List, Callable, TypeVar, Any, Generic, Optional, Tuple, Dict
from collections import namedtuple, defaultdict
import haiku
import jax
import jax.scipy
import numpy.random