Skip to content

Parameter indexing in function and gq block #7

@hyunjimoon

Description

@hyunjimoon
  1. which is better btw theta[2] vs alpha, beta? as function input argument?
  2. could we vectorize in gq block w.o. extra td block as the solution below?
    theta_tilde[1] = normal_rng(1, 0.5); //TODO U5
    theta_tilde[3] = normal_rng(1, 0.5); //TODO U5
    theta_tilde[2] = normal_rng(0.05, 0.05); //TODO U5
    theta_tilde[4] = normal_rng(0.05, 0.05); //TODO U5

sol. suggested in here

transformed data {
  int N = 10;
  vector[N] ones_N = rep_vector(1, N);
}

generated quantities {
  real yrep [N] = normal_rng(ones_N * 1, ones_N * 10);  
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions