This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ITEM: TIMESTEP | |
1000 | |
ITEM: NUMBER OF ATOMS | |
38 | |
ITEM: BOX BOUNDS | |
0 2.801 | |
0 1.001 | |
0 1.001 | |
ITEM: ATOMS | |
892916343 5 0.188849 0.248032 0.763223 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pystan | |
import numpy | |
import matplotlib.pyplot as plt | |
y = numpy.random.lognormal(mean = 0.7, sigma = 1.0, size = 5) | |
# Both of these models produce the same results | |
model_code = """ | |
data { | |
int<lower=1> N; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pystan | |
import numpy | |
import matplotlib.pyplot as plt | |
# We gotta only have a few datapoints. Too much data and the mistake isn't visible | |
y = numpy.random.lognormal(mean = 0.7, sigma = 1.0, size = 5) | |
# This model does not have the adjustment and so is incorrect | |
model_code = """ | |
data { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adjusted version of stan-generated cpp code for the calculate_r() function | |
inline Eigen::Matrix<var, Eigen::Dynamic,1> calculate_r( | |
const Eigen::Matrix<var, Eigen::Dynamic,1>& lambda, | |
const std::vector<std::vector<int> >& lambda_select, | |
const Eigen::Matrix<double, Eigen::Dynamic,Eigen::Dynamic>& M, | |
const std::vector<std::vector<std::vector<int> > >& ht_select, | |
const std::vector<std::vector<std::vector<std::vector<int> > > >& ht_gmap, | |
const std::vector<std::vector<int> >& Ht, | |
const Eigen::Matrix<double, Eigen::Dynamic,Eigen::Dynamic>& Z, | |
const std::vector<int>& Z_type, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bbales2@frog:~/stan3$ make test/unit/mcmc/hmc/integrators/impl_leapfrog2 | |
make: Warning: Archive 'test/libgtest.a' seems to have been created in deterministic mode. 'test/gtest.o' will always be updated. Please consider passing the U flag to ar to avoid the problem. | |
ar rv test/libgtest.a test/gtest.o | |
r - test/gtest.o | |
make: Warning: Archive 'test/libgtest.a' seems to have been created in deterministic mode. 'test/gtest.o' will always be updated. Please consider passing the U flag to ar to avoid the problem. | |
g++ -I src -isystem lib/stan_math/lib/eigen_3.2.9 -isystem lib/stan_math/lib/boost_1.62.0 -isystem lib/stan_math/lib/cvodes_2.9.0/include -isystem lib/stan_math/ -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DFUSION_MAX_VECTOR_SIZE=12 -DNO_FPRINTF_OUTPUT -pipe -c -O3 -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_HAS_PTHREAD=0 -isystem lib/stan_math/lib/gtest_1.7.0/include -isystem lib/stan_math/lib/gtest_1.7.0 src/test/unit/mcmc/hmc/integrators/impl_leapfrog2_test.cpp -o test/unit/mcmc/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bbales2@frog:~/smath$ make test/unit/math/mix/mat/prob/categorical_test | |
make: Warning: Archive 'test/libgtest.a' seems to have been created in deterministic mode. 'test/gtest.o' will always be updated. Please consider passing the U flag to ar to avoid the problem. | |
ar rv test/libgtest.a test/gtest.o | |
r - test/gtest.o | |
make: Warning: Archive 'test/libgtest.a' seems to have been created in deterministic mode. 'test/gtest.o' will always be updated. Please consider passing the U flag to ar to avoid the problem. | |
g++ -I . -isystem lib/eigen_3.2.9 -isystem lib/boost_1.62.0 -isystemlib/cvodes_2.9.0/include -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DNO_FPRINTF_OUTPUT -pipe -fPIC -c -O3 -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_HAS_PTHREAD=0 -isystem lib/gtest_1.7.0/include -isystem lib/gtest_1.7.0 test/unit/math/mix/mat/prob/categorical_test.cpp -o test/unit/math/mix/mat/prob/categorical_test.o | |
In file included from ./stan/math/fwd/core.hpp:4:0, | |
from ./stan/math/mix/mat/fun/t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#%% | |
import matplotlib.pyplot as plt | |
import pystan | |
import numpy | |
model_code = """ | |
data { | |
int<lower=1> N; // Number of single samples | |
vector[N] t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#%% | |
import matplotlib.pyplot as plt | |
import pystan | |
import numpy | |
model_code = """ | |
data { | |
int<lower=1> N; | |
vector[N] y; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Build with: clang++ -Wall -I . -isystem lib/eigen_3.3.3 -isystem lib/boost_1.64.0 -isystem lib/cvodes_2.9.0/include -std=c++1y -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -Wno-unused-function -Wno-uninitialized -DNO_FPRINTF_OUTPUT -pipe test2.cpp -O3 -o test2 lib/cvodes_2.9.0/lib/libsundials_nvecserial.a lib/cvodes_2.9.0/lib/libsundials_cvodes.a | |
#include <iostream> | |
#include "stan/math.hpp" | |
using namespace stan::math; | |
// This is a 1D diffusion PDE with a spatially varying diffusion coefficient. | |
// So if the domain is like this: | |
// x--o--x--o--x--o--x | |
// Then diffusion coefficients are defined at the xs and the state is at the o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(int i = 0; i < y.size(); i++) { | |
if(i > 0) | |
y_var[i - 1].d_ = 0.0; | |
y_var[i].d_ = 1.0; | |
vector<fvar<double> > dy_dt_var = f_(t, y_var, thetavar, x_, x_int_, msgs_); | |
if(i == 0) { | |
for(int j = 0; j < y.size(); j++) { | |
dy_dt(j) = dy_dt_var[j].val(); | |
} |
OlderNewer