Starting from:

$24.99

FIT2086 Assignment 2 Solution

1 Introduction
Submission Instructions: Please follow these submission instructions:
1. No files are to be submitted via e-mail. Submissions are to be made via Moodle.
The negative binomial distribution is a probability distribution for non-negative integers. It models the number of heads observed in a sequence of coin tosses until the r-th tail is observed. As such it is used widely throughout data science to model the number of times until some specific binary event occurs, i.e, the number of years between multiple natural disasters, etc. The version that we will look at has a probability mass function of the form
|v,r) = y + r − 1rr (ev + r)−r−y eyv (1)
p(y y
where y ∈ Z+, i.e., y can take on the values of non-negative integers. In this form it has two parameters: v, the log-mean of the distribution, and r, the number of tails we are waiting to observe. Often r is not treated as a learnable parameter, but rather is set by the user depending on the context. If a random variable follows a negative binomial distribution with log-mean v we say that Y ∼ NB(v,r). If Y ∼ NB(v,r), then E [Y ] = ev and V [Y ] = ev(ev + r)/r.
3. Take the negative logarithm of your likelihood expression and write down the negative loglikelihood of the data y under the negative binomial model with parameters v and r. Simplify this expression. [1 mark]
It is frequent in nature that animals express certain asymmetries in their behaviour patterns. It has been suggested that this might be nature’s way of “breaking gridlocks” that might occur if we were to act purely rationally (think: why does a beetle decide to move one way over another when put in a featureless bowl?).
3. Using R, calculate an exact p-value to test the above hypothesis. What does this p-value suggest?
Please provide the appropriate R command that you used to calculate your p-value. [1 mark]

More products