Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

instantiate stan model with same random seed as used for sampling #551

Closed
mitzimorris opened this issue May 12, 2017 · 0 comments
Closed
Assignees

Comments

@mitzimorris
Copy link
Member

Summary:

Please provide a short couple sentence summary.
In order to use RNG functions in the tranformed data block, the Stan model must be constructed with a boost rng object which has been instantiated with the random seed.

Description:

see stan-dev/stan#2241 for details and discussion.

Reproducible Steps:

Use the following program to test:

data {
  int<lower=0> N;
}
transformed data {
  vector[N] y;
  for (n in 1:N)
    y[n] = normal_rng(0, 1);
  print(y);
}
parameters {
  real mu;
  real<lower = 0> sigma;
}
model {
  y ~ normal(mu, sigma);
}

Current Output:

Current output results in identical values for vector y, no matter what the seed.

Expected Output:

Different seeds should give different values.

Current Version:

v2.15.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant