Goodness-of-fit with maximum likelihood progress

  • Curve_fit fitting used the following equation:
  \begin{equation} f(x,y,\mu_x,\mu_y,\sigma_x,\sigma_y,\rho,a,d) = \frac{a}{2\pi\sigma_x\sigma_y\sqrt{(1-\rho^2)}} \exp \Bigg\{-\frac{1}{2(1-\rho^2)}\Bigg[\bigg(\frac{x-\mu_x}{\sigma_x}\bigg)^2 + \bigg(\frac{y-\mu_y}{\sigma_y}\bigg)^2 -2\rho\bigg(\frac{x-\mu_x}{\sigma_x}\bigg)\bigg(\frac{y-\mu_y}{\sigma_y}\bigg)\Bigg]\Bigg\}  \end{equation}  <br />

  • For maximum likelihood we minimized the following $\chi^2$:
  \begin{equation} f(x,y,\vec{\theta}) = \frac{\alpha}{2\pi\sigma_x\sigma_y\sqrt{(1-\rho^2)}} exp\Bigg\{-\frac{1}{2(1-\rho^2)}\Bigg[\bigg(\frac{x-\mu_x}{\sigma_x}\bigg)^2 + \bigg(\frac{y-\mu_y}{\sigma_y}\bigg)^2 -2\rho\bigg(\frac{x-\mu_x}{\sigma_x}\bigg)\bigg(\frac{y-\mu_y}{\sigma_y}\bigg)\Bigg]\Bigg\} + \frac{1-\alpha}{N*M}  \end{equation}  <br />

  \begin{equation} \nu_{ij} = n_{\rm{tot}} \int \int_{ij} f(x,y,\vec{\theta}) dx dy  \end{equation}  <br />

  \begin{equation} \chi^2_P = 2 \sum^{N,M}_{i, j=1} \left( n_{ij} \ln \frac{n_{ij}}{\nu_{ij}} + \nu_{ij} - n_{ij} \right)  \end{equation}  <br />
  • Due to large runtimes for maximum likelihood code, set about comparing it to curve_fit in terms of parameters and $\chi^2$'s.
  • This gave the following plots and $\chi^2$'s
ML_eg.pngcurve_fit_eg.png

These gave the following parameters:

Parameters Maximum Likelihood Curve_fit
$\rho$ $0.11$ $0.107 \pm 0.005$
$a$ N/A $9424522 \pm 45443$
$x_c$ $30.2$ $30.2 \pm 0.02$
$y_c$ $31.7$ $31.7 \pm 0.02$
$\sigma_x$ $4.30$ $4.22 \pm 0.02$
$\sigma_y$ $4.78$ $4.56 \pm 0.02$
$\alpha$ $0.80$ N/A
$d$ N/A $620 \pm 6.5$
$\chi^2_r$ $249$ $273$
  • Where $\chi^2_r$ was calculated using the equation below for $i^{th}$ and $j^{th}$ pixels.

Monte Carlo simulation

  • Reduced the size of the area over which the Gaussian was calculated.
  • Randomly sampled values from curve_fit fitted stars in one of the images.
  • The following plots show the distributions for the parameters sampled.
a_hist.png a_cut_his.png
sigma_x_hist.png sigma_x_hist_cut.png
rho_hist.png
  • Generated 100 images.
  • Ran them through the finding algorithm.
  • 1 image could not be processed by the algorithm due to the threshold.
  • 99 images were analysed.
  • Histogram below shows the number of stars that were not detected.
histogram_not_found.png
  • Median of not found stars is 4 stars.

Bias and Dark Frame

  • Ran the background algorithm to see if the bias and dark frames showed the gradual heating from the instrumentation of the camera.
  • It did. Below are the first and last bias and dark frames we took.
first.png

last.png

df_first.png df_last.png
median_30.png

Stacking images

  • Wrote an algorithm to stack images.
  • The algorithms takes in 3 star coordinates from our 'base' image.
  • These stars are then located in subsequent images.
  • Shifts in x and y are calculated.
  • The images are the shifted one by one, and added to the base image.
  • The following plot compares our base image with the final stacked image:
comparison.png
  • Although more stars can be seen, we observed that hot pixels were not perfectly stacked creating the following shapes:
hot_pixels_badly_stacked.png
  • We think this might be due to rotation.
  • We observed that the cooling ring did in fact get bigger the longer the telescope was on.
  • So when stacked the cooling ring appeared as two rings as shown below.
cooling_ring.png

closeup_cooling_ring.png

  • The stacked image was ran through the finding algorithm.
  • The following stars were located:
stacked_image_alone.png background.png
found_stars.png
  • Found 98 stars, as supposed to 45 stars in 'base' image.
  • Below the curve_fit fitting is compared for a base image and for the stacked image (The coordinates do not correspond due to shifting).
723_479.png stacked_brightest.png
  • The $\chi^2$ are shown below:
  Unstacked star fit Stacked star fit
$\chi^2$ $933.25638302$ $2595.29792037$
  • The $\chi^2$ is probably bad due to Poissonian errors being to small and this is more prominent when the star is brighter as it is in the stacked image.
  • Although, some fitting has improved, another problem is that more neighbouring stars appeared and therefore a typical fit looks like this:
typical_neigbours.png

-- DavidHadden - 27 Jan 2016

Topic attachments
I Attachment Action Size Date Who Comment
PNGpng 723_479.png manage 100.2 K 28 Jan 2016 - 14:56 ElenaCukanovaite  
PNGpng ML_eg.png manage 96.9 K 27 Jan 2016 - 16:59 DavidHadden  
PNGpng a_cut_his.png manage 27.7 K 28 Jan 2016 - 22:02 ElenaCukanovaite  
PNGpng a_hist.png manage 31.6 K 28 Jan 2016 - 22:02 ElenaCukanovaite  
PNGpng background.png manage 48.5 K 28 Jan 2016 - 14:01 ElenaCukanovaite  
PNGpng closeup_cooling_ring.png manage 110.7 K 28 Jan 2016 - 13:59 ElenaCukanovaite  
PNGpng comparison.png manage 396.3 K 28 Jan 2016 - 13:19 ElenaCukanovaite  
PNGpng cooling_ring.png manage 453.4 K 28 Jan 2016 - 13:59 ElenaCukanovaite  
PNGpng curve_fit_eg.png manage 106.0 K 27 Jan 2016 - 16:59 DavidHadden  
PNGpng df_first.png manage 45.1 K 29 Jan 2016 - 00:31 ElenaCukanovaite  
PNGpng df_last.png manage 43.5 K 29 Jan 2016 - 00:31 ElenaCukanovaite  
PNGpng first.png manage 42.0 K 28 Jan 2016 - 15:22 ElenaCukanovaite  
PNGpng found_stars.png manage 50.7 K 28 Jan 2016 - 14:10 ElenaCukanovaite  
PNGpng histogram_not_found.png manage 28.9 K 29 Jan 2016 - 00:23 ElenaCukanovaite  
PNGpng hot_pixels_badly_stacked.png manage 135.6 K 28 Jan 2016 - 13:22 ElenaCukanovaite  
PNGpng last.png manage 44.0 K 28 Jan 2016 - 15:22 ElenaCukanovaite  
PNGpng median_30.png manage 47.7 K 28 Jan 2016 - 18:55 ElenaCukanovaite  
PNGpng rho_hist.png manage 27.4 K 28 Jan 2016 - 22:02 ElenaCukanovaite  
PNGpng sigma_x_hist.png manage 27.1 K 28 Jan 2016 - 22:02 ElenaCukanovaite  
PNGpng sigma_x_hist_cut.png manage 28.3 K 28 Jan 2016 - 22:02 ElenaCukanovaite  
PNGpng stacked_brightest.png manage 100.6 K 28 Jan 2016 - 14:56 ElenaCukanovaite  
PNGpng stacked_image_alone.png manage 439.4 K 28 Jan 2016 - 14:01 ElenaCukanovaite  
PNGpng typical_neigbours.png manage 108.6 K 28 Jan 2016 - 15:06 ElenaCukanovaite  

Physics WebpagesRHUL WebpagesCampus Connect • Royal Holloway, University of London, Egham, Surrey TW20 0EX; Tel/Fax +44 (0)1784 434455/437520

Topic revision: r7 - 11 Feb 2016 - GlenCowan

 
This site is powered by the TWiki collaboration platformCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding RHUL Physics Department TWiki? Send feedback