def fast_OLS(endog, exog):
"""
A simple function for (X'X)^(-1)X'Y
:return: A K-length array of estimated coefficients.
"""
try:
return dot(dot(inv(dot(exog.T, exog)), exog.T), endog).squeeze()
except LinAlgError:
raise LinAlgError
评论列表
文章目录