Suppose we have three sets of random variables Wh, Xi, and Yj(for h= 1,...,k, i= 1,...,m, and j= 1,...,n) all of which aremutually independent. Assume that the three sets of randomvariables are all normally distributed with different means but thesame standard deviation. The MLE for the means are just the groupmeans and the MLE for the variance is the mean of the squarederrors of the observations from the groups when taking into accountthe group means. Write a function to fit the this model to threeobserved data vectors w, x, y and return both the MLE andlog-likelihood evaluated at the MLE. Use the commands
data("iris")
w = iris$Sepal.Width[iris$Sepecies=="setosa"]
x = iris$Sepal.Width[iris$Sepecies=="versicolor"]
y = iris$Sepal.Width[iris$Sepecies=="virginica"]
to make some data to analyze using your function. Compare theresults from analyzing the data with the model for difference meansto the results from analyzing the data when it would be assumedthat the means are all the same. Comment on your results.