Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started