Description Usage Arguments Value
View source: R/fit.bugs.nospatial.env.R
fit.bugs.nospatial.env
fits a spatial GLM with plateau envelope on the climate
covariates via MCMC in WinBUGS.
1 2 3 4 5 6 7 8 9 | fit.bugs.nospatial.env(data, y, x.clim, x.nonclim = NULL, x.factor = NULL,
prior.ax, prior.beta, prior.beta0.difference, constrain.beta,
initial.pars.input, informative.priors = list(beta = FALSE, beta0 = FALSE,
ax = FALSE), burnin = 5000, post.burnin = 1000, chains = 2, thin = 1,
working.directory = NULL, silent = TRUE,
bugs.directory = "C:/Program Files (x86)/WinBUGS14/",
WinBUGS.debug = FALSE, WinBUGS.code = NULL,
WinBUGS.code.location = NULL, no.starting.value = NULL,
estimate.p = FALSE)
|
data |
The data frame (with n rows) containing all the variables for analysis. |
y |
A string denoting the binary response variable (taking values 0 or 1 for absence and
presence respectively); must correspond to a column name in the data frame
specied at |
x.clim |
A vector (length p) of strings denoting which columns in the supplied data
frame correspond to the climate covariates; must correspond to column names in the data frame
specied at |
x.nonclim |
A vector (length p2) of strings denoting which columns in the supplied data
frame correspond to the non-climate covariates; must correspond to column names in the data frame
specied at |
x.factor |
A vector (length p3) of strings denoting which columns in the supplied data
frame correspond to the non-climate factors; must correspond to column names in the data frame
specied at The next four inputs are used to set identifiability constraints on the modelling. |
prior.ax |
A list of up to two p-vector objects, |
prior.beta |
A list of two p by 2 matrix objects, |
prior.beta0.difference |
A list of two scalar objects, |
constrain.beta |
A p by 2 matrix of logicals in order to indicate
which beta parameters should be constrained to not vary too
much from its pair - set at most only one of these to |
initial.pars.input |
Vector of length 2p+p+2+p(p-1)/2 containing
starting values for each parameter; if missing, the code
works out its own starting value. If |
informative.priors |
List of logical scalars for which informative
priors should be used (from: beta, beta0, ax);
this option uses the function |
burnin |
Scalar specifying the number of "burn-in" iterations to be discarded (default 5000). |
post.burnin |
Scalar specifying the number of subsequent iterations to be retained (default 1000). |
chains |
Scalar, number of parallel chains to run (default 2). |
thin |
Scalar, the thinning to apply to the MCMC iterations (default 1). |
working.directory |
String containing the location of the WinBUGS code file; default NULL, in which case a temporary folder is used. |
silent |
Logical flag denoting whether the function runs silently or
not. Default is |
bugs.directory |
String containing location of WinBUGS installation; default "C:/Program Files (x86)/WinBUGS14/" is for Windows 64-bit machines. |
WinBUGS.debug |
Logical flag as to whether to close WinBUGS after
running (default |
WinBUGS.code |
You can supply your own code file, especially useful if
you want to use informative priors for external information. The default
value is |
WinBUGS.code.location |
If |
no.starting.value |
A list of strings denoting the objects we should
not initialise, usually because we set them or calculate them in a bespoke
WinBUGS code file. These objects will be set to |
estimate.p |
Logical flag specifying whether or not to retain samples
for the posterior probabilities of presence for each cell,
default |
A list object as returned by the bugs()
function in
R2WinBUGS; see the help file for that function for further details.
The list is augmented by the response y
and the climate variables
x.clim
, primarily to aid the plotting functions, and by
the vector which.beta, of length p, which contains 1's and
2's to signify which set of beta parameters to use; see
the description of beta below.
The variables in WinBUGS are (i indexes the climate variable):
beta[which.beta[i],i,1/2]
which.beta
(see above)
specifies which of two sets of beta
parameters to use.
There are two betas
in order to facilitate constraining
either the beta[i,1]
(up-slope) or beta[i,2]
(down-slope)
is to be constrained to be close to its opposite. If
beta[i,2]
is constrained, we'll use the first set (i.e.
which.beta[i]==1
) as this models beta[i,1]
directly and
the multiplicative difference between that and beta[i,2]
;
if beta[i,1]
is constrained (which.beta[i]==2
) then we
model beta[i,2]
directly.
ax
The x-coordinate of the apex for each climate variable.
beta0
Scalar suggesting where the top-slicing should be applied.
az
Scalar coordinate on the logit scale of the response axis apex.
gamma
(Upper triangle) matrix of pairwise interaction parameters
between the climate variables; these are constrained
relative to the betas
in order not to break the geometric
formula for a cone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.