Python代写-ECON3209-Assignment 2
时间:2022-04-15
ECON3209: Statistics for Econometrics
Assignment 2
INSTRUCTIONS
Due date and time: FRIDAY WEEK 9 by 05:00PM
Total weight in final assessment: 15%
Total marks for the assessment: 40. Each question part has equal mark value.
Marking: Marks will be awarded for correct working and explanation as well as correct
final answers. Students are allowed to work in groups. However, each student MUST
hand in their own work in their own words. Plagiarism is a university offence and will be
checked.
Submission: Students must submit 1 electronic copy of their assignment. The electronic
copy is to be submitted to the course website via ‘Turnitin’ by the due date and time.
Upload a copy of your document as a PDF – do not paste text.
Assignment: The assignment must be produced using an appropriate word-processor
(no exceptions). The assignment must have a completed and signed official cover sheet
as the first page of the document. This can be found on the course website in the ‘course
documents’ folder. Each question (Question 1 and Question 2) should be started on a
new page. At the end of each question, you must provide a copy of the Python
programs requested.
CONTEXT & DATA
The Republic of Statistonia has many weather stations, which have recorded annual rainfall
over many years. The assignment questions below ask you to analyze rainfall data for one
weather station, to draw inferences and discuss results. To undertake the analysis you will be
required to use Python.
A python Lab will be set up on Ed to help you with the Assignment coding!
The data set for all weather stations is contained in a Excel data file named Rainfall_data.xlsx,
which is located in the Assignment folder on Ed. Click on it to save in your own working
directory. The data set comprises 50 observations on annual rainfall (in metres) at each of the
weather stations. The first variable in the data set is the year and the remaining variables for
rainfall by weather station are labeled Rainfall1, Rainfall2, and so forth. Your weather station
data are identified by examining the file Stations.pdf, also located in the Assignment folder. It
lists student zIDs and the corresponding rainfall variable that you are to use. Copy your allocated
data in a new file and upload into Python for analysis.
1
Questions
[Each question part has equal mark value]
1. Suppose that random variable X ≥ 0, representing the annual rainfall (in metres) at your
weather station, has a Gamma distribution, i.e., X v Gamma(α, β), where α and β are
positive parameters. Below, we re-parameterize by using the parameter θ = 1/β.
(a) Use Python to describe your rainfall data series, by computing summary statistics,
and plotting the kernel density function. Explain and discuss these results, including
the nature and implications of the empirical distribution for rainfall at your weather
station.
(b) Estimate the parameters of the Gamma distribution by the method of maximum
likelihood, presenting your results (parameter estimates, standard errors, etc.) in
tabular form.
(c) Plot the estimated (using the maximum likelihood estimates) Gamma density for
rainfall. Using the estimated Gamma density for rainfall, compute estimates of the
probabilities of rainfall being (i) less than 70% of average annual rainfall (very dry),
(ii) more than 130% of average annual rainfall (very wet) and (iii) either (i) or (ii).
Discuss these results and their implications.
(d) Use the likelihood ratio test procedure to test the null hypothesis that θ = 1 (meaning
that the population mean and variance are equal) against the alternative hypothesis
that θ 6= 1 using a 5% significance level. Your answer should provide full details of the
logic used and your conclusion. [Hint: To estimate the model with θ = 1, replace
‘{theta}’ by ‘1’ in the estimation command.]
Include your Python program(s) at the end of your answers to this question.
2. Again, suppose that random variable X ≥ 0, representing the annual rainfall (in metres)
at your weather station, has a Gamma distribution, i.e., X v Gamma(α, β), where α
and β are positive parameters.
(a) Obtain the method of moments estimates for the two parameters. Using these esti-
mates, calculate estimates of the population mean and standard deviation.
(b) Construct and undertake a Bootstrap simulation of the model to determine the small
sample (n = 50) properties of the method of moments estimators of α and β for your
rainfall data. Provide a summary table for the simulation results, describing and
explaining its contents.
(c) Present a table of your results for the method of moments parameter estimates
based upon your rainfall data and their bootstrap standard errors. Explain how you
obtained the bootstrap standard errors.
(d) Plot the kernel density function, along with the normal density, for each of the
parameter estimates obtained from the simulation. What do these results tell you
about the distribution for the method of moments estimators for annual rainfall and
the implications for hypothesis testing?
Include your Python program(s) at the end of your answers to this question.
—————————————————————————————————–
2

essay、essay代写