I was trying to obtain mles of the scale and shape parameter for the weibull distribution using the optim function.
The code is as follows:
optim(c(1,1),log_lik_weibull,obs_dat=weibull_data,control = list(fnscale=-1))$par
This gives parameter estimates of 0.86, 2.63 which is significantly different from my shape and scale parameters.
I feel the log likelihood function is correct however I am not able to obtain reliable estimates.
Any help will be appreciated.