Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement linear model variants #17

Open
3 tasks
p-gw opened this issue Jan 21, 2023 · 2 comments
Open
3 tasks

Implement linear model variants #17

p-gw opened this issue Jan 21, 2023 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@p-gw
Copy link
Member

p-gw commented Jan 21, 2023

This issue splits #5.

Separately implement linear variants of simple Rasch models:

TODO

  • Linear Logistic Test Model
  • Linear Rating Scale Model
  • Linear Partial Credit Model
@p-gw p-gw added the enhancement New feature or request label Jan 21, 2023
@p-gw
Copy link
Member Author

p-gw commented Jan 26, 2023

For the construction of the item predictor matrix Q we need to pass the matrix to the appropriate models.

On the user side it might be more convenient to allow constructions from Tables.jl compatible sources as well. This could easily be done via StatsModels.jl

using DataFrames
using StatsModels

df = DataFrame(item = 1:5, a=[1,1,1,0,0], b=[0,0,1,1,1])
f = @formula(0 ~ a + b)
f = apply_schema(f, schema(f, df))
Q = modelmatrix(f, df)
5×2 Matrix{Int64}:
 1  0
 1  0
 1  1
 0  1
 0  1

@p-gw p-gw added this to the 0.1.0 milestone Jan 26, 2023
@t-alfers
Copy link
Member

I thought of something like this:

using DataStructures: OrderedDict

Q_input = OrderedDict(
    "a" => [1, 2, 3],
    "b" => [3, 4, 5]
)

handle_q = function(Q_input::OrderedDict, I::Int)
    C = length(Q_input)
    Q_matrix = zeros(Int, I, C)
    Q_values = values(Q_input)

    for (i, v) in enumerate(Q_values)
        Q_matrix[v, i] .+= 1        
    end

    return Q_matrix
end

handle_q(Q_input, 5)
5×2 Matrix{Int64}:
 1  0
 1  0
 1  1
 0  1
 0  1

Maybe we can allow for numerous ways for convenient Q-matrix inputs.

@p-gw p-gw modified the milestones: 0.1.0, 0.2.0 Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants