Description Usage Arguments Details Value Examples
Gibbs Sampler for STCOS Model
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 27 28 29  gibbs_stcos(
z,
v,
H,
S,
Kinv,
R,
report_period = R + 1,
burn = 0,
thin = 1,
init = NULL,
fixed = NULL,
hyper = NULL
)
## S3 method for class 'stcos_gibbs'
logLik(object, ...)
## S3 method for class 'stcos_gibbs'
DIC(object, ...)
## S3 method for class 'stcos_gibbs'
print(x, ...)
## S3 method for class 'stcos_gibbs'
fitted(object, H, S, ...)
## S3 method for class 'stcos_gibbs'
predict(object, H, S, ...)

z 
Vector which represents the outcome; assumed to be direct estimates from the survey. 
v 
Vector which represents direct variance estimates from the survey. 
H 
Matrix of overlaps between source and finelevel supports. 
S 
Design matrix for basis decomposition. 
Kinv 
The precision matrix \bm{K}^{1} of the random coefficient \bm{η} 
R 
Number of MCMC reps. 
report_period 
Gibbs sampler will report progress each time this many iterations are completed. 
burn 
Number of the 
thin 
After burnin period, save one out of every 
init 
A list containing the following initial values for the MCMC:

fixed 
A list specifying which parameters to keep fixed in the MCMC.
This can normally be left blank. If elements 
hyper 
A list containing the following hyperparameter values:

object 
A result from 
... 
Additional arguments. 
x 
A result from 
Fits the model
\bm{Z} = \bm{H} \bm{μ}_B + \bm{S} \bm{η} + \bm{ξ} + \bm{\varepsilon}, \quad \bm{\varepsilon} \sim \textrm{N}(0, \bm{V}),
\bm{η} \sim \textrm{N}(\bm{0}, σ_K^2 \bm{K}), \quad \bm{ξ} \sim \textrm{N}(0, σ_{ξ}^2 \bm{I}),
\bm{μ}_B \sim \textrm{N}(\bm{0}, σ_μ^2 \bm{I}), \quad σ_μ^2 \sim \textrm{IG}(a_μ, b_μ),
σ_K^2 \sim \textrm{IG}(a_K, b_K), \quad σ_ξ^2 \sim \textrm{IG}(a_ξ, b_ξ),
using a Gibbs sampler with closedform draws.
Helper functions produce the following outputs:
logLik
computes the loglikelihood for each saved draw.
DIC
computes the Deviance information criterion for each saved draw.
print
displays a summary of the draws.
fitted
computes the mean E(Y_i) for each observation
i = 1, …, n, for each saved draw.
predict
draws Y_i for each observation
i = 1, …, n, using the parameter values for each saved
Gibbs sampler draw.
gibbs_stcos
returns an stcos
object which contains
draws from the sampler. Helper functions take this object as an input
and produce various outputs (see details).
1 2 3 4 5 6 7 8 9 10 11 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.