Learn R Programming

psychonetrics (version 0.17.8)

diagnostics: Diagnostic functions

Description

The 'checkJacobian' function can be used to check if the analytic gradient / Jacobian is aligned with the numerically approximated gradient / Jacobian, and the 'checkFisher' function can be used to check if the analytic Hessian is aligned with the numerically approximated Hessian.

Usage

checkJacobian(x, f = "default", jac = "default", transpose = FALSE, 
          plot = TRUE, perturbStart = FALSE, method = "Richardson")

checkFisher(x, f = "default", fis = "default", transpose = FALSE, plot = TRUE, perturbStart = FALSE)

Value

Invisibly returns a list with two elements, analytic and numeric, containing the analytic and the numerically approximated gradient/Jacobian (checkJacobian) or Hessian/Fisher information (checkFisher) values being compared. A scatter plot of the two is drawn when plot = TRUE.

Arguments

x

A 'psychonetrics' object

f

A custom fit function or the psychonetrics default fit function (default).

jac

A custom Jacobian function or the psychonetrics default Jacobian function (default).

fis

A custom Fisher information function or the psychonetrics default Fisher information function (default).

transpose

Should the numeric Jacobian be transposed?

plot

Should a diagnostic plot be produced?

perturbStart

Should start values be perturbed (only used in development)

method

Numeric derivative method (default: Richardson)

Author

Sacha Epskamp