model.littleR.Gibbs: The main function for fitting the probability distribution of...

Description Usage Arguments Examples

Description

The main function for fitting the probability distribution of population growth rates. Accepts any two full census R Analytical Tables.

A Gibbs sampler is used to fit the parameter, with a hierarchical component for the distribution of species'mortality rates (mu) and species'rates of population change (r). and be sure to set mindbh. Other parameters can be left at defaults.

Added the bad.modelparam option to accomodate dasympower Aug 2011. Now this has to be included for asymexp; before, the check for negative SD parameters was hard-coded.

Optionally, a table demog can be created separately and submitted. It must have columns N1, N2, S, time.

Usage

1
2
3
4
5
model.littleR.Gibbs(cns1, cns2, mindbh, demog = NULL, sptable,
  abundrange = c(1, 1e+06), start.param = c(-3, 0.8, 0.01, -0.5),
  modeltype = "asympower", excludespp = NULL, useIDlevel = TRUE,
  bad.modelparam = bad.asympower.param, steps = 10000, burn = 1000,
  showstep = 500, debug = FALSE)

Arguments

cns1, cns2

The two census R Analytical Tables, with earlier census first

mindbh

The minimum diameter above which the counts are done. Trees smaller than mindbh are excluded. If NULL, all living trees are included.

demog

optional, must match exactly the table created within the function

abundrange

the default includes every species, but this can be set to a minimum and maximum abundance (first census); species with abundances outside the range are excluded

start.param

parameter values at the outset, 1) mean of log(mortality) rate, 2) SD of log(mortality), 3) center of distribution of little r, 4) rate (or SD) of the distribution of little r; if an asymmetric model is chosen, the latter is the initial value for both left and right rate

modeltype

Functional forms to fit to the distribution; it can be:

  • Gaussian modeltype = "norm", with the quotes

  • Asymmetric Gaussian (a different standard deviation on left and right of the mode) modeltype = "asymnorm", with the quotes

  • Laplace (exponential distribution, with mirror image for negative values) modeltype = "symexp", with the quotes

  • Asymmetric Laplace (different rate constant for left and right of the center) modeltype = "asymexp", with the quotes

  • Asymmetric power distribution (different rate constant for left and right of the center) 'modeltype = "asympower", with the quotes.

bad.modelparam

name of a function which checks the model parameters for bad values; for modeltype asymexp, must be bad.asymexp.param, for modeltype asympower, must be bad.asympower.param

steps

The number of steps to run the Gibbs sampler.

burn

number of steps of sampler to exclude as burn-in

showstep

Information is printed to the screen every showstep steps.

debug

Logical. If TRUE, call browser to debug.

Examples

 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
30
31
32
33
34
35
36
37
38
## Not run: 
lambir.modelR = model.littleR.Gibbs(
  cns1 = lambir.full3,
  cns2 = lambir.full4,
  mindbh = 1,
  bad.modelparam = bad.asymexp.param
)
palanan.modelR = model.littleR.Gibbs(
  cns1 = palanan.full3,
  palanan.full4,
  mindbh = 1,
  bad.modelparam = bad.asymexp.param
)
# For graphic output, just pass the result to graph.abundmodel. There are 
# many options, but the defaults will show the key results. 
graph.abundmodel(fit = lambir.modelR)

# Alternate distributions for little r:
power67 = model.littleR.Gibbs(
  cns1 = bciex::bci12t6mini,
  cns2 = bciex::bci12t7mini,
  modeltype = 'asympower',
  mindbh = 10,
  start.param = c(-3, .8, .01, -.5),
  bad.modelparam = bad.asympower.param,
  showstep = 25
)
gauss67 = model.littleR.Gibbs(
  cns1 = bciex::bci12t6mini,
  cns2 = bciex::bci12t7mini,
  modeltype = 'asymnorm',
  mindbh = 10,
  start.param = c(-3, .8, .01, 100),
  bad.modelparam = bad.asymexp.param,
  showstep = 25
)

## End(Not run)

forestgeo/ctfs documentation built on May 3, 2019, 6:44 p.m.