IMPRS Summer School 2009: Statistical Inferences from Astronomical Data

Lab Exercises for the lectures of Ian McHardy assisted by Dimitrios Emmanoulopoulos

 

      

The main purpose of this lab is to familiarize the participants with the Monte Carlo techniques and enable them to produce simulated light curves having the same statistical properties with a real observed astronomical light curve.

Python requirements

Throughout the labs the participants are encouraged to use the Python programming language. The main packages that we are going to use are scipy, numpy in combination with mathplotlib (including pylab) for visualizing the results. The basic commands that we are going to use deal mainly with: array manipulation, basic mathematical and statistical computations (i.e. logarithms, mean values, standard deviations etc.), binning procedures, random number generation with a given distribution (Gaussian,, Poisson etc.), discrete Fourier transform (and inverse Fourier transform), operations with complex numbers, function definition (in a normal and piecewise form) and maybe some very basic numerical integration routines (i.e. simple Trapezoidal rule).

Since some of the participants may not be familiar with the Python language as a first step we provide them with a very simple program that enables them to produce artificial light curves having a given underlying Power Spectral Density function (PSD) following Timmer and Koenig, Astron.Astrophys. 300, 707-710 (1995). The program accepts as inputs:

  1. ld: the desired length of the data set

  2. lds: the length of the overall simulated long-light curve which is going to be chopped to the desired length, ld (in ordet to take into account the effect of "red noise leak")

  3. psdindexLow: the lower frequency PSD index

  4. psdindexHigh: the high frequency PSD index
  5. brkfreq: the frequency where the PSD breaks
  6. meanCR: mean count rate of the light curve (if needed)
  7. sdvCR: standard deviation of the light curve (if needed)
  8. randomSeed: random seed for the simulations (change it in order to produce different light curves with the same PSD)

The inputs 3,4,5 define an underlying PSD that has a broken power-law shape. Almost always the variability properties of AGN can be described from a power law with psdindexLow<psdindexHigh and values between 0 and 2.5. For the case psdindexLow=psdindexHigh the outcome is a light curve having a simple (i.e. not broken) power-law shape PSD.

It would be very useful for the school participants to experiment with the code by changing the input parameters (i.e. AGN-Seyfert like X-ray light curves psdindexLow=0.50 and psdindexHigh=2.50 or AGN-blazar like X-ray light curves psdindexLow=psdindexHigh=2.00). Also it is desirable that the participants play around with the various commands of the code in order to get a feeling for the Python language and even come up with a neater and faster version of it.  Keep in mind that  since the code is written in a very simple line-by-line form, in order to be unambiguous and easily understood by everyone, it is not optimized for speed and extended simulations. Most of the times several Python commands can be condensed in a single line (single-liners) but this is much more difficult to be understood by beginners. It would be very fruitful if there were any experts among the participants in Python to share their views and ideas with the rest of us.

Please find the python-program here which you can edit and change with any text editor.

Structure of the lab exercises

After the participants understand how to produce their own light curves having a given PSD as an input, they will be able to work on a series of exercises.

  1. Production of a simple periodogram of an artificial data set (the result should be in accordance with the input PSD)
  2. A more consistent estimator of the PSD using the binned logarithmic periodogram described in: Papadakis and Lawrence, Mon.Not.R.Astron.Soc. 261,612-624 (1993) (Sect.5.1)
  3. Production of autocorrelation functions, cross-correlation functions and structure functions
  4. rms/flux relations i.e.Uttley and McHardy, Mon.Not.R.Astron.Soc. 323,L26-L30 (2001)
  5. Effects of Poissonian noise (i.e. measurement uncertainties) and data gaps to all the aforementioned exercises
  6. (Time permitted) Very simple one parameter PSD fitting

 

I hope that this helps. Please contact me if you need anything anytime D.Emmanoulopoulos@soton.ac.uk. Since I am going to be away for a couple of days it may take some time to receive an answer...sorry :-(

CU in Heidelberg!