block_interpolate: Convert a vector of parameter values and a vector of the...

View source: R/projections.R

block_interpolateR Documentation

Convert a vector of parameter values and a vector of the times it changes into a time-series of the parameter values.

Description

This essentially replicates the interpolate(_, "constant") function of odin, but returns a time series of values at the requested times t. The implementation for 1D vector x's is not finished and should be checked before usage, alternatively x can be replaced with indexes from x's time dimension.

Usage

block_interpolate(t, x, tt_x)

Arguments

t

Vector of times we want parameter values for.

x

Vector (list or matrix or array) of parameter values that correspond to each tt_x.

tt_x

Vector of times at which the parameter x changes.

Value

A vector of values for parameter x that correspond to the times specified by t


mrc-ide/squire.page documentation built on May 27, 2023, 11:20 a.m.