title: Plot the likelihood of weibull
body: <p>I would like to plot the likelihood function of a size 1000 weibull sample with a sequence of shape parameter theta. I have used standardised weibull so the scale lambda is 1. However the output is a horizontal straight line.</p>
  
  <pre><code>n&lt;-1000
  lik &lt;- function(theta, x){
    K&lt;- length(theta)
    n&lt;- length(x)
    out&lt;- rep(0,K)
    for(k in 1:K){
      out[k] &lt;- prod(dweibull(x, shape= theta[k], scale=1))   
    }
    return(out)
  }
  theta&lt;-seq(0.01, 10, by = 0.01)
  x &lt;- rweibull(n, shape= 0.5, scale= 1)
  plot(theta, lik(theta, x), type="l", lwd=2)
  </code></pre>