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
using Turing | |
using SequentialSamplingModels | |
using Distributions | |
choice1,rt1 = rand(LBA(ν=[3.0, 2.0], A=0.8, k=0.2, τ=0.3), 25) | |
choice2,rt2 = rand(LBA(ν=[1.0, 1.5], A=0.7, k=0.2, τ=0.3), 25) | |
data = (choice=[choice1;choice2],rt=[rt1;rt1]) | |
condition = repeat([1,0], inner=25) |
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
using Distributions | |
function sample_prior() | |
return rand(Beta(1, 1)) | |
end | |
function generate_data() | |
θ = sample_prior() | |
y = rand(Binomial(10, θ)) |
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
### A Pluto.jl notebook ### | |
# v0.19.9 | |
using Markdown | |
using InteractiveUtils | |
# ╔═╡ 46e9d6b2-fac9-11ec-2cd8-67797a9be080 | |
using CommonMark, PlutoUI | |
# ╔═╡ bb080054-390d-491e-b412-fd9718a0c8c8 |
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
### A Pluto.jl notebook ### | |
# v0.16.1 | |
using Markdown | |
using InteractiveUtils | |
# ╔═╡ 633f980c-2e8d-11ec-2fe5-57a90a261d20 | |
begin | |
using ACTRModels, PrettyTables | |
import Base: show |
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
[deps] | |
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" | |
Memoization = "6fafb56a-5788-4b4e-91ca-c0cea6611c73" | |
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" | |
Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0" | |
[compat] | |
Distributions = "0.25.0" | |
Memoization = "0.1.0" | |
ReverseDiff = "1.9.0" |
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
cd(@__DIR__) | |
using Pkg | |
Pkg.activate("") | |
using CmdStan, Random, Distributions, MCMCChains | |
model = " | |
data { | |
// total number of data points in y | |
int<lower=1> N; |