%% Least Squares and Real Data
% 
% Data Source: http://www.ncdc.noaa.gov/oa/climate/research/ushcn/

%% Download Real Data
%  The data found above was cleaned and is found at the site below

	disp('http://euclid.nmu.edu/~joshthom/ClimateData');

% Follow the link above, select a .mat file, download to your MATLAB directory

	disp('http://euclid.nmu.edu/~joshthom/ClimateData/ClimateStations.txt');

% The file Stations.txt indicate which cities correspond to which matrices.

%% Structure of Matrix Data
% Each matrix is roughly of size 118 by 14, and contains data recorded from a weather station in a particular city in the continental US.

% Each row corresponds to a year, starting with 1895.  
% Column 1 contains the year in which the temps were recorded.
% Columns 2-13 contain MAX MONTHLY TEMPERATURES 
% January = 2, February = 3, ..., December = 13, etc.
% Column 14 contains the average of the maximum monthly temperatures.


%% Assignment 1
% Load ONE matrix into MATLAB, and compute a "Least Squares Approximation" for each month. For example, 
	load(['MaxTempsStation_7.mat']);
% The x-value are the years 1895,1896,1897,...2012 
% The y-values are entries of columns 2-13 from the matrix.  
% Proceed as in the examples in the text, producing a y-intercept and a slope.  

% On a single figure, plot a month of data along with the line of best fit you just computed.  Do this for each month.

% Create a 12-element vector whose entries are the least-squares-slopes for each month.

%% Assignment 2
% Repeat Assignment ONE for as many cities as you can and analyze the slopes found in each approximation.  

% Is there a trend to the slopes?  


