setDiscretization: Set discretization level

Description Usage Arguments Details Value Examples

View source: R/utilities.R

Description

Set the discretization level of a data matrix for input to MagiSolver, by inserting time points where the GP is constrained to the derivatives of the ODE system.

Usage

1
setDiscretization(dat, level, by)

Arguments

dat

data matrix. Must include a column with name 'time'.

level

discretization level (a positive integer). 2^level - 1 equally-spaced points will be inserted between existing data points in dat.

by

discretization interval. As an alternative to level, equally-spaced spaced time points will be inserted with interval by between successive points.

Details

Specify the desired discretization using level or by.

Value

Returns a data matrix with the same columns as dat, with rows added for the inserted discretization time points.

Examples

1
2
3
dat <- data.frame(time = 0:10, x = rnorm(11))
setDiscretization(dat, level = 2)
setDiscretization(dat, by = 0.2)

magi documentation built on July 27, 2021, 9:06 a.m.