checkModel: Check linear differential equation specifications.

Description Usage Arguments Details Value References See Also Examples

View source: R/checkModel.R

Description

A system of linear differential equations is defined by a model list of length equal to the number of variables in the system. Each variable is defined an invocation of function make.Variable, and then assigned to the corresponding position in the model list. so that each member of this list defines a single linear differential equation.

Within each equation there are typically one or more terms involving a coefficient function multiplying either a derivative of one of the variables, or multiplying a forcing function.

This function checks that all linear differential equation specifications conform to what is required. A list of errors is displayed if there are problems. Default values are supplied where needed. New named members are also supplied.

In addition, function checkModel also assigns position(s) in the master parameter vector corresponding to coefficient functions in the system. This master parameter vector is optimized by function Data2LD.opt.

Finally, checkModel also displays a detailed summary of the linear differential system if the argument summarywrd is TRUE. It is easy to make mistakes in setting up lists of variable specifications, and it is ESSENTIAL to invoke this function prior to invoking any function using this list.

Usage

1
checkModel(XbasisList, modelList, summarywrd=TRUE)

Arguments

XbasisList

A list object containing the functional basis objects for representing the variables as functional data objects.

modelList

A list object containing the specification of a Data2LD model. Each member of this list contains a list object that defines a single linear differential equation.

summarywrd

If TRUE, display a report on the structure of the dynamic system.

Details

A list object containing:

If certain values are not supplied, default values are assigned.

Two new named members are also supplied for each variable. Member nallXterm is the number of terms in the right side homogeneous portion of the equation, which involve a derivative of a variable in the system multiplied by a coefficient function. Member nallFterm is the number of forcing terms in the equation. These two new members are essential for function Data2LD, and, although checkModel is also invoked inside Data2LD, an inovking of checkModel is essential prior to beginning the data analysis.

Value

A named list object with the same structure as the argument along with added default values and members nallXterm and nallFterm.

References

J. O. Ramsay and G. Hooker (2017) Dynamic Data Analysis. Springer.

See Also

make.Fterm, make.Xterm, make.Variable

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#  For examples of the use of this function, 
#  see these examples in the description of the function \code{make.variable}.
#
#  Example 1:  The refinery data
#
#
#  Example 2:  The X coordinate of the fda script data
#
#
#  Example 3:  The X coordinate of the fda script data
#
#
#  Example 4  Average temperature for Montreal
#

Data2LD documentation built on Aug. 6, 2020, 1:08 a.m.