Skip to content

Instantly share code, notes, and snippets.

View itsdfish's full-sized avatar

dfish itsdfish

View GitHub Profile
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)
@itsdfish
itsdfish / gist:6ad91dbb3008056bf2656f22d16e30ed
Last active May 24, 2023 19:15
Discrete normalizing flow attemp
using Distributions
function sample_prior()
return rand(Beta(1, 1))
end
function generate_data()
θ = sample_prior()
y = rand(Binomial(10, θ))
@itsdfish
itsdfish / interpolate.jl
Created July 3, 2022 12:27
Interpolate variable into latex matrix
### A Pluto.jl notebook ###
# v0.19.9
using Markdown
using InteractiveUtils
# ╔═╡ 46e9d6b2-fac9-11ec-2cd8-67797a9be080
using CommonMark, PlutoUI
# ╔═╡ bb080054-390d-491e-b412-fd9718a0c8c8
@itsdfish
itsdfish / gist:3d394f1e1fe45b9da7dcf6df59b5bb6d
Last active October 16, 2021 15:42
print chunk in pluto
### A Pluto.jl notebook ###
# v0.16.1
using Markdown
using InteractiveUtils
# ╔═╡ 633f980c-2e8d-11ec-2fe5-57a90a261d20
begin
using ACTRModels, PrettyTables
import Base: show
@itsdfish
itsdfish / Project.toml
Created October 10, 2021 11:33
Hierarchical MPT Turing
[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"
@itsdfish
itsdfish / Stan_Turing.jl
Created April 18, 2021 11:03
Stan_Turing
cd(@__DIR__)
using Pkg
Pkg.activate("")
using CmdStan, Random, Distributions, MCMCChains
model = "
data {
// total number of data points in y
int<lower=1> N;