Python Assignment emcee (Python代写,Australian National University代写,澳洲程序代写)

In this assignment you will use emcee in python

联系我们
微信: biyeprodaixie 欢迎联系咨询

本次CS代写的主要涉及如下领域: Python代写,Australian National University代写,澳洲程序代写

Python Assignment

In this assignment you will use emcee in python (http://dfm.io/emcee/current/) or on github. You will simulate a periodic data set and fit a function to it. This could be e.g. a photometric dataset from Kepler, or a series of radial velocity points. Some skeleton code (with many gaps!) is included on the course website.

 

  1. Create a function using python and numpy that simulates data that take a periodic function with a form:

 

 

v = a0 + a1t + a2 sin(a4t) + a3 cos(a4t)                            (1)

 

You should simulate data at a number of random times over an interval, and include Gaussian errors for the data. The inputs ai should take the form of a 1-dimensional python array.

  1. Setting a0 = 0, a1 = 1, a2 = 1, a3 = 1 and a4 = 0, simulate a data set from times t = 20

to t = 35, containing 100 points with Gaussian errors with uncertainty 0.5.

  1. Use emcee to fit to this dataset. Plot histograms of the fitted parameters - do the results make sense? Are any of the parameter fits correlated?
  2. (advanced) Show that the following is a re-parameterisation of Equation 1:

 

 

v = a0 + a1t + a2 sin(a3t + a4)                                 (2)

 

Which is better - equation (1) or equation (2) for a reliable run of emee, and why? Is there a way the equation could have been re-parameterised to remove the correlation between a0 and a1?

  1. (extra mark) If Equation (2) is your model with uniform priors in all parameters but Equation (1) is used in emcee instead, this produces an implicit prior on a2. What is it?

Include all python code in your assignment.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1