- check.ld.struct
Boolean flag, indicating whether log-density fghEval
has one of the 3 forms of output, described above.
- numderiv
Integer with values of 0,1,2
. A value of 0
means analytical gradient and Hessian have been provided, and thus there is no need for numerical differentiation. 1
means analytical gradient is provided, but Hessian must be calculated numerically. 2
means both gradient and Hessian must be numerically calculated. Users can pass this value to subsequent sns
or sns.run
calls.
- check.length.g
Boolean flag, indicating whether length of gradient vector (element g
) returned by fghEval
equals length(x)
.
- check.dim.h
Boolean flag, indicating whether number of rows and columns of the Hessian matrix (element h
) returned by fghEval
equal length(x)
.
- x.mat
Collection of state space vectors (one per row), for which validation tests are performed. It has nevals
rows and length(x)
columns.
- t.evals
Time spent on evaluating fghEval
on nevals
points chosen randomly in the neighborhood of x
, as specified by dx
. This includes log-density and, if provided, analytical evaluations of gradient and Hessian.
- t.num.evals
Time spent on evaluating the numeric version of fghEval
, in which gradient and Hessian are computed numerically, using grad
and hessian
functions in the numDeriv package. Comparison of this number with t.evals
provides the user with insight into the relative speed of numerical differentiation compared to analytical versions.
- f.vec
Vector of log-density values for state space vectors listed in x.mat
.
- g.mat.num
Collection of numerically-computed gradient vectors for state space values listed in x.mat
, with the same dimension conventions.
- is.g.num.finite
Boolean flag, indicating whether all numerically-computed gradient vectors have finite values.
- h.array.num
Collection of numerically-computed Hessian matrices at points listed in x.mat
. First dimension is of length nevals
, and the remaining two dimensions equal length(x)
.
- is.h.num.finite
Boolean flag, indicating whether all numerically-computed Hessian matrices have finite values.
- g.mat
Collection of analytically-computed gradient vectors for state space values listed in x.mat
, with the same dimension conventions. This is only available if fghEval
has a g
field; otherwise NA
.
- is.g.finite
Boolean flag (if available), indicating whether all analytically-computed gradient vectors have finite values (if available).
- g.diff.max
If available, maximum relative difference between analytical and numerical gradient vectors, over all nevals
points in x.mat
. Relative diference is defined as L2 norm of difference between the two gradient vectors, divided by the L2 norm of the analytical gradient vector.
- h.array
If available, collection of analytically-computed Hessian matrices at points listed in x.mat
. Dimensional conventions are the same as h.array.num
.
- is.h.finite
Boolean flag (if available), indicating whether all analytically-computed Hessian matrices have finite values.
- h.diff.max
If available, maximum relative difference between analytical and numerical Hessian matrices, over all nevals
points in x.mat
. Relative difference is defined as the Frobenius norm of difference of analytical and numerical Hessian matrices, divided by the Frobenius norm of analytical Hessian.
- is.negdef.num
Boolean flag, indicating whether numerical Hessian is negative-definite at all state space points indicated in x.mat
.
- is.negdef
Boolean flag, indicating whether analytical Hessian is negative-definite at all state space points indicated in x.mat
.