Monthly Archives: May 2009

Colouring a 3D plot according to z-values

May 3, 2009
By
Colouring a 3D plot according to z-values

Here is a script that colors a 3D plot according to the z value (height) of each point. persp.withcol <- function(x,y,z,pal,nb.col,...,xlg=TRUE,ylg=TRUE) { colnames(z) <- y rownames(z) <- x nrz <- nrow(z) ncz <- ncol(z) color <- pal(nb.col) zfacet <- z + z + z + z facetcol <- cut(zfacet, nb.col) par(xlog=xlg,ylog=ylg)

Read more »

An algorithm to find local extrema in a vector

May 3, 2009
By
An algorithm to find local extrema in a vector

I spend some time looking for an algorithm to find local extrema in a vector (time series). The solution I used is to “walk” through the vector by step larger than 1, in order to retain only one value even when the values are very noisy (see the picture at the end of the post).

Read more »

Brad Mehldau at the CSO

Just got home from a wonderful concert by Brad Mehldau at the CSO. This was long overdue as I kept reading about Mehldau. And even though he performs quite regularly around here, I had never seen him. Big mistake. The first set was performed as a (strictly acoustic) trio with Larry Grenadier on bass and Jeff Ballard on drums. After several compositions...

Read more »

RSI(2) with Position Sizing

May 1, 2009
By
RSI(2) with Position Sizing

Though it's more than two weeks later, here's the second post in the series that will demonstrate how to build, test, and implement a trading strategy with R. You can find the first post here.The first post replicated this simple RSI(2) strategy from ...

Read more »