Files
COGMOD-HWI/HW3/Q6/Q6.ipynb
T

766 lines
570 KiB
Plaintext
Raw Normal View History

2025-03-23 16:54:36 -04:00
{
"cells": [
{
"cell_type": "code",
2025-04-14 22:31:56 -04:00
"execution_count": 1,
2025-03-23 16:54:36 -04:00
"metadata": {},
2025-04-14 22:31:56 -04:00
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>rt</th>\n",
" <th>choice</th>\n",
" <th>condition</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>0.477</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>0.600</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>0.500</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>0.416</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>0.435</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" rt choice condition\n",
"0 0.477 1.0 1.0\n",
"1 0.600 1.0 1.0\n",
"2 0.500 0.0 1.0\n",
"3 0.416 1.0 1.0\n",
"4 0.435 1.0 1.0"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
2025-03-23 16:54:36 -04:00
"source": [
"# DATA\n",
"\n",
"import pandas as pd\n",
"import stan\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"import arviz as az\n",
"\n",
"# stan problems\n",
"import nest_asyncio\n",
"nest_asyncio.apply()\n",
"\n",
"data = pd.read_csv(\"sample_response_times.csv\", sep=';')\n",
"\n",
"data.head()"
]
},
{
"cell_type": "code",
2025-04-14 22:31:56 -04:00
"execution_count": 2,
2025-03-23 16:54:36 -04:00
"metadata": {},
"outputs": [],
"source": [
"stan_code = \"\"\"\n",
"data {\n",
" int<lower=1> N;\n",
" array[N] real<lower=0> y;\n",
" array[N] int<lower=1, upper=2> condition;\n",
" array[N] int<lower=0, upper=1> choice;\n",
"}\n",
"\n",
"// EVERYTHING ABOVE 0!!!! EVERYTHING!!!!!!\n",
"parameters {\n",
" real<lower=0> v_easy; // Drift rate for easy condition\n",
" real<lower=0> v_hard; // Drift rate for hard condition\n",
" real<lower=0> a; // Boundary separation\n",
" real<lower=0, upper=1> beta; // Starting point bias\n",
" real<lower=0, upper=min(y)> tau; // Non-decision time with upper bound\n",
"}\n",
"\n",
"model {\n",
" // Priors (updated)\n",
" v_easy ~ gamma(1, 2);\n",
" v_hard ~ gamma(1, 2);\n",
" a ~ gamma(2, 0.5);\n",
" beta ~ beta(2, 2);\n",
" tau ~ gamma(1, 10);\n",
"\n",
" // Likelihood (unchanged)\n",
" for (n in 1:N) {\n",
" if (condition[n] == 1) {\n",
" if (choice[n] == 1) {\n",
" y[n] ~ wiener(a, tau, beta, v_easy);\n",
" } else {\n",
" y[n] ~ wiener(a, tau, 1 - beta, -v_easy);\n",
" }\n",
" }\n",
" if (condition[n] == 2) {\n",
" if (choice[n] == 1) {\n",
" y[n] ~ wiener(a, tau, beta, v_hard);\n",
" } else {\n",
" y[n] ~ wiener(a, tau, 1 - beta, -v_hard);\n",
" }\n",
" }\n",
" }\n",
"}\n",
"\"\"\""
]
},
{
"cell_type": "code",
2025-04-14 22:31:56 -04:00
"execution_count": 3,
2025-03-23 16:54:36 -04:00
"metadata": {},
2025-04-14 22:31:56 -04:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Building..."
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"In file included from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/tbb_profiling.h:123,\n",
" from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/task.h:36,\n",
" from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/task_arena.h:23,\n",
" from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math/prim/core/init_threadpool_tbb.hpp:18,\n",
" from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math/prim/core.hpp:4,\n",
" from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math/rev/core/Eigen_NumTraits.hpp:5,\n",
" from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math/rev/core/typedefs.hpp:7,\n",
" from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math/rev/core/chainable_object.hpp:6,\n",
" from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math/rev/core.hpp:10,\n",
" from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math/rev.hpp:10,\n",
" from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math.hpp:19,\n",
" from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/model/model_header.hpp:4,\n",
" from /home/ion606/.cache/httpstan/4.13.0/models/4otogou3/model_4otogou3.cpp:2:\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:422:24: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]\n",
" 422 | constexpr atomic<T>(const atomic<T>& rhs): internal::atomic_impl<T>(rhs) {}\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:422:24: note: remove the < >\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:454:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 454 | __TBB_DECL_ATOMIC(__TBB_LONG_LONG)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: note: remove the < >\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:454:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 454 | __TBB_DECL_ATOMIC(__TBB_LONG_LONG)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:455:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 455 | __TBB_DECL_ATOMIC(unsigned __TBB_LONG_LONG)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: note: remove the < >\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:455:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 455 | __TBB_DECL_ATOMIC(unsigned __TBB_LONG_LONG)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:459:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 459 | __TBB_DECL_ATOMIC(long)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: note: remove the < >\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:459:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 459 | __TBB_DECL_ATOMIC(long)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:460:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 460 | __TBB_DECL_ATOMIC(unsigned long)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: note: remove the < >\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:460:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 460 | __TBB_DECL_ATOMIC(unsigned long)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:491:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 491 | __TBB_DECL_ATOMIC(unsigned)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: note: remove the < >\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:491:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 491 | __TBB_DECL_ATOMIC(unsigned)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:492:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 492 | __TBB_DECL_ATOMIC(int)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: note: remove the < >\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:492:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 492 | __TBB_DECL_ATOMIC(int)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:495:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 495 | __TBB_DECL_ATOMIC(unsigned short)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: note: remove the < >\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:495:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 495 | __TBB_DECL_ATOMIC(unsigned short)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:496:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 496 | __TBB_DECL_ATOMIC(short)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: note: remove the < >\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:496:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 496 | __TBB_DECL_ATOMIC(short)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:497:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 497 | __TBB_DECL_ATOMIC(char)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: note: remove the < >\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:497:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 497 | __TBB_DECL_ATOMIC(char)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:498:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 498 | __TBB_DECL_ATOMIC(signed char)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: note: remove the < >\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:498:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 498 | __TBB_DECL_ATOMIC(signed char)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:499:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 499 | __TBB_DECL_ATOMIC(unsigned char)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: note: remove the < >\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:499:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 499 | __TBB_DECL_ATOMIC(unsigned char)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:502:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 502 | __TBB_DECL_ATOMIC(wchar_t)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:437:32: note: remove the < >\n",
" 437 | constexpr atomic<T>(const atomic<T>& rhs): \\\n",
" | ^\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:502:1: note: in expansion of macro __TBB_DECL_ATOMIC\n",
" 502 | __TBB_DECL_ATOMIC(wchar_t)\n",
" | ^~~~~~~~~~~~~~~~~\n",
"In file included from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math/prim/prob/normal_ccdf_log.hpp:5,\n",
" from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math/prim/prob.hpp:243,\n",
" from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math/prim.hpp:16,\n",
" from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math/rev.hpp:16:\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math/prim/prob/normal_lccdf.hpp: In function stan::return_type_t<T_x, T_sigma, T_l> stan::math::normal_lccdf(const T_y&, const T_loc&, const T_scale&):\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math/prim/prob/normal_lccdf.hpp:68: note: -Wmisleading-indentation is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers\n",
" 68 | } else if (scaled_diff > 8.25 * INV_SQRT_TWO) {\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math/prim/prob/normal_lccdf.hpp:68: note: adding -flarge-source-files will allow for more column-tracking support, at the expense of compilation time and memory\n",
"In file included from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/model/model_header.hpp:11:\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/model/model_base_crtp.hpp: At global scope:\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/model/model_base_crtp.hpp:159: warning: stan::math::var stan::model::model_base_crtp<M>::log_prob(std::vector<stan::math::var_value<double>, std::allocator<stan::math::var_value<double> > >&, std::vector<int>&, std::ostream*) const [with M = model_4otogou3_namespace::model_4otogou3; stan::math::var = stan::math::var_value<double>; std::ostream = std::basic_ostream<char>] was hidden [-Woverloaded-virtual=]\n",
" 159 | inline math::var log_prob(std::vector<math::var>& theta,\n",
"/home/ion606/.cache/httpstan/4.13.0/models/4otogou3/model_4otogou3.cpp:590: note: by model_4otogou3_namespace::model_4otogou3::log_prob\n",
" 590 | log_prob(std::vector<T_>& params_r, std::vector<int>& params_i,\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/model/model_base_crtp.hpp:154: warning: double stan::model::model_base_crtp<M>::log_prob(std::vector<double, std::allocator<double> >&, std::vector<int>&, std::ostream*) const [with M = model_4otogou3_namespace::model_4otogou3; std::ostream = std::basic_ostream<char>] was hidden [-Woverloaded-virtual=]\n",
" 154 | inline double log_prob(std::vector<double>& theta, std::vector<int>& theta_i,\n",
"/home/ion606/.cache/httpstan/4.13.0/models/4otogou3/model_4otogou3.cpp:590: note: by model_4otogou3_namespace::model_4otogou3::log_prob\n",
" 590 | log_prob(std::vector<T_>& params_r, std::vector<int>& params_i,\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/model/model_base_crtp.hpp:96: warning: stan::math::var stan::model::model_base_crtp<M>::log_prob(Eigen::Matrix<stan::math::var_value<double>, -1, 1>&, std::ostream*) const [with M = model_4otogou3_namespace::model_4otogou3; stan::math::var = stan::math::var_value<double>; std::ostream = std::basic_ostream<char>] was hidden [-Woverloaded-virtual=]\n",
" 96 | inline math::var log_prob(Eigen::Matrix<math::var, -1, 1>& theta,\n",
"/home/ion606/.cache/httpstan/4.13.0/models/4otogou3/model_4otogou3.cpp:590: note: by model_4otogou3_namespace::model_4otogou3::log_prob\n",
" 590 | log_prob(std::vector<T_>& params_r, std::vector<int>& params_i,\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/model/model_base_crtp.hpp:91: warning: double stan::model::model_base_crtp<M>::log_prob(Eigen::VectorXd&, std::ostream*) const [with M = model_4otogou3_namespace::model_4otogou3; Eigen::VectorXd = Eigen::Matrix<double, -1, 1>; std::ostream = std::basic_ostream<char>] was hidden [-Woverloaded-virtual=]\n",
" 91 | inline double log_prob(Eigen::VectorXd& theta,\n",
"/home/ion606/.cache/httpstan/4.13.0/models/4otogou3/model_4otogou3.cpp:590: note: by model_4otogou3_namespace::model_4otogou3::log_prob\n",
" 590 | log_prob(std::vector<T_>& params_r, std::vector<int>& params_i,\n",
"In file included from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/concurrent_unordered_map.h:26,\n",
" from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math/rev/core/profiling.hpp:10,\n",
" from /home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/stan/math/rev/core.hpp:53:\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/internal/_concurrent_unordered_impl.h: In instantiation of void tbb::interface5::internal::concurrent_unordered_base<Traits>::internal_init() [with Traits = tbb::interface5::concurrent_unordered_map_traits<std::pair<std::basic_string<char>, std::thread::id>, stan::math::profile_info, tbb::interface5::internal::hash_compare<std::pair<std::basic_string<char>, std::thread::id>, stan::math::internal::hash_profile_key, stan::math::internal::equal_profile_key>, tbb::tbb_allocator<std::pair<const std::pair<std::basic_string<char>, std::thread::id>, stan::math::profile_info> >, false>]:\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/internal/_concurrent_unordered_impl.h:773:9: required from tbb::interface5::internal::concurrent_unordered_base<Traits>::concurrent_unordered_base(size_type, const hash_compare&, const allocator_type&) [with Traits = tbb::interface5::concurrent_unordered_map_traits<std::pair<std::basic_string<char>, std::thread::id>, stan::math::profile_info, tbb::interface5::internal::hash_compare<std::pair<std::basic_string<char>, std::thread::id>, stan::math::internal::hash_profile_key, stan::math::internal::equal_profile_key>, tbb::tbb_allocator<std::pair<const std::pair<std::basic_string<char>, std::thread::id>, stan::math::profile_info> >, false>; size_type = long unsigned int; hash_compare = tbb::interface5::internal::hash_compare<std::pair<std::basic_string<char>, std::thread::id>, stan::math::internal::hash_profile_key, stan::math::internal::equal_profile_key>; allocator_type = std::allocator_traits<tbb::tbb_allocator<std::pair<const std::pair<std::basic_string<char>, std::thread::id>, stan::math::profile_info> > >::rebind_alloc<std::pair<const std::pair<std::basic_string<char>, std::thread::id>, stan::math::profile_info> >]\n",
" 773 | internal_init();\n",
" | ^~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/concurrent_unordered_map.h:112:68: required from tbb::interface5::concurrent_unordered_map<Key, T, Hasher, Key_equality, Allocator>::concurrent_unordered_map(size_type, const hasher&, const key_equal&, const allocator_type&) [with Key = std::pair<std::basic_string<char>, std::thread::id>; T = stan::math::profile_info; Hasher = stan::math::internal::hash_profile_key; Key_equality = stan::math::internal::equal_profile_key; Allocator = tbb::tbb_allocator<std::pair<const std::pair<std::basic_string<char>, std::thread::id>, stan::math::profile_info> >; size_type = long unsigned int; hasher = stan::math::internal::hash_profile_key; key_equal = stan::math::internal::equal_profile_key; allocator_type = std::allocator_traits<tbb::tbb_allocator<std::pair<const std::pair<std::basic_string<char>, std::thread::id>, stan::math::profile_info> > >::rebind_alloc<std::pair<const std::pair<std::basic_string<char>, std::thread::id>, stan::math::profile_info> >]\n",
" 112 | : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)\n",
" | ^\n",
"/home/ion606/.cache/httpstan/4.13.0/models/4otogou3/model_4otogou3.cpp:6:0: required from here\n",
" 6 | stan::math::profile_map profiles__;\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/internal/_concurrent_unordered_impl.h:1345:15: warning: void* memset(void*, int, size_t) clearing an object of type struct tbb::atomic<tbb::interface5::internal::flist_iterator<tbb::interface5::internal::split_ordered_list<std::pair<const std::pair<std::basic_string<char>, std::thread::id>, stan::math::profile_info>, tbb::tbb_allocator<std::pair<const std::pair<std::basic_string<char>, std::thread::id>, stan::math::profile_info> > >, std::pair<const std::pair<std::basic_string<char>, std::thread::id>, stan::math::profile_info> >*> with no trivial copy-assignment; use assignment or value-initialization instead [-Wclass-memaccess]\n",
" 1345 | memset(my_buckets, 0, sizeof(my_buckets));\n",
" | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n",
"/home/ion606/Desktop/Homework/COGMOD/HW3/COGMOD-HWI/HW3/.venv/lib/python3.12/site-packages/httpstan/include/tbb/atomic.h:507:1: note: struct tbb::atomic<tbb::interface5::internal::flist_iterator<tbb::interface5::internal::split_ordered_list<std::pair<const std::pair<std::basic_string<char>, std::thread::id>, stan::math::profile_info>, tbb::tbb_allocator<std::pair<const std::pair<std::basic_string<char>, std::thread::id>, stan::math::profile_info> > >, std::pair<const std::pair<std::basic_string<char>, std::thread::id>, stan::math::profile_info> >*> declared here\n",
" 507 | atomic<T*>: internal::atomic_impl_with_arithmetic<T*,ptrdiff_t,T> {\n",
" | ^~~~~~~~~~\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n",
"Building: 30.6s, done.Sampling: 0%\n",
"Sampling: 0% (1/12000)\n",
"Sampling: 0% (2/12000)\n",
"Sampling: 0% (3/12000)\n",
"Sampling: 0% (4/12000)\n",
"Sampling: 1% (103/12000)\n",
"Sampling: 2% (202/12000)\n",
"Sampling: 3% (301/12000)\n",
"Sampling: 3% (401/12000)\n",
"Sampling: 4% (500/12000)\n",
"Sampling: 5% (600/12000)\n",
"Sampling: 6% (700/12000)\n",
"Sampling: 7% (800/12000)\n",
"Sampling: 8% (900/12000)\n",
"Sampling: 8% (1000/12000)\n",
"Sampling: 9% (1100/12000)\n",
"Sampling: 10% (1200/12000)\n",
"Sampling: 11% (1300/12000)\n",
"Sampling: 12% (1400/12000)\n",
"Sampling: 12% (1500/12000)\n",
"Sampling: 13% (1600/12000)\n",
"Sampling: 14% (1700/12000)\n",
"Sampling: 15% (1800/12000)\n",
"Sampling: 16% (1900/12000)\n",
"Sampling: 17% (2000/12000)\n",
"Sampling: 18% (2100/12000)\n",
"Sampling: 18% (2200/12000)\n",
"Sampling: 19% (2300/12000)\n",
"Sampling: 20% (2400/12000)\n",
"Sampling: 21% (2500/12000)\n",
"Sampling: 22% (2600/12000)\n",
"Sampling: 22% (2700/12000)\n",
"Sampling: 23% (2800/12000)\n",
"Sampling: 24% (2900/12000)\n",
"Sampling: 25% (3000/12000)\n",
"Sampling: 28% (3300/12000)\n",
"Sampling: 31% (3700/12000)\n",
"Sampling: 35% (4200/12000)\n",
"Sampling: 41% (4900/12000)\n",
"Sampling: 56% (6700/12000)\n",
"Sampling: 72% (8600/12000)\n",
"Sampling: 86% (10300/12000)\n",
"Sampling: 95% (11400/12000)\n",
"Sampling: 98% (11800/12000)\n",
"Sampling: 100% (12000/12000)\n",
"Sampling: 100% (12000/12000), done.\n",
"Messages received during sampling:\n",
" Gradient evaluation took 0.000763 seconds\n",
" 1000 transitions using 10 leapfrog steps per transition would take 7.63 seconds.\n",
" Adjust your expectations accordingly!\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 21, column 4 to column 25)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 21, column 4 to column 25)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 22, column 4 to column 22)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 22, column 4 to column 22)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 20, column 4 to column 25)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 20, column 4 to column 25)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Gradient evaluation took 0.000896 seconds\n",
" 1000 transitions using 10 leapfrog steps per transition would take 8.96 seconds.\n",
" Adjust your expectations accordingly!\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 22, column 4 to column 22)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 22, column 4 to column 22)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 21, column 4 to column 25)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 22, column 4 to column 22)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Gradient evaluation took 0.001289 seconds\n",
" 1000 transitions using 10 leapfrog steps per transition would take 12.89 seconds.\n",
" Adjust your expectations accordingly!\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 22, column 4 to column 22)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 22, column 4 to column 22)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: wiener_lpdf: Random variable = 0.411, but must be greater than nondecision time = 0.411 (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 30, column 16 to column 52)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 20, column 4 to column 25)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 22, column 4 to column 22)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Gradient evaluation took 0.002967 seconds\n",
" 1000 transitions using 10 leapfrog steps per transition would take 29.67 seconds.\n",
" Adjust your expectations accordingly!\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 22, column 4 to column 22)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 22, column 4 to column 22)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 22, column 4 to column 22)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n",
" Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:\n",
" Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/tmp/httpstan_t0dh1xl0/model_4otogou3.stan', line 20, column 4 to column 25)\n",
" If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,\n",
" but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"<stan.Fit>\n",
"Parameters:\n",
" v_easy: ()\n",
" v_hard: ()\n",
" a: ()\n",
" beta: ()\n",
" tau: ()\n",
"Draws: 8000\n"
]
}
],
2025-03-23 16:54:36 -04:00
"source": [
"stan_data = {\n",
" \"N\": len(data),\n",
" \"y\": data[\"rt\"].astype(float).values,\n",
" \"condition\": data[\"condition\"].astype(int).values,\n",
" \"choice\": data[\"choice\"].astype(int).values\n",
"}\n",
"\n",
"model = stan.build(program_code=stan_code, data=stan_data)\n",
"fit = model.sample(num_chains=4, num_samples=2000)\n",
"\n",
"# Diagnostics\n",
"print(fit) # R-hat and EES"
]
},
{
"cell_type": "code",
2025-04-14 22:31:56 -04:00
"execution_count": 4,
2025-03-23 16:54:36 -04:00
"metadata": {},
"outputs": [
{
"data": {
2025-04-14 22:31:56 -04:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA8IAAANACAYAAADgk9R+AAAA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l878gyX35ojk39Od77su381LWbyajKM/mUUlJSUlJSzksGCvozfQgpKSlPMWkhnJLyNPHOv9vNncdrVHIab7lqA2+4fAPXbx9EV0/v7sqyRP+aL+Efv3oTb3/BON8/ssLHbzvBB752gM/cPcUfv/0Krt8x+HQ+jZSUlJSUlPOajKqQ19ON5pSU8520EE5JeYowHJ8vPzjLT1+7BVWRecuV4/zoCzfx5is3kNUe+xesqsi89tJRXnvpKLcfW+H9X9nPT3/yHt51/VZ+702XpN3hlJSUlJSUJwHHD6gb7jN9GCkpKU8x6aBhSspTxJ3Hq7z/qwe460QVgFdfPELX9pIv18mqwV986wgLLTEffLJm8sV7T9IyPQA6tsdKxyEMo9Pu+2UXDnPzf305v/jy7Xz27ml+4mN3s9S2n6ZnlpKSkvLEqXYdouj061tKyrOBluU904eQkvKMYTg+jn/+G8alhXBKypPID46u8I/3TANw4UiR0XIG0w0BWGzb/MF/HOTwYhuAmbrJJ26bYLntALBntsnvfHkfdVMUyv/x8ALX/PF3WOk68b/n+YXP3EfX8QHwgpDfecPFfOpdL2aklKGS057W55qSkpLyeFlq29x5vMpk1XimDyUl5TRkSeLCkdIzfRgpKc8Y3zm0xLcPLj3Th/GUk0qjU1KeBJY7Nh/46gG+uX+RsXKWn7l2Cxv781yzbYCCrjDXtCjqKt/49ZfSX9Bx/ICXXzTM0T9+Y3Ifr79slHv/52sSg45rLxjgj95+OYP
2025-03-23 16:54:36 -04:00
"text/plain": [
"<Figure size 1200x1000 with 10 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
2025-04-14 22:31:56 -04:00
"v_easy: mean = 2.48, 95% HDI = [1.95654057 2.98963516]\n",
"v_hard: mean = 0.28, 95% HDI = [0.01961169 0.67641368]\n"
2025-03-23 16:54:36 -04:00
]
},
{
"data": {
2025-04-14 22:31:56 -04:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAqYAAAIQCAYAAABT6Kz3AAAAOnRFWHRTb2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nq5awdgTfyUD8BvJ0+e1LFjx0q0FxYWnnPd2bNnKzk5WePHj1fPnj3lcrm0c+dO7d69W//zP/+jO+64Q0eOHFFaWppeeeUVn3WNMbrhhhu0detW3XbbberataveffddzZgxQ4cPH/YJLWPHjtWaNWs0atQoXX755frggw80aNCgMusaOnSoOnTooCeeeMIbctPS0nTgwAGNGzdOcXFx2rt3r5YuXaq9e/fqk08+8QnMkjR8+HBddNFFmjdvnjZs2KDHHntMjRo10gsvvKBrrrlGTz75pF577TXdd999+sMf/qCrr776rHM1fvx4vfzyy/rLX/6i6dOn69NPP1VycrK+/vprrVu3TpL0yiuvaOnSpfrss8+0bNkySVLv3r1LHW/48OFKSUnRhg0bNHToUG/76dOn9fbbb2vs2LEKDQ09a01nZGVl6fLLL5fNZtOkSZMUExOjd955R7fddptcLpemTJkiSXK5XFq2bJlGjBihCRMm6NSpU3rppZeUlJSkzz77zHuiVlpamkaMGKFrr71WTz75pCTp66+/1scff6x7771Xbdu21RVXXKHXXntNU6dO9anltddeU0REhG688cZy1Q7AwgwAlNOKFSuMpLMunTp18lmnVatWZsyYMd7HXbp0MYMGDTrr60ycONGU9vW0fv16I8k89thjPu1/+ctfjM1mM/v37zfGGLNr1y4jyUyZMsWn39ixY40kM2vWLG/brFmzjCQzYsSIEq93+vTpEm2vv/66kWQ+/PDDEmPcfvvt3jaPx2NatmxpbDabmTdvnrf9+PHjJjw83GdOSpOenm4kmfHjx/u033fffUaSef/9971tY8aMMQ0aNDjreMYYU1xcbFq0aGFuuukmn/Y1a9aUeE/nctttt5lmzZqZY8eO+bTffPPNJioqyjt3Ho/HuN1unz7Hjx83TZs2Nbfeequ37d577zWRkZHG4/GU+ZovvPCCkWS+/vprb1tBQYFp0qTJOecTQM3AT/kA/JaSkqK0tLQSS+fOnc+5bnR0tPbu3avvvvvO79fduHGjQkNDdc899/i0T58+XcYYvfPOO5KkTZs2SZLuvvtun36TJ08uc+w777yzRFt4eLj333/55RcdO3ZMl19+uSRp9+7dJf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dbtfgwYM1ePBgFRcX6+6779YLL7yghx9+2Lvn+Prrr1dMTIxee+019erVS6dPn9aoUaPKXTsAa+NPTABV6veXWjr//PPVvn17n0sgNWjQQJJ04sQJn74DBw5UUVGRnn/+eZ/2hQsXymazacCAAZKkpKQkSdI//vEPn37PPfdcues8s6fz93s2Fy1aVO4xAjFw4MBSX++ZZ56RpLNeYeBchg8fLrfbrZdfflmbNm3SsGHD/Fo/NDRUN910k/71r3/pyy+/LPF8dna2T1/Jdx4//fRT7dixw2ed338uQkJCvMcs//azUa9ePY0YMUJr1qzRypUrdemll5br2GYANQN7TAFUqYsvvlh9+/ZV9+7d1ahRI+3cuVNr167VpEmTvH26d+8uSbrnnnuUlJSk0NBQ3XzzzRo8eLD69eunhx56SD/88IO6dOmizZs369///remTJmidu3aede/6aabtGjRIuXk5HgvF/Xtt99KKt/P45GRkbr66qv11FNPqbCwUC1atNDmzZt18ODBSpiVkrp06aIxY8Zo6dKlOnHihPr06aPPPvtML7/8soYMGaJ+/fpVeOxu3bqpffv2euihh+R2u/36Gf+MefPmaevWrerVq5cmTJigiy++WD///LN2796t9957Tz///LMk6Y9//KPefPNN/elPf9K
2025-03-23 16:54:36 -04:00
"text/plain": [
"<Figure size 800x600 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>mean</th>\n",
" <th>sd</th>\n",
" <th>hdi_3%</th>\n",
" <th>hdi_97%</th>\n",
" <th>mcse_mean</th>\n",
" <th>mcse_sd</th>\n",
" <th>ess_bulk</th>\n",
" <th>ess_tail</th>\n",
" <th>r_hat</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>v_easy</th>\n",
2025-04-14 22:31:56 -04:00
" <td>2.478</td>\n",
" <td>0.262</td>\n",
2025-03-23 16:54:36 -04:00
" <td>1.986</td>\n",
2025-04-14 22:31:56 -04:00
" <td>2.972</td>\n",
2025-03-23 16:54:36 -04:00
" <td>0.004</td>\n",
" <td>0.003</td>\n",
2025-04-14 22:31:56 -04:00
" <td>4630.0</td>\n",
" <td>4592.0</td>\n",
2025-03-23 16:54:36 -04:00
" <td>1.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>v_hard</th>\n",
2025-04-14 22:31:56 -04:00
" <td>0.282</td>\n",
" <td>0.177</td>\n",
2025-03-23 16:54:36 -04:00
" <td>0.000</td>\n",
2025-04-14 22:31:56 -04:00
" <td>0.582</td>\n",
2025-03-23 16:54:36 -04:00
" <td>0.003</td>\n",
" <td>0.002</td>\n",
2025-04-14 22:31:56 -04:00
" <td>3177.0</td>\n",
" <td>2269.0</td>\n",
2025-03-23 16:54:36 -04:00
" <td>1.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>a</th>\n",
" <td>0.846</td>\n",
" <td>0.026</td>\n",
2025-04-14 22:31:56 -04:00
" <td>0.799</td>\n",
2025-03-23 16:54:36 -04:00
" <td>0.896</td>\n",
" <td>0.000</td>\n",
" <td>0.000</td>\n",
2025-04-14 22:31:56 -04:00
" <td>4537.0</td>\n",
" <td>4743.0</td>\n",
2025-03-23 16:54:36 -04:00
" <td>1.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>beta</th>\n",
2025-04-14 22:31:56 -04:00
" <td>0.524</td>\n",
" <td>0.021</td>\n",
" <td>0.484</td>\n",
" <td>0.561</td>\n",
2025-03-23 16:54:36 -04:00
" <td>0.000</td>\n",
" <td>0.000</td>\n",
2025-04-14 22:31:56 -04:00
" <td>4227.0</td>\n",
" <td>4836.0</td>\n",
2025-03-23 16:54:36 -04:00
" <td>1.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>tau</th>\n",
" <td>0.397</td>\n",
" <td>0.003</td>\n",
" <td>0.392</td>\n",
" <td>0.402</td>\n",
" <td>0.000</td>\n",
" <td>0.000</td>\n",
2025-04-14 22:31:56 -04:00
" <td>4290.0</td>\n",
" <td>5254.0</td>\n",
2025-03-23 16:54:36 -04:00
" <td>1.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" mean sd hdi_3% hdi_97% mcse_mean mcse_sd ess_bulk ess_tail \\\n",
2025-04-14 22:31:56 -04:00
"v_easy 2.478 0.262 1.986 2.972 0.004 0.003 4630.0 4592.0 \n",
"v_hard 0.282 0.177 0.000 0.582 0.003 0.002 3177.0 2269.0 \n",
"a 0.846 0.026 0.799 0.896 0.000 0.000 4537.0 4743.0 \n",
"beta 0.524 0.021 0.484 0.561 0.000 0.000 4227.0 4836.0 \n",
"tau 0.397 0.003 0.392 0.402 0.000 0.000 4290.0 5254.0 \n",
2025-03-23 16:54:36 -04:00
"\n",
" r_hat \n",
"v_easy 1.0 \n",
"v_hard 1.0 \n",
"a 1.0 \n",
"beta 1.0 \n",
"tau 1.0 "
]
},
2025-04-14 22:31:56 -04:00
"execution_count": 4,
2025-03-23 16:54:36 -04:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# print and graph in a different cell because the stan takes 5 to 10 business centuries to run\n",
"\n",
"v_easy = fit[\"v_easy\"]\n",
"v_hard = fit[\"v_hard\"]\n",
"a = fit[\"a\"]\n",
"beta = fit[\"beta\"]\n",
"tau = fit[\"tau\"]\n",
"\n",
"fig = az.plot_trace(fit)\n",
"plt.subplots_adjust(hspace=0.5)\n",
"plt.savefig('trace_plot.png')\n",
"plt.show()\n",
"\n",
"print(\n",
" f\"v_easy: mean = {np.mean(v_easy):.2f}, 95% HDI = {np.percentile(v_easy, [2.5, 97.5])}\")\n",
"print(\n",
" f\"v_hard: mean = {np.mean(v_hard):.2f}, 95% HDI = {np.percentile(v_hard, [2.5, 97.5])}\")\n",
"\n",
"\n",
"fig, axes = plt.subplots(2, 1, figsize=(8, 6)) # 2 subplots\n",
"axes[0].hist(v_easy.flatten(), bins=30, density=True,\n",
" alpha=0.7, color='blue', edgecolor='black')\n",
"axes[0].set_title(\"Histogram of v_easy\")\n",
"\n",
"axes[1].hist(v_hard.flatten(), bins=30, density=True,\n",
" alpha=0.7, color='red', edgecolor='black')\n",
"axes[1].set_title(\"Histogram of v_hard\")\n",
"\n",
"plt.subplots_adjust(hspace=0.5)\n",
"plt.savefig(\"drift_rate_histograms.png\", bbox_inches='tight')\n",
"plt.show()\n",
"\n",
"az.summary(fit)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
2025-04-14 22:31:56 -04:00
"version": "3.12.10"
2025-03-23 16:54:36 -04:00
}
},
"nbformat": 4,
"nbformat_minor": 2
}