mastSim: Data simulation for mast model

View source: R/mastifFunctions.R

mastSimR Documentation

Data simulation for mast model

Description

Simulates data for analysis by mastif in package mastif.

Usage

  mastSim(sim)

Arguments

sim

list of inputs for simulation, see Details.

Details

The list sim contains the following:

specNames: character vector of species names.

seedNames: character vector of seed names.

nyr = 5: average number of years for a plot

ntree = 10: average number of trees in specNames on a plot

plotWide = 100: diameter of plot

nplot = 3: number of plots

ntrap = 20: average number of seed traps on a plot

meanDist = 25: mean dispersal (meters)

Value

Returns an object of class "mastif", a list containing the following components:

distall

matrix of distances between all seed traps (rows) and trees (columns). Block diagonal structure by plot, padded with the value 10000 for tree/trap combinations on different plots.

distall

seed trap by tree matrix of distances.

formulaFec

formula for the fecundity model.

formulaRep

formula for the maturation model.

plots

character vector of plot names.

R

species to seed type matrix.

seedData

data.frame of seed data needed for mastif.

seedNames

character vector of seed types.

sim

inputs to mastSim.

specNames

character vector of species.

treeData

data.frame of tree data needed for mastif.

trueValues

list holding true parameter values includes:

fec: vector of log fecundity states.

repr: vector of maturation states.

betaFec: fecundity parameter values.

betaRep: maturation parameter values.

upar: dispersal parameter, m^2.

xytrap

data.frame of seed locations needed for mastif.

xytree

data.frame of tree locations needed for mastif.

years

numeric vector years.

Author(s)

James S Clark, jimclark@duke.edu

References

Clark, J.S., C. Nunes, and B. Tomasek. 2019. Foodwebs based on unreliable foundations: spatio-temporal masting merged with consumer movement, storage, and diet. Ecological Monographs, in press.

See Also

mastSim simulates data

A more detailed vignette is can be obtained with:

browseVignettes('mastif')

website 'http://sites.nicholas.duke.edu/clarklab/code/'.

Examples


# simulate data 
seedNames  <- specNames  <- 'acerRubr'
sim <- list(nyr = 10, ntree = 30, nplot = 5, ntrap = 40, 
            specNames = specNames, seedNames = seedNames)
inputs <- mastSim(sim)
output <- mastif( inputs = inputs, ng = 500, burnin = 200 ) 

# increase iterations, then plot:
# output   <- mastif( inputs = output, ng = 2000, burnin = 1000 ) 
# plot output
# mastPlot(output, plotPars = list(trueValues = inputs$trueValues) )


mastif documentation built on Feb. 16, 2023, 5:30 p.m.