(X, Y, W)
| 31 | import sys |
| 32 | import statsmodels.api as stats |
| 33 | def slope_intercept(X, Y, W): |
| 34 | if sys.platform == 'win32': |
| 35 | os.environ['KMP_DUPLICATE_LIB_OK'] = 'TRUE' |
| 36 | Xb = stats.add_constant(X,0) |
| 37 | wls = stats.WLS(Y, Xb, weight=W).fit() |
| 38 | m_ls, b_ls = wls.params |
| 39 | Y_pred = wls.predict(Xb) |
| 40 | if sys.platform == 'win32': |
| 41 | del os.environ['KMP_DUPLICATE_LIB_OK'] |
| 42 | return { 'm' : m_ls, |
| 43 | 'b' : b_ls, |
| 44 | 'Y_predict' : Y_pred } |
nothing calls this directly
no outgoing calls
no test coverage detected