* * Example 9.1, pp 423-426 * open data m-5cln.dat calendar(m) 1990 data(format=free,org=columns) 1990:1 1999:12 ibm hwp intc mer mwd * * Original analysis with data through 1999:12 * spgraph(vfields=5,footer="Figure 9.4 Monthly log returns") graph(header="(a) IBM") # ibm graph(header="(b) HWP") # hwp graph(header="(c) INTC") # intc graph(header="(d) MER") # mer graph(header="(e) MWD") # mwd spgraph(done) * * Compute the covariance matrix of the return series * vcv(center,matrix=r) # ibm hwp intc mer mwd * * Do the principal components analysis on the covariance matrix and * on its correlation matrix * @prinfactors(print) r @prinfactors(print,values=evalues) %cvtocorr(r) * * Pull out the eigenvalues and graph them * set eigen 1 5 = evalues(t) graph(style=symbols,vlabel="Eigenvalue",hlabel="Component",nodates) # eigen