Skip to content

Instantly share code, notes, and snippets.

View mccreigh's full-sized avatar

James McCreight mccreigh

  • National Center for Atmospheric Research
  • Boulder,CO
View GitHub Profile
@mccreigh
mccreigh / cluster_hw.md
Created October 17, 2011 00:23
Cluster Analysis + CART homework problems

Cluster Analysis & PCA

Begin from the single field analysis of Kaplan SST in the tropical pacific for Jun-Sep for 1976-2010. Plot the first 3 spatial patterns and then plot its first 3 modes (space pattern*time series) along with its time mode (preferably normalized). Now perform a k-means clustering on the same data using k=3. Plot the spatial pattern of the clustering and then plot the individual timseries of the clusters in separate panels

To simplify the above (including the single field analysis problem from the PCA homework), the above tasks can be performed by code found here: https://github.com/mccreigh/EOF. In particular, navigate to the file R/kaplan.pca.r (in the R/ directory). However this will/may require installation of several (highly recommended) R packages including 2 of my own (which are in progress and which i invite collaboration on).

Reflect on the differences between the analyses. How are these related to the objectives of each? What is the objective of PCA? What is the objective