This documentation is for astroML version 0.2

This page


astroML Mailing List

GitHub Issue Tracker


Scipy 2012 (15 minute talk)

Scipy 2013 (20 minute talk)


If you use the software, please consider citing astroML. astroML.time_series.generate_damped_RW

astroML.time_series.generate_damped_RW(t_rest, tau=300.0, z=2.0, xmean=0, SFinf=0.3, random_state=None)

Generate a damped random walk light curve

This uses a damped random walk model to generate a light curve similar to that of a QSO [R19].

Parameters :

t_rest : array_like

rest-frame time. Should be in increasing order

tau : float

relaxation time

z : float


xmean : float (optional)

mean value of random walk; default=0

SFinf : float (optional

Structure function at infinity; default=0.3

random_state : None, int, or np.random.RandomState instance (optional)

random seed or random number generator

Returns :

x : ndarray

the sampled values corresponding to times t_rest


The differential equation is (with t = time/tau):

dX = -X(t) * dt + sigma * sqrt(tau) * e(t) * sqrt(dt) + b * tau * dt

where e(t) is white noise with zero mean and unit variance, and

Xmean = b * tau SFinf = sigma * sqrt(tau / 2)


dX(t) = -X(t) * dt + sqrt(2) * SFint * e(t) * sqrt(dt) + Xmean * dt


[R19](1, 2) Kelly, B., Bechtold, J. & Siemiginowska, A. (2009) Are the Variations in Quasar Optical Flux Driven by Thermal Fluctuations? ApJ 698:895 (2009)