Skip to main content
. 2019 Dec 29;22(1):46. doi: 10.3390/e22010046
Algorithm 2 2-variable causal inference
  • Input: Finite sample data d(x,y)RN×2, Hyperparameters Pβ,Pf,ς2,r

  • Output: Predicted causal direction DXY{XY,YX}
    1. Rescale the data to the [0,1] interval. That is, min{x1,,xN}=min{y1,,yN}=0 and max{x1,,xN}=max{y1,,yN}=1
    2. Define an equally spaced grid of (z1,,znbins) in the interval [0,1]
    3. Calculate matrices B,F representing the covariance operators B and F evaluated at the positions of the grid, i.e., Bij=B(zi,zj)
    4. Find the β0R[0,1] for which γ, as defined in Appendix A.1 (Equation (A2)), becomes minimal
    5. Calculate the d-dependent terms of the information Hamiltonian in Equation (7) (i.e., all terms except H0)
    6. Repeat steps 4 and 5 with y and x switched
    7. Calculate the Bayes factor OXY
    8. If OXY>1, return XY, else return YX