Two questions about using rstan to estimate the Item response theory model parameters

Dear All stan user:
Reccently, I am learning that using stan to estimate the IRT (Item Response Theory model) model
parameters, and I start from 1PL to 3PL. Futhermore, I try to using stan to estimate the MIRT (Multidimensional Iten Response Theory) model. Then I get two questions need to figure up are as follows:

1, I estimate that there are a lot of theta values, but stan only provides 100 rows of data in R. I don’t know how to get all the estimated data.

2, Regardless of whether it is a single-dimensional IRT model or a multi-dimensional IRT model, the parameter theta of the subject is always estimated to be inaccurate, and the deviation is relatively large. Sometimes the item parameter estimation is not accurate. I don’t know why?

Therefore, if you are a user of stan and have a certain understanding of IRT(Item Response Theory),
Could you please give me some suggestions, I am very grateful.

Yours sincerly

Dear Luis,

Really hard to troubleshoot your problems without seeing data and model.
Regarding your first question: In rstan you can print specific parameters by using the pars argument of the print function (e.g. print(fit, pars = 'theta') for all person parameters or print(fit, pars = 'theta[1]') for specific persons). See also the documentation of the print.stanfit function in R: ?print.stanfit.

Alternatively you can also get your posterior samples of the person parameters using the extract function (e.g. extract(fit, "theta")) . You can then calculate the posterior means from those samples. The exact code will depend on your model specification.

Just a few clarifications for your second question: What exactly do you mean by inaccurate? Do you get a large posterior standard deviation or biased estimates? The posterior standard deviation of person parameters in IRT models are dependent on the number of ‘informative’ items for each person. To get more accurate estimates for the person parameters you will generally need more items per person.

In any case it can always be a problem with model specification. Again, it is really hard to say without seeing the model and data.


Thank you p-gw, I appreciate your help.