Hi I have received an error of x and y length differ in my code. datasim is a simulated sample of size 1000. Please help me with this.
x <- datasim
loglik <- function(theta){
k<- theta[1]
lambda<- theta[2]
out <- sum(dweibull(x,shape = k, scale=lambda, log = TRUE) )
return(out)
}
theta<- c(0.5,1.5)
plot(theta, loglik(theta), type="l", lwd=3, main="logliklihood_Weibull, n=1000")