add a data argument stationary: 0 if no constraint for the AR processes, 1 if AR processes are constrained
In parameters block, declare phi_unconstrained, theta_unconstrained, phi_seasonal_unconstrained, theta_seasonal_unconstrained
In transformed parameters block,
if stationary == 1, calculate phi = constrain_stationary(phi_unconstrained) and same for phi_seasonal, else phi = phi_unconstrained, and same for phi_seasonal
theta = constrain_stationary(theta_unconstrained) and same for theta_seasonal
All of the above is before constructing dummy_phi dummy_theta
Looks like there's a function we can use to do this here: https://github.com/reichlab/lssm/blob/master/inst/stan/functions.stan#L2704
Possible overview of code:
stationary
: 0 if no constraint for the AR processes, 1 if AR processes are constrainedAll of the above is before constructing dummy_phi dummy_theta