In the generated quantities, the initial state likelihood is only set for the state with the highest index. I believe is this is a typo wherein a lower case k should have been used on the left side of line 51. Lines 50-51 in hmm-semisup.stan:
for (k in 1:K)
best_logp[1,K] <- log(phi[k,u[1]]);
In the generated quantities, the initial state likelihood is only set for the state with the highest index. I believe is this is a typo wherein a lower case k should have been used on the left side of line 51. Lines 50-51 in hmm-semisup.stan: for (k in 1:K) best_logp[1,K] <- log(phi[k,u[1]]);
The same typo appears in the manual.