Skip to content

Instantly share code, notes, and snippets.

View p-gw's full-sized avatar

Philipp Gewessler p-gw

  • Bundesministerium für Bildung, Wissenschaft und Forschung
  • Vienna, Austria
View GitHub Profile
@p-gw
p-gw / verbal_aggression_dich.txt
Created February 27, 2023 12:49
Datasets for item response modeling
S1WantCurse S1WantScold S1WantShout S2WantCurse S2WantScold S2WantShout S3WantCurse S3WantScold S3WantShout S4WantCurse S4WantScold S4WantShout S1DoCurse S1DoScold S1DoShout S2DoCurse S2DoScold S2DoShout S3DoCurse S3DoScold S3DoShout S4DoCurse S4DoScold S4DoShout Anger Sex
0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 1 0 0 1 0 0 1 1 1 20 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 11 1
1 1 1 1 0 1 1 0 0 0 0 0 0 1 1 0 0 1 0 0 0 1 0 0 17 0
1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 21 0
1 0 1 1 0 0 1 0 0 1 0 0 1 1 0 1 0 0 1 0 0 1 0 0 17 0
1 1 0 1 0 0 1 1 1 0 0 0 1 0 0 1 0 0 1 0 0 1 1 0 21 0
1 1 1 1 1 1 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 39 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 21 0
0 0 0 1 1 0 1 0 1 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 24 0
@p-gw
p-gw / turing-irt-benchmark.jl
Created August 24, 2022 08:38
benchmarking turing vs stan on a simple IRT model
using Distributions, Turing, ReverseDiff, Memoization, LogExpFunctions
using BenchmarkTools
using Turing: @addlogprob!
using StanSample
Turing.setprogress!(false)
Turing.setadbackend(:reversediff)
Turing.setrdcache(true)
set_cmdstan_home!(homedir() * "/Applications/cmdstan/")
@p-gw
p-gw / IRT.jl
Last active July 30, 2021 09:09
testing scripts for IRT.jl package
using IRT, CSV, DataFrames
url = "https://raw.githubusercontent.com/t-alfers/Rasch-Turing/master/dichotom.txt"
data = CSV.read(download(url), DataFrame, delim = "\t")
data = data[:, Not([:Anger, :Sex])]
data.person = collect(1:nrow(data))
m = model(OneParameterLogistic, data, Not(:person), :person)
# simulate data