Closed p-gw closed 1 year ago
using CairoMakie
using ItemResponseRecipes
using RaschModels
using Turing
using Optim
data = rand(0:1, 100, 10)
rasch_mle = fit(RaschModel, data, Turing.MLE())
rasch_mcmc = fit(RaschModel, data, Turing.NUTS())
esp = Figure()
esp_mle = Axis(esp[1, 1], title="MLE")
esp_mcmc = Axis(esp[1, 2], title="MCMC")
expected_score_plot!(esp_mle, rasch_mle)
expected_score_plot!(esp_mcmc, rasch_mcmc)
xlims!(esp_mle, -3, 3)
xlims!(esp_mcmc, -3, 3)
ylims!(esp_mle, 0, 10)
ylims!(esp_mcmc, 0, 10)
with item subsets
esp = Figure()
esp_mle = Axis(esp[1, 1], title="MLE")
esp_mcmc = Axis(esp[1, 2], title="MCMC")
items = [1, 3, 4, 6, 10]
expected_score_plot!(esp_mle, rasch_mle, items)
expected_score_plot!(esp_mcmc, rasch_mcmc, items)
xlims!(esp_mle, -3, 3)
xlims!(esp_mcmc, -3, 3)
ylims!(esp_mle, 0, length(items))
ylims!(esp_mcmc, 0, length(items))
ICCs:
icc = Figure()
icc_mle = Axis(icc[1, 1], title="MLE")
icc_mcmc = Axis(icc[1, 2], title="MCMC")
item_characteristic_curve!(icc_mle, rasch_mle, 1)
item_characteristic_curve!(icc_mcmc, rasch_mcmc, 1)
xlims!(icc_mle, -3, 3)
xlims!(icc_mcmc, -3, 3)
ylims!(icc_mle, 0, 1)
ylims!(icc_mcmc, 0, 1)
IICs:
iic = Figure()
iic_mle = Axis(iic[1, 1], title="MLE")
iic_mcmc = Axis(iic[1, 2], title="MCMC")
item_information_curve!(iic_mle, rasch_mle, 1)
item_information_curve!(iic_mcmc, rasch_mcmc, 1)
xlims!(iic_mle, -3, 3)
xlims!(iic_mcmc, -3, 3)
ylims!(iic_mle, 0, 0.25)
ylims!(iic_mcmc, 0, 0.25)
closes #2, #1