CS590 Visual Analytics - Project 4

AUTHOR: 
		Matthew S. Norton, B.S.

INSTALL 	
      - You import the controlP5 library, it needs to be downloaded from 
		http://www.sojamo.de/libraries/controlP5/index.html and select
		"download controlP5 0.3.14 in .zip format" and unzip it, move the folder to the libraries
		folder in your sketchbook folder. You can find where your sketchbook folder is by opening the
		preferences in Processing. The first item there is the path to your sketchbook folder. On my
		system, my sketchbook folder is located at "/Users/msn/Documents/Processing/". 
      - In the "Data" folder for the stocks_final application, there should be the following files:
	       - B.csv
           - ComicSansMS-12.vlw
           - ComicSansMS-14.vlw
           - ComicSansMS-24.vlw
           - ITT.csv
           - QSII.csv
		   - EF.csv
		   - texmap.png
      - If the ComicSansMS files do not exist, they can be created by Processing by going to 
        Tools->Create Font and selecting ComicSansMS  and selecting sizes 12, 14, and 24
      - The .csv files, if not found, can be downloaded from yahoo finance. They will have to be renamed
        to B.csv (Barnes), ITT.csv (ITT Corporation), and QSII.csv (Quality Systems Inc). The .png file, 
        if not found, can be downloaded as discussed at the end of this readme.
      - The paths to files are an absolute path, you will have to change them to point to the folder 
        where the files are in your system.
		
FEATURES 
      - Move mouse around the grid to see yellow lines that go to the x and y axes to show you
	    what that day's stock value is
      - A table in the upper right corner shows that day's stock information, including:
	       - The opening price
	       - The highest price for the day
	       - The lowest price for the day
	       - The closing price
	       - The volume of shares sold on that day
	       - The adjusted closing price. The adjusted closing price takes into account any cash 
	         dividends, stock dividends and stock splits for that day.
	       - The daily return for that day, which is calculated from the previous day's closing value 
	         subtracted from that days closing value and all divided by the previous day's closing 
	         value. In \LaTeX form, the equation for this is Daily return =(y_n-y_{n-1})/y_{n-1} 
	         where y is the day's closing value.
	       - The total return for the stock, which is the mean of the daily returns
	       - The mean risk is the standard deviation of the daily returns
	       - If you are in daily return mode, it will tell you what the histogram value is.
	  - From the control window you may:
		   - Select which stock's data you want shown
		   - Choose whether to show the daily adjusted closing price or the daily returns
		   - Choose to see a sampling of 10,000 portfolios with random weights, with the weights under
		     the condition that the sum of the weights is one and each of the weights has to be greater
		     than zero. In addition, the "Efficient Frontier" was calculated separately (results are 
		     in the EF.csv file) and graphed. The Efficient Frontier shows the highest return for a 
		     given risk value.
		   - Choose to see a plot of weights for the 10,000 random portfolios against risk. Notice 
		     how each set of weights only fills a certain section of the graph. This is again due 
		     to the restrictions placed on the weights, that they sum to one and all be grater than zero.
		   - Choose to see how just the efficient frontier weights vary with risk. This is probably
		     the most important graph of this program, it shows that the portfolio with the least 
		     amount of risk has all three stocks in it, not just the least risky stock. However, the
		     portfolio with the highest risk has only a single stock in it, the highest risk stock. 
		     This is the magic of portfolio theory, combining high risk and low risk items together
		     in a portfolio leads to there being a lower overall risk.
			
DATA USED
	    I used daily stock info obtained from Yahoo Finance, http://finance.yahoo.com/ . Enter the 
	    stock symbol in the box next to the "Get Quotes". The stock chosen for this project were:
	      - Barnes Group Inc. (B)
	      - ITT Corporation (ITT)
	      - Quality Systems Inc. (QSII)
	    to download the stock data on each page, go to "Historical Prices" on the left menu on the page
	    under "Quotes". I decided to use stock data from 01 January, 2009 to the current date 
	    (09 November, 2009 used). The program has a built in limit of only 365 days supported for stock
	    information. This limit is imposed because I do not know how to do allocatable arrays in Java
	    and had more important things to get working. These specific stocks were chosen in honor of 
	    Drs. Rainer Grobe and Qichang Su, my advisors for my senior project at Illinois State University. 
	    They chose these stocks for my the study into modeling stock portfolios. The Efficient Frontier
	    was calculated separately in a FORTRAN 77 program that I used in my senior project. This code 
	    is closed source, so it cannot be released. That program used the method of Lagrange multipliers
	    to calculate the efficient frontier.
		
THE QUESTION
		"Is the motion of stocks stochastic and is there any way to reduce the effects of the stochasticity"
		
THE ANSWER
		It appears that stocks move fairly stochastically. It appears that one can use the stochasticity
		of the stocks as an advantage by combining them into a portfolio of multiple stocks. This is 
		clearly seen in the graph of how the weights of the efficient frontier weights move with risk.
		
COPYING / LICENSE 	
! ------------------------------------------------------------------------------
!
! Copyright 2009 Matthew S. Norton, B.S.
!
! ------------------------------------------------------------------------------
!    This program is free software; you can redistribute it and/or modify
!    it under the terms of the GNU General Public License as published by
!    the Free Software Foundation; either version 2 of the License, or
!    (at your option) any later version.
!
!    This program is distributed in the hope that it will be useful,
!    but WITHOUT ANY WARRANTY; without even the implied warranty of
!    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
!    GNU General Public License for more details.
!
!    You should have received a copy of the GNU General Public License
!    along with this program; if not, write to the Free Software
!    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
! ------------------------------------------------------------------------------

OTHER INFO
		The source code, and all required input files can be downloaded from 
		http://msnorton.com/stocksP4.zip . The PowerPoint for my senior project,
		which talks about stock portfolios in more depth can be downloaded from
		http://msnorton.com/stocks.pdf .