本次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.

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

*v *= *a*0 + *a*1*t** *+ *a*2 sin(*a*4*t*) + *a*3 cos(*a*4*t*) (1)

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

- Setting
*a*0 = 0,*a*1 = 1,*a*2 = 1,*a*3 = 1 and*a*4 = 0, simulate a data set from times*t*= 20

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

- 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?
- (advanced) Show that the following is a re-parameterisation of Equation 1:

*v *= *a*0 + *a*1*t *+ *a*2 sin(*a*3*t *+ *a*4) (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 *a*0 and *a*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
*a*2. What is it?

Include all python code in your assignment.

1