Blog Archives

Create polygons from a matrix

April 27, 2012
By
Create polygons from a matrix

The following function matrix.poly allows for the addition of polygons to a plot based on a matrix and defined matrix positions. I have used this function on occasion to highlight specific matrix locations (e.g. in the above figure). You can do the same by overlaying another image (left in above plot) but with this...

Read more »

Adding a transparent image layer to a plot

April 19, 2012
By
Adding a transparent image layer to a plot

The following example shows how to add a transparent image-type layer to a plot. The add.alpha function (below) simply adds transparency to a vector of colors which is then introduced in the "col" argument of an image plot. Read more »

Read more »

Working with Globcolour data

April 2, 2012
By
Working with Globcolour data

The Globcolour project (http://www.globcolour.info/) provides relatively easy access to ocean color remote sensing data. Data is provided at http://hermes.acri.fr/and the following parameters are available:· Chlorophyll-a (CHL1 and CHL2)· Fully normalised water leaving radiances at 412, 443, 490, 510, 531, 550-565, 620, 665-670, 681 and 709 nm (Lxxx)· Coloured dissolved and detrital...

Read more »

Add a frame to a map

April 2, 2012
By
Add a frame to a map

Here is a function that adds a frame of alternating colors to a map (un-projected). One defines the extension of each bar (in degrees) and an optional width of the bars (in inches). It uses the "joinPolys" function of the package to trim the bars near the map corners where the axes meet.the map.frame...

Read more »

Canonical Correlation Analysis for finding patterns in coupled fields

March 25, 2012
By
Canonical Correlation Analysis for finding patterns in coupled fields

First CCA pattern of Sea Level Pressure (SLP) and Sea Surface Temperature (SST) monthly anomalies for the region between -180 °W to -70 °W and +30 °N to -30 °S. The following post demonstrates the use of Canonical Correlation Analysis (CCA) for diagnosing coupled patterns in climate fields....

Read more »

Exponentiation of a matrix (including pseudoinverse)

March 22, 2012
By
Exponentiation of a matrix (including pseudoinverse)

The following function "exp.mat" allows for the exponentiation of a matrix (i.e. calculation of a matrix to a given power). The function follows three steps:1) Singular Value Decomposition (SVD) of the matrix2) Exponentiation of the singular values3) Re-calculation of the matrix with the new singular valuesThe most common case where the method is applied...

Read more »

A ridiculous proof of concept: xyz interpolation

March 14, 2012
By
A ridiculous proof of concept: xyz interpolation

Ridiculous OrbThis is really the last one on this theme for a while... I had alluded to a combination of methods regarding xyz interpolation at the end of my last post and wanted to demonstrate this in a final example.The ridiculousness that you see above involved two interpolation steps. First,...

Read more »

XYZ geographic data interpolation, part 3

March 12, 2012
By
XYZ geographic data interpolation, part 3

This will be probably be a final posting on interpolation of xyz data as I believe I have come to some conclusions to my original issues. I show three methods of xyz interpolation:1. The quick and dirty method of interpolating projected xyz points (bi-linear)2. Interpolation using Cartesian coordinates (bi-linear)3. Interpolation using spherical coordinates and...

Read more »

XYZ geographic data interpolation, part 2

February 29, 2012
By
XYZ geographic data interpolation, part 2

Having recently received a comment on a post regarding geographic xyz data interpolation, I decided to return to my original "xyz.map" function and open it up for easier interpretation. This should make the method easier to adapt and follow.The above graph shows the distance to Mecca as interpolated from 1000 randomly generated lat/lon...

Read more »

Maximal Information Coefficient (MIC)

December 19, 2011
By
Maximal Information Coefficient (MIC)

Pearson r correlation coefficients for various distributions of paired data (Credit: Denis Boigelot, Wikimedia Commons)A paper published this week in Science outlines a new statistic called the maximal information coefficient (MIC), which is able to equally describe the correlation between paired variables regardless of linear or nonlinear relationship. In...

Read more »