Syntax error - "Ill-typed arguments supplied to infix operator"

Hi,
I’m getting the following syntax error in this model. How can I fix it?

parameters{
vector[N_cover] a_k;
}
transformed parameters{
  vector[N] mu=exp(a + a_site[site_id]...);    
  vector<lower=0>[N] k = a_k[cover_id];    
  vector[N] lambda= mu / tgamma(1 + 1 /k);
  }

Error:

Warning in '/tmp/RtmpTJuL4P/model-178a2ada9744.stan', line 2, column 24: Declaration
    of arrays by placing brackets after a type is deprecated and will be
    removed in Stan 2.32.0. Instead use the array keyword before the type.
    This can be changed automatically using the auto-format flag to stanc
Semantic error in '/tmp/RtmpTJuL4P/model-178a2ada9744.stan', line 110, column 36 to column 40:
   -------------------------------------------------
   108:   vector<lower=0>[N] k = a_k[cover_id];
   109:      
   110:    vector[N] lambda= mu / tgamma(1 + 1 /k);
                                             ^
   111:     
   112:  }
   -------------------------------------------------

Ill-typed arguments supplied to infix operator /. Available signatures: 
(row_vector, matrix) => row_vector
(matrix, matrix) => matrix

(int, int) => int
(real, real) => real
(vector, real) => vector
(complex, complex) => complex
(row_vector, real) => row_vector
(matrix, real) => matrix
Instead supplied arguments of incompatible type: int, vector.

make: *** [make/program:50: /tmp/RtmpTJuL4P/model-178a2ada9744.hpp] Error 1

Error: An error occured during compilation! See the message above for more information.

1 is typed as an int. Use 1.0

It didn’t wok, I got the same error message.

Semantic error in '/tmp/Rtmp97r5X8/model-f9e070f9bbc5.stan', line 110, column 38 to column 44:
   -------------------------------------------------
   108:   vector<lower=0>[N] k = a_k[cover_id];
   109:      
   110:    vector[N] lambda= mu / tgamma(1.0 + 1.0 /k);
                                               ^
   111:     
   112:  }
   -------------------------------------------------

Ill-typed arguments supplied to infix operator /. Available signatures: 
(row_vector, matrix) => row_vector
(matrix, matrix) => matrix

(int, int) => int
(real, real) => real
(vector, real) => vector
(complex, complex) => complex
(row_vector, real) => row_vector
(matrix, real) => matrix
Instead supplied arguments of incompatible type: real, vector.

make: *** [make/program:50: /tmp/Rtmp97r5X8/model-f9e070f9bbc5.hpp] Error 1

Error: An error occured during compilation! See the message above for more information.

What happens if you change the / to ./?

1 Like