title: Fail to implement the pmf model in pystan
body: <p>I am a newbie to both stan and machine learning. Now I'd like to implement the pmf model. Here is part of my code:</p>
  
  <pre><code>pmf_cod="""
  data {
  
  int&lt;lower=0&gt; K; //number of factors
  int&lt;lower=0&gt; N; //number of user
  int&lt;lower=0&gt; M; //number of item
  int&lt;lower=0&gt; D; //number of observation
  int&lt;lower=0&gt; D_new; //number of pridictor 
  int&lt;lower=0, upper=N&gt; ii[D]; //item 
  int&lt;lower=0, upper=M&gt; jj[D]; //user
  int&lt;lower=0, upper=N&gt; ii_new[D_new]; // item
  int&lt;lower=0, upper=N&gt; jj_new[D_new]; // user
  real&lt;lower=0, upper=5&gt; r[D]; //rating
  real&lt;lower=0, upper=5&gt; r_new[D_new]; //pridict rating
  
  }
  
  parameters {
  row_vector[K] i[M]; // item profile
  row_vector[K] u[N]; // user profile
  real&lt;lower=0&gt; alpha;
  real&lt;lower=0&gt; alpha_i;
  real&lt;lower=0&gt; alpha_u;
  
  }
  
  transformed parameters {
  matrix[N,M] I; // indicator variable
  I &lt;- rep_matrix(0, N, M);
  for (d in 1:D){
      I[ii[d]][jj[d]] &lt;- 1;
  }
  }
  
  model {
  for (d in 1:D){
      r[d] ~ normal(sum(u[jj[d]]' * i[ii[d]]), 1/alpha);
  }
  
  for (n in 1: N){
      u[n] ~ normal(0,(1/alpha_u) * I);
  }
  for (m in 1:M){
      i[m] ~ normal(0,(1/alpha_i) * I);
  }
  }
  """
  </code></pre>
  
  <p>But I got a error:<code>No matches for: row vector ~ normal(int, matrix)</code> in this line of code:</p>
  
  <pre><code>for (n in 1: N){
      u[n] ~ normal(0,(1/alpha_u) * I);
  }
  </code></pre>
  
  <p>Where <code>I</code> is a unit matrix. So the product of <code>(1/alpha_u) * I</code> is also a matrix. But stan just accept vector or real value as variance. I wonder how to transform it to a vector or a single value. </p>
  
  <p>Thank you in advance!</p>