Page 1 of 1

Please write code in R

Posted: Wed May 11, 2022 8:00 am
by answerhappygod
Please write code in R
Please Write Code In R 1
Please Write Code In R 1 (84.97 KiB) Viewed 22 times
Observations 1 2 3 4 5 6 7 8 X1 9 7 8 8 6 9 8 9 X2 y 7 7 10 4 5 3 4 1 5 2 3 1 6 3 1 0 Consider a Poisson regression model with Ni = Bo + B1Xil + B2X12, and suppose we want to minimize the following function (which is actually the negative log-likelihood of something, take Dr. Gauri Datta's STAT8350 to know more!) 8 8 f(B) exp{Bo+Bıxi1 +B2xia} - 2 yi(Bo+Bıxı1 + B2x12). (1) i=1 i=1 Assume that Bol < 25, and Bi1 < 5 for i = 1, 2. Find ß = (Bo,B1, B2) that minimizes equa- tion (1) numerically by using the following four different optimization techniques: (a) Use “L-BFGS-B Algorithm” (Broyden-Fletcher-Goldfarb-Shanno) for optim, (b) Particle Swarm Optimization, (c) Differential Evolution algorithm, and (d) Genetic algorithms. 3 Compare the results for these different algorithms and comment on their performances. Note that DE is a generalization of GA.