Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Koopman Reweighting - Choosing eigenvector #307

Open
ZiadFakhoury opened this issue Feb 12, 2025 · 0 comments
Open

Koopman Reweighting - Choosing eigenvector #307

ZiadFakhoury opened this issue Feb 12, 2025 · 0 comments

Comments

@ZiadFakhoury
Copy link

ZiadFakhoury commented Feb 12, 2025

Hi,

I noticed that in the Koopman Reweighting Estimator, the selected eigenvector (that determines the weights), is chosen to be the one with the largest eigenvalue rather than the one with eigenvalue 1.

I encountered this issue when trying to use this and led to divisions by 0 (this would occur when attempting to normalize u such that the padded constant basis function, has constant 1, in u = u/np.dot(u, v) )

In the (admittedly rare) case where the basis set and the off-equilibria data that compute it result in a (nearly exact) reversible Koopman matrix, would this not cause issues too? You would have degenerate eigenvalues, with some eigenvectors leading to divisions by 0 as well?

thanks



def _compute_u(K):
        r"""Estimate an approximation of the ratio of stationary over empirical distribution from the basis.

        Parameters:
        -----------
        K0 : (M+1, M+1) ndarray
            Time-lagged correlation matrix for the whitened and padded data set.

        Returns:
        --------
        weights : (M,) ndarray
            Coefficients of the ratio stationary / empirical distribution from the whitened and expanded basis.
        """
        M = K.shape[0] - 1
        # Compute right and left eigenvectors:
        l, U = eig(K.T)
        l, U = sort_eigs(l, U)
        # Extract the eigenvector for eigenvalue one and normalize:
        u = np.real(U[:, 0]) #Extracting the biggest eigenvalue here, not necessarily equal to 1
        v = np.zeros(M + 1)
        v[M] = 1.0
        u = u / np.dot(u, v)
        return u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant