Synchronous interpolation of covariate using either GAM (same as paths) or piece-wise constant if covariate is a factor
covariate_interp(paths, covariate = NULL, Time.name, time.grid, s_args)
paths
: lists of data.frames containing positions, times, and covariate for each individualcovariate
: character string giving name of covariate variable in data.framesTime.name
: character string giving name of time variable in data.framestime.grid
: grid of possible times to use for interpolation (individuals will only be interpolated to times within the range of observation times)s_args
: arguments to mgcv::s()
for GAM interpolation methodlist of interpolated covariate by individual
Useful links