I have a scalar time-series outcome `y_t` and an input vector `u_t` observed for `t = 1, ..., T`. I want to fit an input-output hidden Markov model with `K` latent states, where the transition probabilities depend on the current input through a multinomial-logit form and the observation model is a state-specific linear regression on the same input.

My model is:
`pi_1 ~ Dirichlet(1, 1, ..., 1) on the K-simplex,`
`Pr(z_1 = k) = pi_{1,k},`
`eta_{t,k} = u_t^T w_k, for t = 2, ..., T and k = 1, ..., K,`
`Pr(z_t = k | u_t, z_{t-1}) = exp(eta_{t,k}) / sum_{h=1}^K exp(eta_{t,h}), for t = 2, ..., T,`
`y_t | z_t = k, u_t ~ Normal(u_t^T b_k, sigma_k), for t = 1, ..., T,`
`w_k ~ Normal(0, 1), for k = 1, ..., K,`
`b_k ~ Normal(0, 1), for k = 1, ..., K,`
`sigma_k ~ half-Normal(0, 1), for k = 1, ..., K,`
`with identifying constraint sigma_1 < sigma_2 < ... < sigma_K (ordered).`

Here:
`y_t` is the observed scalar outcome at time t,
`u_t` is the observed input vector at time t,
`z_t` is the latent state at time t,
`pi_1` is the vector of initial state probabilities,
`w_k` is the transition regression coefficient vector for state k,
`b_k` is the observation regression coefficient vector for state k,
`sigma_k` is the residual standard deviation in state k,
`K` is the number of hidden states,
`M` is the dimension of the input vector,
`T` is the length of the time series.

Parameterization notes:
In `half-Normal(0, sigma)`, `sigma` is a scale parameter.
In `Normal(mu, sigma)`, `sigma` denotes a standard deviation.
