Thank you so much. My log likelihood function was wrong. I had the power in the wrong place. I corrected it:
weibull_data= rweibull(1000,shape=2,scale=3)
log_lik_weibull=function(par,obs_data){
n=length(obs_data)
a=par[1]
b=par[2]
sumobs=sum(obs_data)
sumlog_obs= sum(log(obs_data))
n*(log(a)-log(b))+(a-1)(sumlog_obs-nlog(b))-(1/b^a)*sum(obs_data^a)
}
optim(c(1,1),log_lik_weibull,obs_dat=weibull_data,method='BFGS',control = list(fnscale=-1))$par
Got 1.93 & 2.96 now. Didn't know about the fitdistr. I will look into it.
About missing the * it's in my code somehow when I copy the code here it's not showing.