Hi,

I’ve been trying to figure this out for quite a few days now but I still couldn’t find a definitive answer.

I am trying to fit an HMM/State Space Model model where there are binary outcomes but one of the outcomes is unobserved.

Suppose you want opinions on how satisfied students are with their education. To attract responses, you are giving away free lunch boxes. You have 100 lunch boxes. In order for people to get lunch boxes, they will have to fill out a short survey. However, you do not know how many people walked by your table and decided not to pick up a lunch box thus you do not have any information about them. So essentially, you have 100 observations, all of which are 1 in your logit/probit model and you have some information about them. You do not know how many 0s are there in your model, it could be 100, or 10,000.

How should I write the model block in stan? I could write something like

decision ~ normal(utility.of.lunch.box + rating.in.survey, sigma_d);

satisfaction ~ normal(decison + rating.in.survey, sigma_s);

In this model, I know satisfaction has 100 rows as I have 100 surveys on hand. I know there are 100 rows of decisions which are 1(decided to take survey & take lunch box), but I do not know how many 0s(or how many total rows to assign to decision) there are and thus do not know how to code it in Stan. The ultimate goal is to realize all students’ satisfaction with education, but again suppose we do not know how many students there are, is there a way to model it?

One way to do it is to give it a ridiculous amount of rows(say 1 million), and stop when we have 100 1s in the decision. I am not sure but I have a feeling that I won’t be able to extract the true opinion in students if I do this. Also, I didn’t find where to put such codes in Stan.

Any comments/suggestions will be greatly appreciated!

Thanks,

Nick