Weibull样本上的mle2

我想使用mle2函数为魏布尔形状和比例参数生成mles。我已经编写了以下代码,但出现了错误:

那么哪个组件为NULL,我应该更改为数字?获取mles的代码是否还有其他问题?

x2<- rweibull(n, shape = 1, scale = 1.5)
library(bbmle)
loglik2 <- function(theta, x){
  shape<- theta[1]
  scale<- theta[2]
  K<- length(theta)
  n<- length(x2)
  out<- rep(0,K)
  for(k in 1:K){
    out[k] <- sum(dweibull(x2, shape, scale, log=TRUE))   
  }
  return(out)
}
theta.start<- c(1, 1.4)
(mod <- mle2(loglik2,start=list(theta.start),data=list(x2)))
Error in validObject(.Object) : 
  invalid class “mle2” object: invalid object for slot "fullcoef" in class "mle2": got class "NULL", should be or extend class "numeric"