Description Usage Format Examples
The code needed to recreate the object is included in the examples, as well as in the vignette code chunks.
1 |
A 'stan_fit' object containing samples of the following parameters.
Gaussian process variance parameter
Gaussian process roughness parameter
Latent poisson rate
Posterior predictive sample of counts 'y'
See the help page for stanfit-class
for more details.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Not run:
# generate mean and variance for sequence of samples over time
library(rstan)
library(dplyr)
library(magrittr)
library(tidyr)
library(tibble)
library(ggfan)
seed <- 34526
set.seed(seed)
# data
x <- seq(-5,5,0.1)
N <- length(x)
y <- cbind(rpois(N, exp(sin(x)+2)),rpois(N, exp(sin(x)+2)))
stan_data <- list(N=N, x=x, y=y)
compiled_model <- stan_model(file=file.path(path.package("ggfan"),
"stan","latent_gp_pois.stan"))
gp_model_fit <- sampling(compiled_model, data=stan_data, iter=3000,thin=6)
#devtools::use_data(gp_model_fit, internal=FALSE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.