covariate_interp function

Synchronous interpolation of covariate using either GAM (same as paths) or piece-wise constant if covariate is a factor

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)

Arguments

  • paths: lists of data.frames containing positions, times, and covariate for each individual
  • covariate: character string giving name of covariate variable in data.frames
  • Time.name: character string giving name of time variable in data.frames
  • time.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 method

Returns

list of interpolated covariate by individual

  • Maintainer: Henry Scharf
  • License: GPL-3
  • Last published: 2025-03-02

Useful links