Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion HSIC.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,6 @@ def hsic_gam(X, Y, alph = 0.5):
bet = varHSIC*n / mHSIC

thresh = gamma.ppf(1-alph, al, scale=bet)[0][0]
p_value = 2*(1-gamma.cdf(testStat, al, scale=bet))[0][0]

return (testStat, thresh)
return (testStat, thresh, p_value)
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ from HSIC import hsic_gam

Apply HSIC on your data
```
testStat, thresh = hsic_gam(x, y, alph = 0.05)
testStat, thresh, p_value = hsic_gam(x, y, alph = 0.05)
```

### Description
Expand All @@ -31,14 +31,15 @@ Input of function `hsic_gam()`
|---|---|
|x | Data of the first variable. `(n, dim_x)` numpy array.|
|y | Data of the second variable. `(n, dim_y)` numpy array.|
|alph | level of the test |
|alph (default=0.05) | level of the test |

Output of function `hsic_gam()`

| Argument | Description |
|---|---|
|testStat |test threshold for level alpha test|
|thresh| test statistic|
|p_value| p-value of a statistical test with the null hypothesis: x, y are independent

### Independence test result
- If **testStat < thresh**, `x` and `y` are independent.
Expand Down