mastSpectralDensity: Volatility and period for mast data

View source: R/mastifFunctions.R

mastSpectralDensityR Documentation

Volatility and period for mast data

Description

Extracts time series attributes for tree or population fecundity.

Usage

  mastSpectralDensity( x, maxPeriod = length(x)/2, PLOT = FALSE, ylim = NULL )

Arguments

x

numeric vector of sequential fecundity values.

maxPeriod

the number of frequencies/periods to include.

PLOT

logical to plot spectrum.

ylim

if PLOT, values for lower and upper bounds.

Details

Returns attributes of volatility and period for a sequence of fecundity values for a single tree (or population) in x, which may often be on a log scale.

More detailed examples can be obtained with: browseVignettes('mastif')

Value

Returns a list that includes spect, a matrix of power values ordered by frequency (1/period). To permit comparisons between series that differ in length, totVar (total variance) and volatility (period-weighted variance) are divided by the length of the series. Mean and standard deviation for the weighted period are periodMu and periodSd.

Author(s)

James S Clark, jimclark@duke.edu

References

Qiu, T, ..., and J.S. Clark. 2023. Mutualist dispersers and the global distribution of masting: mediation by climate and fertility. in review.

See Also

mastif for analysis

A more detailed vignette is can be obtained with:

browseVignettes('mastif')

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

Examples


d <- "https://github.com/jimclarkatduke/mast/blob/master/outputAbies.rdata?raw=True"
repmis::source_data( d )

# single Abies tree from fitted output$prediction$fecPred:

wt <- which( fecPred$treeID == "BAMT1-1" )
s  <- mastSpectralDensity( log(fecPred$fecEstMu[ wt ]), PLOT = TRUE )

# population year effects (log scale) for an ecoRegion_species in output$parameters$betaYrRand:

x <- betaYrRand['3_abiesAmabilis', ]    
x <- x[ x != 0 ]                        # ecoRegion_species vary in observation years
s <- mastSpectralDensity( x, PLOT = TRUE )


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