Not able to multiply matrix with a vector of random Variable. #219
Replies: 3 comments 5 replies
-
Hi @prantik1998! Thank you for playing around with |
Beta Was this translation helpful? Give feedback.
-
@prantik1998 Hi, thank you for your question. Could you please provide more details about the probabilistic model you're trying to implement? For instance, I'm not entirely clear on why it would be algebraically feasible to multiply your |
Beta Was this translation helpful? Give feedback.
-
Hi, I’m facing a similar issue in a model I’m trying to build. It’s a kind of double HMM where the observations [0 or 1] depend on two hidden variables : one has two states and the other has three states. So I’m trying to do something like this: function emission(z_1, z_2, B, t)
emission_probs = [sum(z_1[t][i] * z_2[t][j] * B[i, j, k] for i in 1:2, j in 1:3) for k in 1:2]
return emission_probs
end Of course, this doesn’t work, and I don’t see how to perform the calculation... @model function D_HMM(y,B)
T_t ~ MatrixDirichlet(ones(2,2))
T_b ~ MatrixDirichlet(ones(3,3))
z_1_0 ~ Categorical([0.5, 0.5])
z_2_0 ~ Categorical([1/3, 1/3, 1/3])
z_1_prev = z_1_0
z_2_prev = z_2_0
for t in eachindex(y)
z_1[t] ~ Transition(z_1_prev, T_t)
z_2[t] ~ Transition(z_2_prev, T_b)
y := emission(z_1, z_2, B, t) # ???
z_1_prev=z_1[t]
z_2_prev=z_2[t]
end
end Any idea? Thank you in advance for your help. |
Beta Was this translation helpful? Give feedback.
-
Hello everyone.
I am not able to multiply matrix with a vector of random variable
This is the code
Beta Was this translation helpful? Give feedback.
All reactions