Thursday, February 28, 2013

I've Been Plotting...

...to plot some plots! In Matlab!

Hello again. As alluded to in last week's post, I've been researching the stock market and its indices this week. In hopes of analyzing trends in index prices that might aid me in predicting their future, I've downloaded historical data for indices such as the Dow Jones Industrial Average and the Nasdaq Composite.

Also as promised, I've reunited with Matlab. Beyond programming and matrices, Matlab also has significant graphing and graph analysis capabilities. By converting the data I'd downloaded into text files, I was able to upload them into Matlab, where they could be graphed. Read ahead, and I'll show you how using Nasdaq Composite data as an example. :)

Before that, I'd like to start with a little background about the Nasdaq Composite. One of the most highly followed stock market indices in the United States, the Nasdaq Composite functions as an indicator of the performance of technology and growth companies. It includes common stocks and similar securities that appear on the NASDAQ stock market, amounting to over 3000 components. Its ticker symbol is IXIC.

Right then. Here's how I loaded its data into Matlab:


>> cd nasdaq
>> ls

.           ..          NASDAQ.txt

>> data=load('nasdaq.txt');

The historical data for the Nasdaq Composite appears in Matlab as a 248x1 matrix. I can then graph this data against time, t, with single day intervals, like so:


>> t=(1:248);
>> plot(t,data)
>> grid

and get the following figure:



Looking at the graph, it appears that Nasdaq Composite prices vary in a somewhat wavelike manner. Therefore, it might be analyzed as such. More about that in the next post!


1 comment:

  1. Lu, I'm so glad you are using some linear algebra in your research. This is great stuff. I'm glad to see you and Matlab have gotten back together. You will have to introduce me.

    ReplyDelete