Skip to content

Instantly share code, notes, and snippets.

@quantra-go-algo
Created February 21, 2020 06:51
Show Gist options
  • Save quantra-go-algo/5bcf5fffbf1f145e005c05707c098697 to your computer and use it in GitHub Desktop.
Save quantra-go-algo/5bcf5fffbf1f145e005c05707c098697 to your computer and use it in GitHub Desktop.
#Computes the forecasted values
stock['forecast'] = intercept + slope*stock['t']
#Computes the error
stock['error'] = stock['Adj Close'] - stock['forecast']
mean_error=stock['error'].mean()
print ('The mean error is: ', mean_error)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment