logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Expert MasterManagement
(5/5)

682 Answers

Hire Me
expert
Charles MorrisEnglish
(5/5)

563 Answers

Hire Me
expert
Hemidov MuradManagement
(5/5)

545 Answers

Hire Me
expert
Kevin BatessAccounting
(5/5)

981 Answers

Hire Me
R Programming
(5/5)

Calculate the mean and the standard deviation of the number of goals

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Data

The spreadsheet CLGoals.xlsx contains the number of goals scored in each UEFA Champions League game to date this season (three-match weeks of sixteen games). The data are count data that take the values 0, 1, 2,...

Modeling

Poisson Model

The Poisson distribution is probably the most standard model for count data.

The Poisson model, with parameter λ, assumes that

λxe−λ

P{X = x} = x! .

Thus, P  X = 0  = exp(   λ), P  X = 1   = λ exp(   λ), P  X = 2   = λ2 exp(   λ)/2, ...

The expected value (mean) of the Poisson distribution is λ and the variance is also λ (thus, the standard deviation is √λ).

Hurdle Model

The Hurdle model, with parameters θ and λ, assumes thatP{X = x} = (1θ) λxe−λ x!(1−e−λ)if x = 1, 2, ... Thus, P  X = 0   = θ, P  X = 1   = (1 θ)λ exp(   λ)/(1 exp( λ)), ...

If θ = e−λ  then the Hurdle model is the same as the Poisson model.  If θ < e−λ, then zeros are less likely than under a Poisson model. If θ > e−λ, then zeros are more likely than under a Poisson model.

Likelihood

The likelihood function is defined to be the probability of the observed data for a given parameter value. If we have independent observations x1, x2, . . . , xn, then the likelihood is n L =P{X = xi}.i=1The log-likelihood is the (natural) logarithm of the likelihood, thus it takes the formn ℓ = log L =log P{X = xi}.i=1

 Task 1: Exploring

1.Read the data into R.

Hint: The read.xlsx() function in the openxlsx R package is useful for doing this.

2.Produce a table that tabulates frequency of each number of goals.

3.Produce a plot of the frequency of each number of goals.

4.Calculate the mean and the standard deviation of the number of goals.

Task 2a: Poisson Modelling

1.Write a function that calculates the log-likelihood function (for a specified value of λ) for the Poisson model for the UEFA Champions League data.

2.Plot the log-likelihood function for a range of values of λ. Hint: Make sure that λ = x is in the range.

3.Add a vertical line to the plot at the value x and visually verify that this maximizes the log-likelihood function.

4.Simulate 48 values from a Poisson model with λ = x and summarize the resulting values (contrasting them with the summaries produced in Task 1).

5.Simulate 48 values from a Poisson model for other values of λ and summarize the resulting values (contrasting them with the summaries produced in Task 1).

Task 2b: Hurdle Modelling

1.Create a dHurdle() function that has arguments x, param that computes P   X = x   for the Hurdle model, where the first element of the vector param is θ and the second element of the vector param is λ. Ensure that the function can handle x being a vector of values.

2.Write a function that calculates the log-likelihood function (for a specified value of param) for the Hurdle model for the UEFA Champions League goal data.

3.Use the optim function to find the value of θ and λ that maximizes the log-likelihood.

Hint: optim minimizes functions, by default, so you may want to write a function that computes minus the log-likelihood and minimize that.

Alternatively, you can set control=list(fnscale=-1) as an argument in optim to make it maximize.

4.Comment on the value of θ found and compare the log-likelihood values found for the Poisson and Hurdle models.

 

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme