Articles by andrew

Earthquakes: Land / Ocean Distribution

April 13, 2014 | andrew

The next stage in my earthquake analysis project is to partition the events into groups with epicentre over land or water. Since our existing catalog contains the latitude and longitude for the epicentres, it was a relatively simple matter to pipe these into gmtselect and label the events accordingly. The ... [Read more...]

Largest Volcanoes in Recorded History (and other statistics)

April 11, 2014 | andrew

Around 199 years ago the largest volcano in recorded history, Mount Tambora, erupted, spewing an enormous volume of molten rock and ash into the atmosphere and onto the surrounding land. How is the intensity of a volcanic eruption quantified? Most people know about the Richter Scale which quantifies the energy released ... [Read more...]

Earthquake Magnitude / Depth Chart

April 7, 2014 | andrew

I am working on a project related to secondary effects of earthquakes. To guide me in the analysis I need a chart showing the location, magnitude and depth of recent earthquakes. There are a host of such charts available already, but since I had the required data on hand, it ... [Read more...]

Daylight Saving Effect on S&P500 and FTSE100

April 1, 2014 | andrew

Does the transition to and from Daylight Saving Time (DST) have a (significant) effect on the stock market? In a recent blog post on The UK Stock Market Almanac, the author found that the average return of the FTSE100 index for the days following the start of British Summer Time (... [Read more...]

Filtering Data with L1 Regularisation

March 27, 2014 | andrew

A few days ago I posted about Filtering Data with L2 Regularisation. Today I am going to explore the other filtering technique described in the paper by Tung-Lam Dao. This is similar to the filter discussed in my previous post, but uses a slightly different objective function: where the regularisation ... [Read more...]

Filtering Data with L2 Regularisation

March 25, 2014 | andrew

I have just finished reading Momentum Strategies with L1 Filter by Tung-Lam Dao. The smoothing results presented in this paper are interesting and I thought it would be cool to implement the L1 and L2 filtering schemes in R. We’ll start with the L2 scheme here because it has ... [Read more...]

How Much Time to Conceive?

January 12, 2014 | andrew

This morning my wife presented me with a rather interesting statistic: a healthy couple has a 25% chance of conception every month [1], and that this should result in a 75% to 85% chance of conception after a year. This sounded rather interesting and it occurred to me that it really can’t be ... [Read more...]

Processing EXIF Data

December 15, 2013 | andrew

I got quite inspired by the EXIF with R post on the Timely Portfolio blog and decided to do a similar analysis with my photographic database. The Data The EXIF data were dumped using exiftool. This command uses some of the powerful features of the bash shell. If you are ... [Read more...]

Contour and Density Layers with ggmap

December 13, 2013 | andrew

I am busy working on a project which uses data from the World Wide Lightning Location Network (WWLLN). Specifically, I am trying to reproduce some of the results from Orville, Richard E, Gary R. Huffines, John Nielsen-Gammon, Renyi Zhang, Brandon Ely, Scott Steiger, Stephen Phillips, Steve Allen, and William Read. 2001. “... [Read more...]

Deriving a Priority Queue from a Plain Vanilla Queue

November 25, 2013 | andrew

Following up on my recent post about implementing a queue as a reference class, I am going to derive a Priority Queue class. Inheritance The syntax for Reference Class inheritance is quite intuitive. We need to modify only two of the methods. The most important of these is insert(), which ... [Read more...]

Implementing a Queue as a Reference Class

November 24, 2013 | andrew

I am working on a simulation for an Automatic Repeat-reQuest (ARQ) algorithm. After trying various options, I concluded that I would need an implementation of a queue to make this problem tractable. R does not have a native queue data structure, so this seemed like a good opportunity to implement ... [Read more...]

Iterators in R

November 13, 2013 | andrew

According to Wikipedia, an iterator is “an object that enables a programmer to traverse a container”. A collection of items (stashed in a container) can be thought of as being “iterable” if there is a logical progression from one element to the next (so a list is iterable, while a ... [Read more...]

Introduction to Fractals

November 3, 2013 | andrew

A short while ago I was contracted to write a short piece entitled “Introduction to Fractals”. The article can be found here. Admittedly it is hard to do justice to the topic in less than 1000 words. Both of the illustrations were created with R. Mandelbrot Set The Mandelbrot Set image ... [Read more...]

Percolation Threshold: Including Next-Nearest Neighbours

November 1, 2013 | andrew

In my previous post about estimating the Percolation Threshold on a square lattice, I only considered flow from a given cell to its four nearest neighbours. It is a relatively simple matter to extend the recursive flow algorithm to include other configurations as well. Malarz and Galam (2005) considered the problem ... [Read more...]

Percolation Threshold on a Square Lattice

October 29, 2013 | andrew

Manfred Schroeder touches on the topic of percolation a number of times in his encyclopaedic book on fractals (Schroeder, M. (1991). Fractals, Chaos, Power Laws: Minutes from an Infinite Paradise. W H Freeman & Company.). Percolation has numerous practical applications, the most interesting of which (from my perspective) is the flow of ... [Read more...]

Plotting Times of Discrete Events

October 19, 2013 | andrew

I recently enjoyed reading O’Hara, R. B., & Kotze, D. J. (2010). Do not log-transform count data. Methods in Ecology and Evolution, 1(2), 118–122. doi:10.1111/j.2041-210X.2010.00021.x. The article prompted me to think about processes involving discrete events and how these might be presented graphically. I am not talking about counts (... [Read more...]

Applying an Operation to a List of Variables

October 14, 2013 | andrew

Just a quick note on a short hack that I cobbled together this morning. I have an analysis where I need to perform the same set of operations to a list of variables. In order to do this in a compact and robust way, I wanted to write a loop ... [Read more...]

Top 250 Movies at IMDb

October 2, 2013 | andrew

Some years ago I allowed myself to accept a challenge to read the Top 100 Novels of All Time (complete list here). This list was put together by Richard Lacayo and Lev Grossman at Time Magazine. To start with I could tick off a number of books that I had already ... [Read more...]

Citations for using Stan?

September 23, 2013 | andrew

Bob writes: If you have papers that have used Stan, we’d love to hear about it. We finally got some submissions, so we’re going to start a list on the web site for 2.0 in earnest. You can either mail them to the list, to me directly, or just ...
[Read more...]
1 2 3 4 5 8

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)