Question: Go to file/function Do > Addins Untitled1* x Source on Save Q - Run 45 ## input para (a vector of size 2) 46 47

Go to file/function Do > Addins Untitled1* x Source on Save Q - Run 45 ## input para (a vector of size 2) 46 47 - nllik = function (para){ 48 nll = - sum(dnorm(Data, mean=para[1] , sd=para[2], log=T)) 49 return(nil) 50 - 3 51 52 ##objfun = funciton (para, date=Date){ 53 54 dnorm(Data, mean=para [1] , sd=para[2]) 55 56 - 3## 57 58 ## use optimization function to find the maximum likelihood estimates (MLE) 59 ## of mu and sigma 60 61 para. ini = c(10,2) 62 para. min = c(-2,0.1) 63 para . max =c(200, 10) 64 optim(par=para. ini, nllik, lower=para. min, upper=para. max, 65 method= 'L-BFGS-B' ) 66 47:23 nllik(para) = Environment History Connections Tutorial
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
