Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#@title Q 3 Data data _ q 3 = c ( 0 . 8 7 2 5 1 9 1 9 7 1 4 9

#@title Q3 Data
data_q3=c(0.872519197149379,0.107379609259172,0.5513882695116,0.462679539768645,
0.755169234299627,0.335300886362438,0.238799817476665,0.501417518738601,
1.03309716208362,1.17330806654073,3.06093852844009,0.562000746297666,
0.114718391601987,0.0829799299353635,0.512723825323994,0.667636522489739,
0.82129174163406,0.900174311073836,0.393283364858806,0.17233043703901,
0.594318190460774,0.961380988352977,0.894979588441959,0.886134558996956,
1.26220813146941,1.34489718177054,0.596352108849055,0.339763989260709,
0.747981143716208,1.35320439789864,0.784479379144194,1.32393253970876,
0.100060523776539,1.27031586844816,0.504314863802574,0.56460463732528,
0.169277806640116,0.233277206123823,0.029565847209093,0.389537682045547,
0.377710850624072,0.498747425254129,0.751633832498958,0.230597467466196,
0.644018423459058,1.02302531624599,0.62188860328933,0.565494144900288,
0.475945173563433,0.519465268971357) Use the ``optim'' function R to obtain the numerical MLEs. Optimizing over both alpha and beta. Complete the code outline below by filling in the ``...'' terms. The data is generated from a Gamma(2,3) distribution initial_values=c(1,1)
optfun_2param=function(params){
alpha=params[1]
beta=params[2]
#your code here:
return(...)
}
#fill in elipses
mle_out2=optim(...,...,lower=c(0,0),method='L-BFGS-B',control=list(fnscale=-1))
#print MLEs:
print(paste('alpha =',mle_out2$par[1]))
print(paste('beta =',mle_out2$par[2])) initial_values=1
optfun_1param=function(params){
alpha=params[1]
beta=#your code here
#your code here:
return(...)
}
#fill in elipses:
mle_out1=optim(...,...,lower=0,method='L-BFGS-B',control=list(fnscale=-1))
#print MLEs:
print(paste('alpha =',mle_out1$par[1]))
#your code here:
print(paste('beta =',...))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions