specialTerms: Special Non-Linear Terms for FCS2 Abundance and Prevalence...

Description Usage Arguments Details See Also

Description

Non-linear random walk and spatial terms that can be used in addition to linear terms in the FCS2 abundance and prevalence regression equations.

Usage

 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
rw1(val, noLevels = 10, boundaries, scale.parameters,
  precision.parameters, initial.values, precision.initial.value)

rw2(val, noLevels = 10, boundaries, scale.parameters,
  precision.parameters, initial.values, precision.initial.value)

spatial(val, adjacency, scale.parameters, precision.parameters,
  initial.values, precision.initial.value)

rw2(
  val,
  noLevels = 10,
  boundaries,
  scale.parameters,
  precision.parameters,
  initial.values,
  precision.initial.value
)

spatial(
  val,
  adjacency,
  scale.parameters,
  precision.parameters,
  initial.values,
  precision.initial.value
)

Arguments

val

a covariate to use for the non-linear term. rw1 and rw2 assume a continuous variable but spatial requires an integer variable that indicates which spatial region every survey is within.

noLevels

the number of discrete levels to use to represent the continuous non-linear relationship. This is ignored if boundaries is supplied.

boundaries

an optional vector specifying the location of the discrete points that are used to represent the non-linear covariate term. If missing, noLevels boundaries are created spaced regularly between the minimum and maximum values of val.

scale.parameters

an optional vector of length 2 specifying the prior distribution of the scale hyperparameter (σ or ν) that controls the variability between levels in the random walk or adjacent spatial regions.

precision.parameters

an optional vector of length 2 specifying the prior distribution of the precision hyperparameter (τ = 1 / σ^2 or φ = 1 / ν^2) that controls the variability between levels in the random walk or adjacent spatial regions. This is ignored if scale.parameters is specified.

initial.values

an optional vector giving an estimate for each of the variables that make up the term, one for each random walk level or one for each spatial region. These are used as starting values for the MCMC chains when fitting the full model using BUGS.

precision.initial.value

an optional starting value for the precision hyperparameter to be used when fitting the full model using BUGS.

adjacency

a list with three components containing adjacency information relating to the spatial region. The first component num is a vector containing the number of regions adjacent to each region. The second component adj is a vector listing the indices of each of these adjacent regions. The third component sumNumNeigh is the sum of the number of neighbours, which should equal sum(num) and length(adj).
This list will usually be generated externally from R by the adjacency tool within WinBUGS or OpenBUGS. The list should be given a name and then loaded into R.

Details

Special Non-Linear Terms for FCS2 Abundance and Prevalence Regressions

These functions can be used within the R formulae when specifying the abundance or prevalence regression equations via the arguments muFormula and rhoFormula of fcs2FitModel.

See Also

fcs2FitModel


aquaMetrics/fcs2 documentation built on Aug. 21, 2021, 12:55 p.m.