gqs | R Documentation |

Draw samples from the generated quantities block of a
`stanmodel`

.

## S4 method for signature 'stanmodel' gqs(object, data = list(), draws, seed = sample.int(.Machine$integer.max, size = 1L))

`object` |
An object of class |

`data` |
A named |

`draws` |
A matrix of posterior draws, typically created by
calling |

`seed` |
The seed for random number generation. The default is generated
from 1 to the maximum integer supported by |

An object of S4 class `stanmodel`

representing
the fitted results.

`object`

`signature(object = "stanmodel")`

Evaluate the generated quantities block of a Stan program
by supplying `data`

and the `draws`

output from a
previous Stan program.

`stanmodel`

, `stanfit`

, `stan`

## Not run: m <- stan_model(model_code = 'parameters {real y;} model {y ~ normal(0,1);}') f <- sampling(m, iter = 300) mc <- ' parameters {real y;} generated quantities {real y_rep = normal_rng(y, 1);} ' m2 <- stan_model(model_code = mc) f2 <- gqs(m2, draws = as.matrix(f)) f2 ## End(Not run)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.