Constant parameters in IRT model

Hi all!
Big fan of the project.
I am trying to use it on my company, in an educational context.
Basically, I am trying to build an Item Response Theory model where some of the item’s parameters were already estimated somehow and I want to estimate the student parameters and the new items parameters (betas and alphas are nans).

def model(idx_students, idx_items, idx_items_nan, n_students, n_new_items, beta, alpha, y=None):
      # STUDENT
      with numpyro.plate("plate_user", n_students):
          user_theta = numpyro.sample("theta", dist.Normal(0, 1))
      # ITEM
      isnan = np.isnan(beta)
      items_nanidx = np.nonzero(isnan)[0]
      beta_mu = numpyro.sample("beta", dist.Normal(0, 1).expand([n_new_items]))
      beta_impute = beta_mu[idx_items_nan]
  
      alpha_mu = numpyro.sample("alpha", dist.LogNormal(0, 0.25).expand([n_new_items]))
      alpha_impute = alpha_mu[idx_items_nan]
  
      beta = jnp.asarray(beta).at[items_nanidx].set(beta_impute)    
      alpha = jnp.asarray(alpha).at[items_nanidx].set(alpha_impute)
      # logit
      logits = alpha[idx_items] * (user_theta[idx_students] - beta[idx_items])
      if y is None:
          probs = expit(logits)
          numpyro.sample("probs", dist.Delta(probs), obs=probs)
      numpyro.sample("approved", dist.BernoulliLogits(logits=logits), obs=y)

so I am getting an array with the item’s data that were already estimated (a single point MAP, alphas and betas), merging it with the new items parameters that I want to estimate now and combing it with the students ability parameter to form the logit.
The problem is that when I check the estimated betas and alphas they are all constant. It’s not working. The student parameters, thetas does not suffer from this problem.
I am not sure if it’s a bug or feature.

I am using VI to estimate the parameters for now.

guide = autoguide.AutoDelta(model)
step_size = 1e-3
rng_key = random.PRNGKey(0)
optimizer = numpyro.optim.Adam(step_size=step_size)
svi = SVI(hierarchical_model_requirement, guide, optimizer, loss=Trace_ELBO())

Thank you

Hi @luccazen you are using auto delta, so posterior just contains single sample. You might want to use AutoNormal instead.

Thanks @fehiepsi !
I Tried that and still does not work.
Every alpha parameter converges close to 0 and the betas to 1.
Maybe something wrong with my model?

The model looks reasonable to me. I guess maybe 0 and 1 are best solution given your data.