Tiago Ramalho AI research in Tokyo

Negative binomial with continuous parameters in python Nov 2013 by Tiago Ramalho So scipy doesn’t support a negative binomial for a continuous r parameter. The expression for its pdf is $P(k)=\frac{\Gamma(k+r)}{k!\,\Gamma(r)} (1-p)^rp^k$. I coded a small class which computes the pdf and is also able to find MLE estimates for p and k given some data. It relies on the mpmath arbitrary precision...
Automatic segmentation of microscopy images Nov 2013 by Tiago Ramalho A few months back I was posed the problem of automatically segmenting brightfield images of bacteria such as this: I thought this was a really simple problem so I started applying some filters to the image and playing with morphology operations. You can isolate dark spots in the image by...
How to import structured matlab data into python with scipy Nov 2013 by Tiago Ramalho So a few days ago I received this really nice data set from an experimental group in matlab format which contains a list of structs with some properties, some of which are structs themselves. I usually just open it in matlab using my university’s license and export the data as a...
How to simulate a model for a genetic oscillator Oct 2013 by Tiago Ramalho In the previous post, I showed how to efficiently solve SDEs using python. Today we will use that knowledge to explore a well known model in systems biology: the repressilator. The repressilator was described in detail by Elowitz and Leibler in Nature. It is essentially a simple way for a...
Solving stochastic differential equations with theano Oct 2013 by Tiago Ramalho In systems biology we often need to solve diffusion equations of the type  $$df = f(x,t) dt + g(x,t)dW$$ where W is a white noise process; they’re the most common example of a stochastic differential equation (SDE). There are only very few cases for which we can analytically solve this equation,...