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 History Action Size Date Who Comment
PNGpng 723_479.png r1 manage 100.2 K 28 Jan 2016 - 14:56 ElenaCukanovaite  
PNGpng ML_eg.png r1 manage 96.9 K 27 Jan 2016 - 16:59 DavidHadden  
PNGpng a_cut_his.png r1 manage 27.7 K 28 Jan 2016 - 22:02 ElenaCukanovaite  
PNGpng a_hist.png r1 manage 31.6 K 28 Jan 2016 - 22:02 ElenaCukanovaite  
PNGpng background.png r1 manage 48.5 K 28 Jan 2016 - 14:01 ElenaCukanovaite  
PNGpng closeup_cooling_ring.png r1 manage 110.7 K 28 Jan 2016 - 13:59 ElenaCukanovaite  
PNGpng comparison.png r1 manage 396.3 K 28 Jan 2016 - 13:19 ElenaCukanovaite  
PNGpng cooling_ring.png r1 manage 453.4 K 28 Jan 2016 - 13:59 ElenaCukanovaite  
PNGpng curve_fit_eg.png r1 manage 106.0 K 27 Jan 2016 - 16:59 DavidHadden  
PNGpng df_first.png r1 manage 45.1 K 29 Jan 2016 - 00:31 ElenaCukanovaite  
PNGpng df_last.png r1 manage 43.5 K 29 Jan 2016 - 00:31 ElenaCukanovaite  
PNGpng first.png r1 manage 42.0 K 28 Jan 2016 - 15:22 ElenaCukanovaite  
PNGpng found_stars.png r1 manage 50.7 K 28 Jan 2016 - 14:10 ElenaCukanovaite  
PNGpng histogram_not_found.png r1 manage 28.9 K 29 Jan 2016 - 00:23 ElenaCukanovaite  
PNGpng hot_pixels_badly_stacked.png r1 manage 135.6 K 28 Jan 2016 - 13:22 ElenaCukanovaite  
PNGpng last.png r1 manage 44.0 K 28 Jan 2016 - 15:22 ElenaCukanovaite  
PNGpng median_30.png r1 manage 47.7 K 28 Jan 2016 - 18:55 ElenaCukanovaite  
PNGpng rho_hist.png r1 manage 27.4 K 28 Jan 2016 - 22:02 ElenaCukanovaite  
PNGpng sigma_x_hist.png r1 manage 27.1 K 28 Jan 2016 - 22:02 ElenaCukanovaite  
PNGpng sigma_x_hist_cut.png r1 manage 28.3 K 28 Jan 2016 - 22:02 ElenaCukanovaite  
PNGpng stacked_brightest.png r1 manage 100.6 K 28 Jan 2016 - 14:56 ElenaCukanovaite  
PNGpng stacked_image_alone.png r1 manage 439.4 K 28 Jan 2016 - 14:01 ElenaCukanovaite  
PNGpng typical_neigbours.png r1 manage 108.6 K 28 Jan 2016 - 15:06 ElenaCukanovaite  
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions

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 platform Powered by PerlCopyright © 2008-2023 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