Multinomial regression Rstan

I am trying to implement a vglm like multinomial regression in RStan but i cannot do it.Also categorical and multinomial distributions in stan are the same?Can anyone please help me ow can i input the data for this model in RStan?Pleaseeeeeeeeeee


race   = gl(2,2,labels   = c("white","black"));race
gender = gl(2,1,labels = c("female","male"));gender
y1     = c(371,250,64,25)
y2     = c(49,45,9,5)
y3     = c(74,71,15,13)
afterlife = data.frame(race,gender,y1,y2,y3)
afterlife

fit <- vglm(cbind(y1,y2,y3) ~ gender + race, family=multinomial,
            data=afterlife)

cat= "data 
{
  int K;
  int N;
  int D;
  int y[N];
  matrix[N, D] x;
}
parameters {
  matrix[D, K] beta;
}
model {
  matrix[N, K] x_beta = x * beta;
  
  to_vector(beta) ~ normal(0, 5);
  
  for (n in 1:N)
    y[n] ~ categorical_logit(x_beta[n]');
}"