Skip to content

Instantly share code, notes, and snippets.

@quantra-go-algo
Last active February 26, 2020 08:22
Show Gist options
  • Select an option

  • Save quantra-go-algo/b6bfaf1ad19ac3905a67527bd5d4e191 to your computer and use it in GitHub Desktop.

Select an option

Save quantra-go-algo/b6bfaf1ad19ac3905a67527bd5d4e191 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