# Pulsars and neutron stars/Statistical and analysis methods for pulsar research

## Introduction

Pulsar searching and timing requires the analysis of time series of data. In this section we present commonly used equations, algorithms, numerical methods, methodologies and routines.

## Basic time series analysis

We assume that we have a time series of ${\displaystyle N}$ samples. Each sample, ${\displaystyle j}$, has a time ${\displaystyle t_{j}}$ and its value ${\displaystyle y_{j}}$. The mean of the values (note that we are starting the element counter from zero):

${\displaystyle {\bar {y_{j}}}={\frac {1}{N}}\sum _{j=0}^{N-1}y_{j}}$

The standard deviation represents the amount of variation in a data set.

${\displaystyle \sigma ={\sqrt {{\frac {1}{N}}\sum _{j=0}^{N-1}(y_{i}-{\bar {y}})^{2}}}}$

This can also be calculated using:

${\displaystyle \sigma ={\sqrt {\left({\frac {1}{N}}\sum _{j=0}^{N-1}x_{i}^{2}\right)-\left({\frac {1}{N}}\sum _{j=0}^{N-1}y_{i}\right)^{2}}}}$

## Distributions

### ${\displaystyle \chi ^{2}}$-distribution

The ${\displaystyle \chi ^{2}}$-distribution is defined by the number of degrees of freedom, ${\displaystyle k}$. The mean of the distribution is ${\displaystyle k}$ and the variance ${\displaystyle 2k}$. For a power-spectrum estimate the distribution of each point is given by a ${\displaystyle \chi ^{2}}$-distribution with 2 degrees-of-freedom (corresponding to an exponential distribution with the rate parameter ${\displaystyle \lambda =0.5}$):

${\displaystyle p(x)={\frac {1}{2}}e^{-x/2}.}$

The mean of this is 2 and the variance is 4. It is common to normalise the distribution so that the mean=1. The normalised chisquare(2) has ${\displaystyle p(x)=e^{-x}}$ which has a mean=1 and variance=1. The 95% confidence limits are 0.025 and 3.67.

## Fourier transforms and power spectra

### The Discrete Fourier Transform (DFT)

For a regularly sampled time series of values ${\displaystyle y_{j}}$ of N data points, the discrete Fourier transform (DFT) is:

${\displaystyle F_{k}=\sum _{j=0}^{N-1}y_{j}\exp \left(-2\pi {\sqrt {-1}}jk/N\right)}$

(Note that this is the definition that is used in the forward transform for the fftw libraries). Note that the ${\displaystyle F_{k}}$ values are complex:

${\displaystyle F_{k}=R_{k}+iI_{k}.}$

Note that for pulsar searching it is common to normalise all the Fourier coefficients, ${\displaystyle F_{k}}$ by the factor (see Ransom et al. 2012)

${\displaystyle \gamma =(N{\bar {y_{j}^{2}}})^{1/2}}$