Description Usage Arguments Value Author(s) References Examples
This function implements a optimisation routine that computes the scale parameter θ of the scale dependent hyperprior for a given design matrix and prior precision matrix such that approximately P(|f(x_{k}|≤ c,k=1,…,p)≥ 1-α
1 2 |
alpha |
denotes the 1-α level. |
method |
either |
Z |
the design matrix. |
c |
denotes the expected range of the function. |
eps |
denotes the error tolerance of the result, default is |
Kinv |
the generalised inverse of K. |
an object of class list
with values from uniroot
.
Nadja Klein
Nadja Klein and Thomas Kneib (2015). Scale-Dependent Priors for Variance Parameters in Structured Additive Distributional Regression. Working Paper.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
set.seed(91179)
library(BayesX)
library(MASS)
# prior precision matrix to zambia data set
K <- read.gra(system.file("examples/zambia.gra", package="sdPrior"))
# generalised inverse of K
Kinv <- ginv(K)
# read data
dat <- read.table(system.file("examples/zambia_height92.raw", package="sdPrior"), header = TRUE)
# design matrix for spatial component
Z <- t(sapply(dat$district, FUN=function(x){1*(x==rownames(K))}))
# get scale parameter
theta <- get_theta(alpha = 0.01, method = "integrate", Z = Z,
c = 3, eps = .Machine$double.eps, Kinv = Kinv)$root
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.