Empirical Data

<<"BarCharts`";<<"Histograms`";<<"PieCharts`"
<<"MultivariateStatistics`";<<"ComputationalGeometry`"
<<"ErrorBarPlots`"
<<"LinearAlgebra`MatrixManipulation`"

SetDirectory[ToFileName[Extract["FileName"/.NotebookInformation[EvaluationNotebook[]],{1},FrontEnd`FileName]]];

date="Jun.1, 1980";
comp1="IBM";
comp2="GE";

dat1=FinancialData[comp1,date];
dat1tran=Transpose[dat1];
set1=dat1tran[[2]];

dat2=FinancialData[comp2,date];
dat2tran=Transpose[dat2];
set2=dat2tran[[2]];


numdata=Length[set1];
ListPlot[{set1,set2}]
(*Combine data sets: *)
dataset=Table[{set1[[i]],set2[[i]]},{i,1,numdata}];

(*Scatter plot: *)
ListPlot[dataset]
Print["Correlation between ",comp1," and ", comp2,":  ",Correlation[set1,set2]]

mat=Transpose[dataset].dataset;
{a,b}=Eigenvalues[mat]
{v,w}=Eigenvectors[mat]
ParametricPlot[t*v,{t,0,120}]