top of page
  • Arash Heidarian

UnitedHealth Group Stock Price Forecasting Using AICE

Updated: Jul 13, 2022


BRAZIL - 2021/04/18: In this photo illustration the UnitedHealth Group (UHG) logo seen displayed on a smartphone screen. (Photo Illustration by Rafael Henrique/SOPA Images/LightRocket via Getty Images) SOPA IMAGES/LIGHTROCKET VIA GETTY IMAGE

In this post I show how I used AICE to predict United Health Group maximum and minimum stock price for 6 and 8 months ahead. if you have no clue what is AICE, I recommend to read my first post here. I also used AICE to predict Microsoft maximum stock price for 1 to 12 months ahead using AICE here. In order to get some general ideas how data is collected and how AICE works for stock price forecasting, make sure to have a quick look at my post for Microsoft stock price forecasting.


Data


I downloaded Microsoft historical stock price from Yahoo Finance. I downloaded United Health Group daily stock price spreadsheet since 2015-07-01 till 2022-06-29. I passed the dataset to AICE, set my desired monthly aggregation to Max and Min for AICE, and just waited for the prediction for 1 to 12 months ahead. AICE uses sophisticated methods to prepare the data and derive hundreds of features out of just limited given features/columns.


Calculating Error Rate - MAPE


In order to interpret model accuracy or error rate, I decided to use Mean Absolute Percentage Error (MAPE) . MAPE can tell us how many percent the predicted error is different to actual. As an example, if actual value is 10, but predicted value is 110, the error rate here is 10%. Even if the predicted value is 9, the error rate is still 10%. So when we say error rate is 10% it means we are talking about MAPE. For those who love to see the calculations and examples, instead of reinventing the wheel, I suggest this link (great example) and this link (just Wikipedia).



Backtesting


Just in a case you are not familiar with back-testing term, according to investopedia backtesting is the general method for seeing how well a strategy or model would have done ex-post. Back-testing assesses the viability of a trading strategy by discovering how it would play out using historical data. If back-testing works, traders and analysts may have the confidence to employ it going forward.


For this work, we have done back-testing since Aprile 2020 till June 2022, for 1 to 12 months ahead predictions. We go through the results soon.



MAPE average and median for minimum forecasted price from 1-12 months


MAPE average and median for maximum forecasted price from 1-12 months


Graphs above show error rates , for monthly maximum and minimum forecasted costs from 1-12 months. I picked 6 and 8 months prediction because they show highest accuracy in terms of price directions, and also MAPE rate in a reasonable range for 6 and 8 months prediction.


6 Months Maximum Price Prediction


The graph below shows 6 months price forecasting (back testing and future forecasts). It means evert predicted price in the graph, has been predicted using available data up to 6 months prior to the date. That is, the value for December 2022, has been predicted using data up to June 2022 (or in other words, in June 2022, we have used all available data to the date, to make prediction for December 2022 which is 6 months ahead prediction). Light blue line is actual, dark blue line is prediction, and red dotted-line is MAPE%.


The result below shows even for the dates where MAPE error rate is as high as 20%, we still get a good predicted price direction. In this graph we have actual values up to June 2022. It is expected that monthly maximum stock price in next months will continue on increasing trend.


UNH 6 Months Maximum Price Prediction


6 and 8 Months Minimum Price Prediction


Same as graphs above, the graph below shows 6 months price forecasting (back testing and future forecasts). It means evert predicted price in the graph, has been predicted using available data up to 6 months prior to the date. Light blue line is actual, dark blue line is prediction, and red dotted-line is MAPE%.


As we can see from both graphs below, price direction has been predicted reasonably good and median MAPE% is roughly 5% and 8% for 6 and 8 months predictions respectively.

The graph also shows MAPE% has been improved over the time, which shows AICE has learned from its mistakes and adjusted the values better for most recent predictions.

UNH 6 Months Minimum Price Prediction

Both 6 and 8 months graphs show we probably should still witness the increasing trend in next coming months, while we may have some drops in August.


UNH 8 Months Minimum Price Prediction

Final Verdict


The results show AICE has done a great job in predicting price values and directions for maximum and minimum monthly prices, for 6-8 months, for UNH group. So if nothing crazy happens in the world (which is not quite unlikely anymore), according to the predicted increasing trend, I would still consider UNH as a good buy. I run the algorithm every month and adjust my decisions on buy and sell. If you are keen to use AICE for your business (any type of forecasting, supply, demand, price, volume, anything, you name it), feel free to contact me.



WARNING: this website takes not responsibility for using the contents for your investment.

73 views

Recent Posts

See All

Comments


bottom of page