title: plotting log-likelihood function in R
body: <p>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.</p>
  
  <pre><code>x &lt;- datasim
  loglik &lt;- function(theta){
    k&lt;- theta[1]
    lambda&lt;- theta[2]
    out &lt;- sum(dweibull(x,shape = k, scale=lambda, log = TRUE) )
    return(out)
  }
  
  theta&lt;- c(0.5,1.5)
  plot(theta, loglik(theta), type="l", lwd=3, main="logliklihood_Weibull, n=1000")
  
  </code></pre>