Skip to content

Transition matrix - swapped dimensions? #14

@mfalkiewicz

Description

@mfalkiewicz

Hi @satra,
in the current implementation, Markov matrix is calculated by taking sums along axis 1:

d_alpha = np.power(np.array(L_alpha.sum(axis=1)).flatten(), -1)

And multiplying each row by the respective inverse sum:
L_alpha = d_alpha[:, np.newaxis] * L_alpha

In this scenario, ROWS sum to 1.

However, as far as I understand the wiki: https://en.wikipedia.org/wiki/Markov_kernel, the normalization should happen along axis 0. Thus, the code should be:

d_alpha = np.power(np.array(L_alpha.sum(axis=0)).flatten(), -1) L_alpha = d_alpha[np.newaxis,:] * L_alpha

Here the COLUMNS sum to 1.

Is that correct?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions