Code Monkey home page Code Monkey logo

project_sp500_analysis_forecast's Introduction

PredictingTheSP500

What to do with your money in hard times - a look at some money options

Gordon D. Pisciotta

Money Options:

  • Low Returns
    • “Under your mattress”
    • High Yield Savings Account
    • Treasury or Government Bill/Bond
  • Risky Assets
    • Cryptocurrency
    • High Capital Investments
    • Real Estate
    • Alternative Assets
    • Private Equity
  • Alternative Options ~ A Potential Better Route:
    • Stock Market (S&P 500 Index) - measures performance of 505 publicly listed companies

Historical Price Of SP500 Index:

  • SP500 - 10 years - daily prices maxHist

Stationary Time Series Data

  • Price movements tend to drift towards some long term mean either upwards or downwards.
  • Stationary TS has constant mean/variance/autocorrelation over time detrend
    differenced_nonStationary seasonalDecomp

Augmented Dicker-Fuller Test

Null = time series contains unit root and is non-stationary
  • p-value > 0.05 = reject null (nonstationary)
Alternative - time series does not contain unit root and is stationary
  • p-value ≤ 0.05 = fail to reject null (stationary) adfTests

ARIMA & SARIMA

  • Fit by Grid Search to find lowest AIC - Fit data to Model SARIMAX_assumptions MODELASSUMPTIONS

PREDICTION:

prediction
predict

  • Upper & Lower Bounds of Fitted Parameters (7 year Rolling Perdictions - Trailing)
  • 95% Confidence Interval (shaded Section)
  • Forcast 6 months into future
    • perdiction widens to reflect loss of certainty in the market outlook

SUMMARY:

  1. Over time the market outperforms other assets
  2. Every year your money in your savings account is losing money due to inflation

LOOKING FORWARD:

  1. Generate portfolio from components of SP500

2. Build Automated Trading Model to Trade based on Perdictions/Moving Averages

ema

(1) Kernel-PCA

  • Use z-score to normalize data
  • Perform Kernel-PCA on the 505 component stocks within the S&P 500 Index
  • Generate Outputs:
    • EigenVectors - direction of principal component line
    • EigenValues - amount of variance each component stock (eigenvector) of the S&P 500 Index generates onto the overall price fluctuations over time kernelPCA kernelPCA_principalComponent_varWT

Reconstruct Kernel-PCA vs SP500 Index (Price)

kPCAvsSP

project_sp500_analysis_forecast's People

Contributors

ramraider011235 avatar ramraider013 avatar

Forkers

business-wizard

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.