Optimize the VAR model's hyperparameters (such as regularization).

        Returns
        -------
        self : Workspace
            The Workspace object.

        Raises
        ------
        RuntimeError
            If the :class:`Workspace` instance does not contain source activations.

def optimize_var(self):
        """ Optimize the VAR model's hyperparameters (such as regularization).

        Returns
        -------
        self : Workspace
            The Workspace object.

        Raises
        ------
        RuntimeError
            If the :class:`Workspace` instance does not contain source activations.
        """
        if self.activations_ is None:
            raise RuntimeError("VAR fitting requires source activations (run do_mvarica first)")

        self.var_.optimize(self.activations_[self.trial_mask_, :, :])
        return self