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

tamaan loading model prior and non-parametric IRT (tam.np) #13

Open
andreanorcinipala opened this issue Jun 27, 2020 · 3 comments
Open

Comments

@andreanorcinipala
Copy link

andreanorcinipala commented Jun 27, 2020

Hi,
I am encountering two separate issues: How to specify model priors with tamaan and use tam.np.

RE: model prior. I could not find any example on how to specify lambdas' model prior in tamaan. I tried to come up with potential ways, but it is not working at all.

One example is:
tammodel <- "
F1=~A1__A10
F1 ~~ 1*F1

MODEL PRIOR:
p1arace1_F1_load__p9arace1_F1_load ~ N(0,2);
"

Another example is:
tammodel <- "
F1=~lamb1__lamb10A1__A10
F1 ~~ 1
F1

MODEL PRIOR:
lamb1__lamb10 ~ N(0,2);
"
May you provide an example of how to specify lambas' prior?

The second issue is related to tam.np. I have tried to run example 1 (TAM page 177 https://cran.r-project.org/web/packages/TAM/TAM.pdf)

data(data.cqc02, package="TAM")
dat <- data.cqc02

mod <- TAM::tam.np(dat)

But I keep getting an error:
Error: Not compatible with requested type: [type=NULL; target=double].
In addition: Warning message:
In max(sqrt((probs - probs0)^2 * pi_k_array)) :
no non-missing arguments to max; returning -Inf

Can you please help with this?
Thanks
Andrea

@alexanderrobitzsch
Copy link
Owner

RE: model prior. I could not find any example on how to specify lambdas' model prior in tamaan. I tried to come up with potential ways, but it is not working at all.

One example is:
tammodel <- "
F1=~A1__A10
F1 ~~ 1*F1

MODEL PRIOR:
p1arace1_F1_load__p9arace1_F1_load ~ N(0,2);
"

Another example is:
tammodel <- "
F1=~lamb1__lamb10_A1__A10 F1 ~~ 1_F1

MODEL PRIOR:
lamb1__lamb10 ~ N(0,2);
"
May you provide an example of how to specify lambas' prior?

The issue is that the __ operator is (now) not defined for parameters, only for variables. Hence, lamb1__lamb10 is not understood. One should write separate model statements for each parameter. To avoid copying, one could use the DO operator which is a shortcut in tamaan syntax.

@alexanderrobitzsch
Copy link
Owner

alexanderrobitzsch commented Jun 27, 2020

The second issue is related to tam.np. I have tried to run example 1 (TAM page 177 https://cran.r-project.org/web/packages/TAM/TAM.pdf)

data(data.cqc02, package="TAM")
dat <- data.cqc02

mod <- TAM::tam.np(dat)

But I keep getting an error:
Error: Not compatible with requested type: [type=NULL; target=double].
In addition: Warning message:
In max(sqrt((probs - probs0)^2 * pi_k_array)) :
no non-missing arguments to max; returning -Inf

I agree. This was indeed a bug. The fix is included in recent TAM 3.6-8.

@andreanorcinipala
Copy link
Author

RE: model prior. I could not find any example on how to specify lambdas' model prior in tamaan. I tried to come up with potential ways, but it is not working at all.
One example is:
tammodel <- "
F1=~A1__A10
F1 ~~ 1*F1
MODEL PRIOR:
p1arace1_F1_load__p9arace1_F1_load ~ N(0,2);
"
Another example is:
tammodel <- "
F1=~lamb1__lamb10_A1__A10 F1 ~~ 1_F1
MODEL PRIOR:
lamb1__lamb10 ~ N(0,2);
"
May you provide an example of how to specify lambas' prior?

The issue is that the __ operator is (now) not defined for parameters, only for variables. Hence, lamb1__lamb10 is not understood. One should write separate model statements for each parameter. To avoid copying, one could use the DO operator which is a shortcut in tamaan syntax.

Thank you so much for your prompt reply. Unfortunately, even with your suggested syntax I do not seem to make priors lambda work. That is, lambdas remain the same regardless of the priors I use (e.g., ~N(0,2), ~N(0,1), ~N(0,0.1)). Would you be able to provide an example that works? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants