CS计算机代考程序代写 DATA MATH 363: Homework #11

DATA MATH 363: Homework #11
Due: Tuesday 4/6/2021 at 11:59PM (MST)
Maximum Likelihood Estimation
Problem 1. Let X1 and X2 be two independent measurements of some unknown value μ. In particular, let X1 and X2 be Normal random variables with mean μ and respective variances σ12 = 1/2 and σ2 = 1/20. Therefore, the densities are

1 2 10 2 fX1 (x1|μ) = √π exp(−(x1 − μ) ), fX2 (x2|μ) = √π exp(−10(x2 − μ) )
We will perform a maximum likelihood estimate calculation to determine which estimator, X1 or X2, is closer to μ.
(a). Determine the likelihood function L(μ|x1,x2) for the pair X1,X2. Recall: The likelihood function equals the joint density.
To complete this task, upload an image of your work by replacing “upload_image.jpg” with your appropriately titled .jpg file in the R chunk below.
(b). If the log-likelihood function (in simplified form) is ln(L(μ|x1,x2)) = ln􏰇√10􏰈−(x1−μ)2−10(x2−μ)2, π
then determine the maximum likelihood estimator μˆ for μ, where μˆ is a function of x1 and x2.
To complete this task, upload an image of your work by replacing “upload_image.jpg” with your appropriately titled .jpg file in the R chunk below.
1

(c). Verify that the MLE μˆ is a maximum by confirming ∂2 ln(L(μˆ|x , x )) < 0. ∂μ2 12 To do this task, enter the value of ∂2 ln(L(μˆ|x ,x )) by replacing FILL IN with the appropriate numerical ∂μ2 12 value. ∂2 ln(L(μˆ|x ,x )) = FILL IN < 0 ∂μ2 12 (d). If x1 = 3.11 and x2 = 3.22, then μˆ = 3.21. Verify this value. Enter your response as text below. (e). Since μˆ = 3.21 when evaluated at x1 = 3.11 and x2 = 3.22, which random variable, X1 or X2, is the parameter μ closer to? Justify your response. Enter your response as text below. 2 Problem 2. Loss of property for insurance purposes is sometimes modeled as a Pareto distribution. An insurance company offers an insurance policy. If we take the claim amounts (in thousands of dollars), this yields a density of β5β fX(x|β)= xβ+1, x≥5 with 􏰔 since mean μX = 5β β−1 β β−1 β−2 and standard deviation σX = 5 for a minimum claim of 5 thousand dollars. (a). The likelihood function L(β|x) for n independent claims x1, x2, ..., xn for the insurance policy is L(β|x ,x ,...,x ) = (β5β)n 1 2 n (􏰓ni=1xi)β+1 L(β|x) = fX (x1|β) · · · fX (xn|β) L(β|x) = β5β β5β = β+1··· β+1 x1 xn (β5β)n (􏰓ni=1 xi)β+1 where 􏰓ni=1 xi = x1 · x2 · . . . · xn. Confirm that the log-likelihood function (in simplified form) is ln(L(β|x)) = n ln(β) + nβ ln(5) − (β + 1) 􏰒ni=1 ln(xi) Recall: The log property logb(􏰓ni=1 xi) = 􏰒ni=1 logb(xi). To complete this task, upload an image of your work by replacing "upload_image.jpg" with your appropriately titled .jpg file in the R chunk below. 3 (b). If the log-likelihood function is ln(L(β|x)) = n ln(β) + nβ ln(5) − (β + 1) 􏰒ni=1 ln(xi), then confirm that the maximum likelihood estimator βˆ for β is βˆ = 1 , where βˆ is a function of the claims x1, x2, ..., xn. ln(x)−ln(5) Note: ln(x) = 1 􏰒n ln(xi) is the mean of the log of x. n i=1 To complete this task, upload an image of your work by replacing "upload_image.jpg" with your appropriately titled .jpg file in the R chunk below. (c). Since β,n > 0, verify that the MLE βˆ is a maximum by confirming ∂2 ln􏰇L(βˆ|x ,x ,…,x )􏰈 < 0. ∂β2 12n To complete this task, upload an image of your work by replacing "upload_image.jpg" with your appropriately titled .jpg file in the R chunk below. 4 (d). The claims under the insurance policy (i.e., the data) can be downloaded with the R command, read.csv(). claims = read.csv("http://math.arizona.edu/~jwatkins/claims5.csv")[,1] # NOTE: If you are having trouble accessing the CSV file via the URL, follow the instructions # and uncomment the read.csv() command below. Be sure to comment out the read.csv() command above. # Instructions: To change your working directory path to current file location, on the very top, # click Session -> Set working directory -> To Source File Location OR Choose Directory
# Be sure the CSV file and RMD file are in the same folder if using “to Source File Location)
#claims = read.csv(“claims.csv”)[,1] # load CSV file directly from folder
If βˆ = 1 , use R to determine the the maximum likelihood estimate for these data. ln(x)−ln(5)
Note: ln(x) is the mean of the log of x. Here, x is denoted by the variable of the data, claims. To do this task, enter your code in the R chunk below by filling in the blank denoted with FILL IN.
#beta_hat = FILL IN
(e). We can use βˆ to estimate the mean and standard deviations of the claims. In the R chunk below, the variable MLEm is the mean of the Pareto distribution evaluated at βˆ, while the variable MLEs is the standard deviation of the Pareto distribution evaluated at βˆ.
beta_hat = 4.110196 # this is an approximation of the value in part (d)
MLEm = 5*beta_hat/(beta_hat-1) # mean of Pareto evaluated at beta-hat
MLEs = (5/(beta_hat – 1))*sqrt(beta_hat/(beta_hat-2)) # SD of Pareto evaluated at beta-hat
m = mean(claims) # mean of the data s = sd(claims) # SD of the data
means = c(MLEm, m) # collect the means estimates
standevs = c(MLEs, s) # collect the standard deviation estimates
data.frame(Mean = means, Standard_Deviation = standevs, row.names = c(“MLE”, “data”))
## Mean Standard_Deviation
## MLE 6.607616 2.243635
## data 6.613442 2.234332
How well do the values of MLEm and MLEs match the values of the mean and standard deviation of the data, m and s?
Enter your response as text below.
5