    def __update_deterministic_ar_model(self, state, params):
        """
        Update the deterministic AR(p) model for each cascade level if noise is disabled
        or if the sprog mask is used.
        """
        for i in range(params["n_cascade_levels"]):
            state["precip_m"][i] = autoregression.iterate_ar_model(
                state["precip_m"][i], params["phi"][i, :]
            )

        state["precip_m_d"]["cascade_levels"] = [
            state["precip_m"][i][-1] for i in range(params["n_cascade_levels"])
        ]

        if params["domain"] == "spatial":
            state["precip_m_d"]["cascade_levels"] = np.stack(
                state["precip_m_d"]["cascade_levels"]
            )

        precip_m_ = params["recomp_method"](state["precip_m_d"])

        if params["domain"] == "spectral":
            precip_m_ = params["fft"].irfft2(precip_m_)

        if params["mask_method"] == "sprog":
            state["mask_prec"] = compute_percentile_mask(precip_m_, params["war"])
Update the deterministic AR(p) model for each cascade level if noise is disabled
or if the sprog mask is used.
pysteps/nowcasts/steps.py