Right Now
I help boards and executives at growth-stage technology companies continue (or resume) rapid acceleration by advising them on improving their leadership capabilities, operations, and technology. While I specialize in executive advising on leadership and process, I can also dive into deep technical problems with Data Science or Software Engineering departments. Feel free to contact me directly to learn more.
I have a few tech projects in progress that will undoubtedly become blog posts. I’m working on an e-book about leadership in organizations, as well as a field manual for triaging performance and architecture in growth-stage startups. I sometimes write code for open-source projects like TinySite and CompressTest. I also work on ApplyByAPI, a tool that helps companies focus on quality over quantity in their tech hiring process.
Recent Publications
Market Commentary, Correlation, and Causation
Don’t be fooled, this isn’t market commentary. This is commentary about market commentary. Many times when we come across market commentary, we see horrible examples of confusing correlation and causation, the logical fallacy of post hoc ergo propter hoc wherein event B is said to be caused by event A simply because event B followed A. This fallacy can be found in the vast majority of market commentary, and is especially obvious on days where the market didn’t move appreciably, yet there is someone claiming to know why the move occurred. Today is a good example. The Dow Jones Industrial Average gained 75 points today, or 0.6%, which is well within normal market fluctuations. In other words, nothing happened in the market today. However, that did not stop anyone from trying to find an explanation for this nothingness. Over on The Street they attributed the 0.6% gain to a narrowing trade deficit in the last month, amongst other factors. ... read moreOn Technical Analysis, Fractals, and Stock Prices
I’ve been thinking recently about fractal geometry with applications to finance, and I talked to an acquaintance who informed me that he watches the “fractals” on his charts when trading. This prompted me to do some research into how technical analysts use “fractals” and see what kind of information such an indicator provides. There are many issues with using fractal behavior as a technical indicator, namely that the way the term is used in technical analysis doesn’t sound like it has anything to do with fractals at all. According to Investopedia, in technical analysis a fractal is defined as ... read moreComputing Ornstein-Uhlenbeck Process Trajectories in R
Compared to the Ruby version, computing this in R is much easier due to the built-in stochastic differential equation simulator. Assuming you have R installed, make sure you also install the sde package. Here is all the initial work that cleans up everything from your workspace, sets the initial value of the process, the end-point, how granular you want the simulation to be, and how many trajectories you want. rm(list = ls(all = TRUE)) x0 = 50 end_point = 200 discretization_factor = 100 total_steps = end_point * discretization_factor #Use the same seed for multiple trajectories if (number_trajectories > 1) number_trajectories = 1 set.seed(rnorm(1)) Here we have a 0 drift parameter and a standard deviation of 1, followed by the simulation and plot of the process. ... read moreComputing Ornstein-Uhlenbeck Process Trajectories in Ruby
This code is adapted from some Matlab code I found that simulates the OU process exactly. I had to code up a quick Gaussian random number generator in Ruby because I didn’t find a method to handle that. As noted in the comments I used the Box-Muller Transformation but if lots of random numbers are required the Ziggurat Algorithm could be used instead. #!/usr/bin/env ruby include Math require 'rubygems' require 'gnuplot' #Gaussian random number generator using the Box-Muller Transformation #If this is too slow it can be replaced with the Ziggurat Algorithm def randn z1 = rand z2 = rand rand_normal = sqrt(-2.0*log(z1))*sin(2.0*PI*z2) return rand_normal.to_f end #Enter the parameters for the simulation steps = 400 #start_time = 0 #simulation start time #end_time = 400 #simuation end time dt = 0.01 #time step tau = 0.1 #relaxation time c = 1.0 #diffusion constant x0 = 0.0 x = [] #initial value for stochastic variable x mu = 0.0 #mean of stochatic process x y0 = 0.0 y = [] #initial value for integral x start_dist = -2.0 #start of OU pdf end_dist = 2.0 #end of OU pdf time = (0..steps).step(dt) i = 0 x[0] = x0 y[0] = y0 time.each do |t| i = i + 1 r1 = randn r2 = randn puts x[i-1] x[i] = x[i-1] * exp(-dt/tau) + sqrt((c*tau*0.5)*(1-(exp(-dt/tau))**2))*r1 y[i] = y[i-1] + x[i-1]*tau*(1-exp(-dt/tau))+sqrt((c*tau**3*(dt/tau-2* \ (1-exp(-dt/tau))+0.5*(1-exp(-2*dt/tau))))-((0.5*c*tau**2)* \ (1-exp(-dt/tau))**2)**2/((c*tau/2)*(1-exp(-2*dt/tau))))*r2+ \ ((0.5*c*tau**2)*(1-exp(-dt/tau))**2)/(sqrt((c*tau/2)* \ (1-(exp(-dt/tau))**2)))*r1 end k = 0 j = (start_dist..end_dist).step(dt) p = [] j.each do |l| k = k + 1 p[k] = sqrt((1/tau)/(PI*c))*exp(-(1/tau)*(l-mu)**2/(c)) end That’s it. Not too difficult to compute with Ruby, but I also did another version in R. I’ll post about that shortly. ... read more