'Transform unconstrained parameters used by the optimizer to constrained
parameters used in likelihood evaluation'

def transform_params(self, unconstrained):

    unconstrained = np.array(unconstrained, ndmin=1)
    constrained = np.zeros(unconstrained.shape, dtype=unconstrained.dtype)
    offset = (self.k_obs_cov + self.k_state_cov)
    constrained[:offset] = (unconstrained[:offset] ** 2)
    if self.cycle:
        (low, high) = self.cycle_frequency_bound
        constrained[offset] = (((1 / (1 + np.exp((- unconstrained[offset])))) * (high - low)) + low)
        offset += 1
        if self.damped_cycle:
            constrained[offset] = (1 / (1 + np.exp((- unconstrained[offset]))))
            offset += 1
    if self.autoregressive:
        constrained[offset:(offset + self.ar_order)] = constrain_stationary_univariate(unconstrained[offset:(offset + self.ar_order)])
        offset += self.ar_order
    constrained[offset:(offset + self.k_exog)] = unconstrained[offset:(offset + self.k_exog)]
    return constrained
