Curve of the Theoretical Probability Density Function Management Assignment Help

Download Solution Order New Solution
Assignment Task
 

 

Task    

General instructions for homework: Homework must be submitted as pdf file, and be sure to include
your name in the file. Give the commands to answer each question in its own code block, which will also
produce plots that will be automatically embedded in the output file. Each answer must be supported by
written statements as well as any code used. (Examining your various objects in the “Environment” section
of RStudio is insufficient – you must use scripted commands.)
In lecture, we fit a gamma distribution to the weight of cat’s hearts. We did this by adjusting the parameters
so that the theoretical values of the mean and variance matched the observed, sample mean and variance.
Since the mean and variance are the first two moments of the distribution, this is an example of the method
of moments for estimation.
The method of moments gives a point estimate ˆ? of the parameters ?. To use a point estimate, we need to
know how precise it is, i.e., how different it would be if we repeated the experiment with new data from the
same population. We often measure imprecision by the standard error, which is the standard deviation of the
point estimates ˆ?. (You saw the standard error of the mean in your introductory statistics classes, but we are
not computing the standard error of the mean here.)
If we actually did the experiment many times, getting many values of ˆ?, we could take their standard deviation
as the standard error. With only one data set, we need to do something else. There is usually no simple
formula for standard errors of most estimates, the way there is for the standard error of the mean. Instead, we
will see how to approximate the standard error of for our estimate of the gamma distribution computationally.
We can draw random values from a gamma distribution using the rgamma() function. For example,
rgamma(n=35,shape=0.57,scale=15) would generate a vector of 35 random values, drawn from the gamma
distribution with “shape” parameter a = 0.57 and “scale” s = 15. By applying the estimator to random
samples drawn from the distribution, we can see how much the estimates will change purely due to noise.
Part I - Estimates and standard errors
1. Write a function, gamma.est, which takes as input a vector of data values, and returns a vector
containing the two estimated parameters of the gamma distribution, with components named shape
and scale as appropriate.
2. Verify that your function implements the appropriate formulas by showing that it matches the results
from lecture for the cat heart data.
3. Generate a vector containing ten thousand random values from the gamma distribution with a = 19
and s = 0.56. What are the theoretical values of the mean and of the variance? What are their sample
values?
4. Plot the histogram of the random values, and add the curve of the theoretical probability density
function.
5. Apply your gamma.est function to your random sample. Report the estimated parameters and how far
they are from the true values
 

 


This Management Assignment has been solved by our Management Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
    
Be it a used or new solution, the quality of the work submitted by our assignment Experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.