spatialGEV_sample {SpatialGEV} | R Documentation |
Get posterior parameter draws from a fitted GEV-GP model.
spatialGEV_sample(model, n_draw, observation = FALSE, loc_ind = NULL)
model |
A fitted spatial GEV model object of class |
n_draw |
Number of draws from the posterior distribution |
observation |
whether to draw from the posterior distribution of the GEV observation? |
loc_ind |
A vector of location indices to sample from. Default is all locations. |
An object of class spatialGEVsam
, which is a list of matrices containing the
joint posterior draws of the parameters and optionally the GEV observations.
library(SpatialGEV)
a <- simulatedData$a
logb <- simulatedData$logb
logs <- simulatedData$logs
y <- simulatedData$y
locs <- simulatedData$locs
n_loc <- nrow(locs)
beta_a <- mean(a); beta_b <- mean(logb)
fit <- spatialGEV_fit(y = y, locs = locs, random = "ab",
init_param = list(beta_a = beta_a,
beta_b = beta_b,
a = rep(0, n_loc),
log_b = rep(0, n_loc),
s = 0,
log_sigma_a = 0,
log_kappa_a = 0,
log_sigma_b = 0,
log_kappa_b = 0),
reparam_s = "positive",
kernel = "matern",
silent = TRUE)
sam <- spatialGEV_sample(model = fit, n_draw = 100,
observation = TRUE, loc_ind=1:10)
print(sam)
summary(sam)