Observed marginal probabilities of categorical variable

Hey, I have a question on how I could implement observed marginal probabilities.
Normally you define:

    x_variable = pyro.sample(f"x_variable", dist.Categorical(p_))

However, from my understanding you define the prior in this way. For example:
alpha = pyro.sample(‘alpha’, dist.Normal(0.0, 1.0))

this defines the parameter alpha with a normal(0,1) prior. I am not interested in estimating p_ but rather keep it fixed when modelling. I know there must be a simple way to implement this. Yet, I can’t find it…
Could someone help me?

1 Like

i think you’re looking for the obs keyword. for example see here

x_variable = pyro.sample(f"x_variable", dist.Categorical(p_), obs=my_obs)

Hmm I don’t think so as I don’t observe the variable: x_variable, I only observe the probabilities (p_). Or do I miss something?

1 Like

can you please specify the exact model you’re interested in?

Hi Helena,

I’m not sure I completely understand your question, but could this be what you’re looking for?:

dist.Categorical(p_).sample()