setDiscretization {magi}R Documentation

Set discretization level

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

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 time points will be inserted between each row of dat.

by

discretization interval. As an alternative to level, time points will be inserted (as needed) to form an equally-spaced discretization set from the first to last observations of dat, with interval by between successive discretization points. This can be useful when the time points in dat are unevenly spaced.

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

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


[Package magi version 1.2.3 Index]