\IncMargin{1.5em} \begin{algorithm}[h] \SetKwData{Left}{left} \SetKwData{This}{this} \SetKwData{Up}{up} \SetKwFunction{Union}{Union} \SetKwFunction{FindCompress}{FindCompress} \SetKwInOut{Input}{input} \SetKwInOut{Output}{output} \Input{$\bm{\mathcal{D}} = \{(\mathbf{x}_{n}, \mathbf{y}_{n})\}_{n=1}^{N}$ - the set of observations of two r.v.s;\\$\lambda$ - parameter of independence} \Output{The causal direction} \BlankLine
Standardize observations of each r.v.\; Initialize $\beta$ and kernel parameters\; Optimize the objective in both directions, denote the the value of HSIC term by $\text{HSIC}_{X\to Y}$ and $\text{HSIC}_{Y\to X}$, respectively\; \uIf{$\text{HSIC}_{X\to Y}$ < $\text{HSIC}_{Y\to X}$}{The casual direction is $X\to Y$\;} \uElseIf{$\text{HSIC}_{X\to Y}$ > $\text{HSIC}_{Y\to X}$}{The casual direction is $Y\to X$\;} \Else{No decision made.}