gjamFillMissingTimes: Fill out data for time series (state-space) gjam

View source: R/gjamHfunctions.R

gjamFillMissingTimesR Documentation

Fill out data for time series (state-space) gjam

Description

Fills in predictor, response, and effort matrics for time series data where there are multiple multivariate time series. Time series gjam is here https://htmlpreview.github.io/?https://github.com/jimclarkatduke/gjam/blob/master/gjamTimeMsVignette.html

Usage

  gjamFillMissingTimes(xdata, ydata, edata, groupCol, timeCol, groupVars = groupCol,
                                 FILLMEANS = FALSE, typeNames = NULL, missingEffort = .1)
                       

Arguments

xdata

n by Q data.frame holding predictor variables

ydata

n by S matrix holding response variables

edata

n by S matrix holding effort

groupCol

column name in xdata for group variable, i.e., observations part of the same time series

timeCol

column name in xdata for time index

groupVars

character vector of column names in xdata having values that are fixed for a value of groupCol, i.e., they do not change with time index in timeCol

FILLMEANS

fill new rows in ydata with mean for groupCol times missingEffort; otherwise NA

typeNames

typenames current limited to 'DA' for discrete counts

missingEffort

effort assigned to missing values of edata and ydata

Details

Missing times in the data occur where there are gaps in timeCol column of xdata and the initial time 0 for each sequence. New versions of the data have NA (xdata) or prior values with appropriate weight (ydata). Missing times are filled in xdata, ydata, edata, including a time 0 which serves as a prior mean for ydata for time code1. The group and time indices in columns groupCol and timeCol of xdata reference the time for a given time series. Missing values in the columns groupVars of xdata are filled automatically filled in. This assumes that values for these variables are fixed for the group. If FILLMEANS, the missing values in ydata are filled with means for the group and given a low weight specified in missingEffort.

Value

A list containing the following:

xdata

filled version of xdata

ydata

filled version of ydata

edata

filled version of edata

timeList

time indices used for computation, including, timeZero (row numbers in new data where each time series begins, with times = 0), timeLast (row numbers in new data where each time series ends), rowInserts (row numbers for all inserted rows), noEffort (rows for which effort in edata is filled with missingEffort)

Author(s)

James S Clark, jimclark@duke.edu

References

Clark, J. S., C. L. Scher, and M. Swift. 2020. The emergent interactions that govern biodiversity change. Proceedings of the National Academy of Sciences, 117, 17074-17083.

See Also

gjam for more on xdata, ydata, and effort.

A more detailed vignette is can be obtained with:

browseVignettes('gjam')

web site 'http://sites.nicholas.duke.edu/clarklab/code/'.


gjam documentation built on May 24, 2022, 1:06 a.m.