Sie sind auf Seite 1von 5

Date: 12.05.

2017
Mahalete Haile
Gitanjali Sahoo

Assignment 2: Visualization
Data description: This is Stock market visualization and data analysis report. We used
pandas to get stock information and visualize the data, of various technology stocks
(Apple, Google, Microsoft and Amazon), the stocks visualized are stock data starting
exactly one year ago from today (end.year-1).

Purpose: We took into account various technology stocks and the questions that we
answered are the following:

1) What was the Apple stock daily change in traded volume over one year time?
2) What was the daily return of the Apple stock on average?
3) What was the moving average of the various stocks?
4) What was the correlation between different stocks daily returns?

For visualization we used different libraries


- import matplotlib .pyplot as plt
-import seaborn as sns
In addition

Visualization design:

Line charts: We choose to use line charts to visualize both the volume and the moving
average because it is easy to show fluctuation of stock prices with this chart. And they
are best used to track changes over time, using equal intervals of time between each
data point.

A histogram we used it to show the distribution of average daily return of the stock. We
choose to visualize the data in this way because histograms lets us discover, and show,
the underlying frequency distribution (shape) of a set of continuous data. This allows the
inspection of the data for its underlying distribution (e.g., normal distribution), outliers,
skewness, etc
We also plan to utilize jointplot to compare the correlation of two stocks and pairplot to
display and compare all available stocks in one place. These two are great seaborn
capabilities .

Adj Close is used to do the historical data analysis, because it takes into account every
changes in the stock. If for example there has been stock price splits ect The first figure
shows the daily volume that was traded with in the year. We can see definitely some
picks where the stock was really hot and being traded quite a lot.
Fig 1. Daily volume traded

Moving Averages

An indicator used in technical analysis to smooth out price action by filtering out the
“noise” from random price fluctuations. It basically, taking all the prices over a certain
period and averaging them out. And that gives incite on trends data.

Fig.2

The blue line is the Adj Closing Price of the Apple stock, and the other colors are moving
averages. We notice that as we take the moving averages more days at a time, in our
case MA (10, 20, 30) days, the line gates smoother, so its not going to be reliant on the
daily price fluctuations, for its general trend.
Moving average simplifies the price data by smoothing it out and creating a flowing line
so it can make isolating trends easier.

Daily Returns and the risk of the stock

in order to see the Daily Returns and the risk of the stock we have to look the daily
changes of the stock and not just its absolute value.
We calculated the Daily Return for Apple stock. What this shows is the percentage of
return of stock buyer money on any given day. If a person bought for instance a stock at
the beginning of a given day example some day in August (08.2016) last year, it means
that the person got almost 8% return of that stock.
It also shows the loss in the return of money, all the days pointing less than 2 % show
the losses.

We can see the average daily return of the stock using a histogram. For this we used
sns. distplot , one of seborn capabilities. We choose displot because it allows us to place
two plots on top of each other in this case (histogram and kde plot).
In our case It looks like it is skewed a little more to the positive side.

Daily percentage of return for two stocks

Next we compered the daily percentage of return for two stocks to see how they are
correlated. This is an interesting way to see if there are correlations between tech
companies.

sns.jointplot is used for this to plot the correlation. If two stocks are positively and
perfectly correlated to each other we get perfect linear relationship the pearsonr value =
1. (see graph). Any Google return on some day would be the equal to return of Apple on
that same day.

Pearson product momentum correlation coefficient gives a sense of how correlated the
daily percentages returns are. In our case there is a .45 correlation between Google and
Apple and it’s not such a strong one.
Comparison analysis

Seaborn and pandas allow as to make any amount of comparison analysis for every
possible stock in this technology portfolio (Apple, Google, Microsoft, Amazon).
The comparison analysis of the correlation of daily returns of each tech company is
shown bellow. Seaborn allows as to do this comparison plot using pairplot.

We can see a definite similar correlation between Google and Amazon for example, in
their daily returns.

Validation: Using this Visualization technique we were effective in answering the


analysis questions.

Das könnte Ihnen auch gefallen