# flynn.gg

## Christopher Flynn

Data Scientist
Data Engineer
PhD Mathematician

Home
Projects
Open Source
Blog
Résumé

GitHub

# Blog

## Colored Noise and Inverse Gaussians

About seven months ago I spent a week or two putting together the initial iteration of the stochastic python package for generating realizations of a variety of random processes. After the first release I put together a TODO list of additional processes to add but never got around to building them out.

Recently, the project was forked a few times and I thought maybe I should continue working on it. One of the features I had wanted to add was the ability to generate power-law noise or so-called “colored” noise. Colored noise describes a signal that has power spectral density which is proportional to the power law, $$1 / f^\beta$$. Many of these signals are more commonly known by their colors, e.g. white noise, pink noise, brown noise, etc.

Creating colored noise signals involves constructing the power spectral density according to the power law, applying complex Gaussian noise, and then taking the inverse Fourier transform to generate a signal in the time domain. The specific algorithm can be found in this paper. The stochastic package provides support for violet, blue, white, pink, red, and brown noise, as well as a generic ColoredNoise class in which one can specify their own power-law exponent.

In a recent blog post I discussed adding support for multifractional Brownian motion to my other package fbm. I’ve converted this process to the stochastic as well, although the interface is slightly different. Multifractional Brownian motion generalizes fractional Brownian motion, in that the Hurst parameter can vary with respect to time, i.e.

$$B^H_t \mid H = H(t) \in (0, 1), \forall t \geq 0$$

Lastly, I’ve added the inverse Gaussian process to stochastic. The inverse Gaussian distribution is related to Brownian motion in that it describes the first passage time for a Brownian motion (with drift) to reach a certain fixed value. The inverse Gaussian process is one in which the increments are independent inverse Gaussian distributed random variables, in which the parameters are defined by a monotonically increasing function $$\Gamma$$, e.g.

$$t - s \sim \mathcal{IG}(\Gamma(t) - \Gamma(s), \eta(\Gamma(t) - \Gamma(s))^2)$$

The inverse Gaussian process is used in degradation models. 