def _estimate_centers_widths(
            self,
            unique_R,
            inds,
            X,
            W,
            init_centers,
            init_widths,
            template_centers,
            template_widths,
            template_centers_mean_cov,
            template_widths_mean_var_reci):
        """Estimate centers and widths

        Parameters
        ----------

        unique_R : a list of array,
            Each element contains unique value in one dimension of
            coordinate matrix R.

        inds : a list of array,
            Each element contains the indices to reconstruct one
            dimension of original cooridnate matrix from the unique
            array.

        X : 2D array, with shape [n_voxel, n_tr]
            fMRI data from one subject.

        W : 2D array, with shape [K, n_tr]
            The weight matrix.

        init_centers : 2D array, with shape [K, n_dim]
            The initial values of centers.

        init_widths : 1D array
            The initial values of widths.

        template_centers: 1D array
            The template prior on centers

        template_widths: 1D array
            The template prior on widths

        template_centers_mean_cov: 2D array, with shape [K, cov_size]
            The template prior on centers' mean

        template_widths_mean_var_reci: 1D array
            The reciprocal of template prior on variance of widths' mean


        Returns
        -------

        final_estimate.x: 1D array
            The newly estimated centers and widths.

        final_estimate.cost: float
            The cost value.

        """
        # least_squares only accept x in 1D format
        init_estimate = np.hstack(
            (init_centers.ravel(), init_widths.ravel()))  # .copy()
        data_sigma = 1.0 / math.sqrt(2.0) * np.std(X)
        final_estimate = least_squares(
            self._residual_multivariate,
            init_estimate,
            args=(
                unique_R,
                inds,
                X,
                W,
                template_centers,
                template_widths,
                template_centers_mean_cov,
                template_widths_mean_var_reci,
                data_sigma),
            method=self.nlss_method,
            loss=self.nlss_loss,
            bounds=self.bounds,
            verbose=0,
            x_scale=self.x_scale,
            tr_solver=self.tr_solver)
        return final_estimate.x, final_estimate.cost
Estimate centers and widths

        Parameters
        ----------

        unique_R : a list of array,
            Each element contains unique value in one dimension of
            coordinate matrix R.

        inds : a list of array,
            Each element contains the indices to reconstruct one
            dimension of original cooridnate matrix from the unique
            array.

        X : 2D array, with shape [n_voxel, n_tr]
            fMRI data from one subject.

        W : 2D array, with shape [K, n_tr]
            The weight matrix.

        init_centers : 2D array, with shape [K, n_dim]
            The initial values of centers.

        init_widths : 1D array
            The initial values of widths.

        template_centers: 1D array
            The template prior on centers

        template_widths: 1D array
            The template prior on widths

        template_centers_mean_cov: 2D array, with shape [K, cov_size]
            The template prior on centers' mean

        template_widths_mean_var_reci: 1D array
            The reciprocal of template prior on variance of widths' mean


        Returns
        -------

        final_estimate.x: 1D array
            The newly estimated centers and widths.

        final_estimate.cost: float
            The cost value.