I have to use the Inversion Sampling Method to generate a random sample of 100 from the function $f(x)=\theta x^{\theta - 1}$ if $\theta =5$. Here is my function so far:
X = function(n)
{
U = runif(n)
sample = (U/5)^{1/4}
return(sample)
}
So I get $100$ random values when I input $X(100)$. Now I have to use this data to find an estimate for $\theta = 5$. Where do I go from here? Do I make a histogram?
You can derive the MLE estimator, i.e., $$ L(\theta; X) = \theta ^n ( \prod x_i )^{\theta - 1 } , $$ the log-likelihood is $$ l(\theta) = n \ln \theta+(\theta - 1)\sum\ln x_i, $$ $$ l'(\theta) = \frac{n}{\theta} + \sum\ln x_i = 0, $$ hence the MLE is $$ \hat{\theta}_{ML}=- \frac{n}{\sum \ln x_i}. $$ Verifying that it indeed maximizes the likelihood,
$$ l''(\hat{\theta}) = - \frac{ n }{\hat{\theta}_{ML}} < 0. $$