title: Vectorizing Density Evaluation
body: <p>I would like to vectorize the following loop:</p>
  
  <pre><code>k=4
  n=5
  w=randn(n,1)
  theta = randn(n,k)
  for i=1:size(theta,1)
      s = w(i)*mvnpdf(theta(i,:)',zeros(k,1),eye(k));
  end
  </code></pre>
  
  <p>Any suggestions?
  Thanks.</p>