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
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 |
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, 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/") |
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 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 |