Core mathematical routines, except drivers, and BLAS/LINPACK.
User-supplied subroutine for evaluating the model.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | beta(:) |
Current values of parameters. |
||
real(kind=wp), | intent(in) | :: | xplusd(:,:) |
Current value of explanatory variable, i.e., |
||
integer, | intent(in) | :: | ifixb(:) |
Indicators for "fixing" parameters ( |
||
integer, | intent(in) | :: | ifixx(:,:) |
Indicators for "fixing" explanatory variable ( |
||
integer, | intent(in) | :: | ideval |
Indicator for selecting computation to be performed. |
||
real(kind=wp), | intent(out) | :: | f(:,:) |
Predicted function values. Shape: |
||
real(kind=wp), | intent(out) | :: | fjacb(:,:,:) |
Jacobian with respect to |
||
real(kind=wp), | intent(out) | :: | fjacd(:,:,:) |
Jacobian with respect to errors |
||
integer, | intent(out) | :: | istop |
Stopping condition, with meaning as follows.
|
Compute step size for center and forward difference calculations.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | itype |
Finite difference method being used.
|
||
integer, | intent(in) | :: | k |
Index into |
||
real(kind=wp), | intent(in) | :: | betak |
|
||
real(kind=wp), | intent(in) | :: | ssf(k) |
Scale used for the |
||
real(kind=wp), | intent(in) | :: | stpb(k) |
Relative step used for computing finite difference derivatives with respect
to |
||
integer, | intent(in) | :: | neta |
Number of good digits in the function results. |
Set relative step size for finite difference derivatives.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | itype |
Finite difference method being used.
|
||
integer, | intent(in) | :: | neta |
Number of good digits in the function results. |
||
integer, | intent(in) | :: | i |
Identifier for selecting user-supplied step sizes. |
||
integer, | intent(in) | :: | j |
Identifier for selecting user-supplied step sizes. |
||
real(kind=wp), | intent(in) | :: | stp(ldstp,j) |
Step size for the finite difference derivative. |
||
integer, | intent(in) | :: | ldstp |
Leading dimension of array |
Compute the percent point function value for the normal (Gaussian) distribution with mean 0 and standard deviation 1, and with probability density function:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | p |
Probability at which the percent point is to be evaluated; |
Compute the percent point function value for the student's T distribution with idf
degrees of freedom.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | p |
Probability at which the percent point is to be evaluated; |
||
integer, | intent(in) | :: | idf |
Degrees of freedom. |
Compute Levenberg-Marquardt parameter and steps s
and t
using analog of the
trust-region Levenberg-Marquardt algorithm.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the explanatory variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
integer, | intent(in) | :: | npp |
Number of function parameters being estimated. |
||
real(kind=wp), | intent(in) | :: | f(n,q) |
Weighted estimated values of |
||
real(kind=wp), | intent(in) | :: | fjacb(n,np,q) |
Jacobian with respect to |
||
real(kind=wp), | intent(in) | :: | fjacd(n,m,q) |
Jacobian with respect to |
||
real(kind=wp), | intent(in) | :: | wd(ldwd,ld2wd,m) |
|
||
integer, | intent(in) | :: | ldwd |
Leading dimension of array |
||
integer, | intent(in) | :: | ld2wd |
Second dimension of array |
||
real(kind=wp), | intent(in) | :: | ss(np) |
Scaling values used for the unfixed |
||
real(kind=wp), | intent(in) | :: | tt(ldtt,m) |
Scale used for the |
||
integer, | intent(in) | :: | ldtt |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | delta(n,m) |
Estimated errors in the explanatory variables. |
||
real(kind=wp), | intent(inout) | :: | alpha2 |
Current Levenberg-Marquardt parameter. |
||
real(kind=wp), | intent(inout) | :: | tau |
Trust region diameter. |
||
real(kind=wp), | intent(in) | :: | epsfcn |
Function's precision. |
||
logical, | intent(in) | :: | isodr |
Variable designating whether the solution is by ODR ( |
||
real(kind=wp), | intent(out) | :: | tfjacb(n,q,np) |
Array |
||
real(kind=wp), | intent(out) | :: | omega(q,q) |
Array |
||
real(kind=wp), | intent(out) | :: | u(np) |
Approximate null vector for |
||
real(kind=wp), | intent(out) | :: | qraux(np) |
Array required to recover the orthogonal part of the QR decomposition. |
||
integer, | intent(out) | :: | jpvt(np) |
Pivot vector. |
||
real(kind=wp), | intent(out) | :: | s(np) |
Step for |
||
real(kind=wp), | intent(out) | :: | t(n,m) |
Step for |
||
integer, | intent(out) | :: | nlms |
Number of Levenberg-Marquardt steps taken. |
||
real(kind=wp), | intent(out) | :: | rcond |
Approximate reciprocal condition of |
||
integer, | intent(out) | :: | irank |
Aank deficiency of the Jacobian wrt |
||
real(kind=wp), | intent(out) | :: | wrk1(n,q,m) |
Work array of |
||
real(kind=wp), | intent(out) | :: | wrk2(n,q) |
Work array of |
||
real(kind=wp), | intent(out) | :: | wrk3(np) |
Work array of |
||
real(kind=wp), | intent(out) | :: | wrk4(m,m) |
Work array of |
||
real(kind=wp), | intent(out) | :: | wrk5(m) |
Work array of |
||
real(kind=wp), | intent(out) | :: | wrk(lwrk) |
Work array of |
||
integer, | intent(in) | :: | lwrk |
Length of vector |
||
integer, | intent(out) | :: | istopc |
Variable designating whether the computations were stopped due to some other
numerical error detected within subroutine |
Access or store values in the work arrays.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the explanatory variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
integer, | intent(in) | :: | ldwe |
Leading dimension of array |
||
integer, | intent(in) | :: | ld2we |
Second dimension of array |
||
real(kind=wp), | intent(inout) | :: | rwork(lrwork) |
Real work space. |
||
integer, | intent(in) | :: | lrwork |
Length of vector |
||
integer, | intent(inout) | :: | iwork(liwork) |
Integer work space. |
||
integer, | intent(in) | :: | liwork |
Length of vector |
||
logical, | intent(in) | :: | access |
Variable designating whether information is to be accessed from the work
arrays ( |
||
logical, | intent(in) | :: | isodr |
Variable designating whether the solution is to be found by ODR ( |
||
integer, | intent(out) | :: | jpvt |
Pivot vector. |
||
integer, | intent(out) | :: | omega |
Starting location in array |
||
integer, | intent(out) | :: | u |
Starting location in array |
||
integer, | intent(out) | :: | qraux |
Starting location in array |
||
integer, | intent(out) | :: | sd |
Starting location in array |
||
integer, | intent(out) | :: | vcv |
Starting location in array |
||
integer, | intent(out) | :: | wrk1 |
Starting location in array |
||
integer, | intent(out) | :: | wrk2 |
Starting location in array |
||
integer, | intent(out) | :: | wrk3 |
Starting location in array |
||
integer, | intent(out) | :: | wrk4 |
Starting location in array |
||
integer, | intent(out) | :: | wrk5 |
Starting location in array |
||
integer, | intent(out) | :: | wrk6 |
Starting location in array |
||
integer, | intent(out) | :: | nnzw |
Number of nonzero weighted observations. |
||
integer, | intent(out) | :: | npp |
Number of function parameters actually estimated. |
||
integer, | intent(out) | :: | job |
Variable controlling problem initialization and computational method. |
||
real(kind=wp), | intent(inout) | :: | partol |
Parameter convergence stopping tolerance. |
||
real(kind=wp), | intent(inout) | :: | sstol |
Sum-of-squares convergence stopping tolerance. |
||
integer, | intent(out) | :: | maxit |
Maximum number of iterations allowed. |
||
real(kind=wp), | intent(out) | :: | taufac |
Factor used to compute the initial trust region diameter. |
||
real(kind=wp), | intent(out) | :: | eta |
Relative noise in the function results. |
||
integer, | intent(out) | :: | neta |
Number of accurate digits in the function results. |
||
integer, | intent(out) | :: | lunrpt |
Logical unit number used for computation reports. |
||
integer, | intent(out) | :: | ipr1 |
Value of the fourth digit (from the right) of |
||
integer, | intent(out) | :: | ipr2 |
Value of the third digit (from the right) of |
||
integer, | intent(out) | :: | ipr2f |
Value of the second digit (from the right) of |
||
integer, | intent(out) | :: | ipr3 |
Value of the first digit (from the right) of |
||
real(kind=wp), | intent(inout) | :: | wss(3) |
Sum of the squares of the weighted |
||
real(kind=wp), | intent(inout) | :: | rvar |
Residual variance, i.e. the standard deviation squared. |
||
integer, | intent(inout) | :: | idf |
Degrees of freedom of the fit, equal to the number of observations with nonzero weighted derivatives minus the number of parameters being estimated. |
||
real(kind=wp), | intent(inout) | :: | tau |
Trust region diameter. |
||
real(kind=wp), | intent(inout) | :: | alpha |
Levenberg-Marquardt parameter. |
||
integer, | intent(inout) | :: | niter |
Number of iterations taken. |
||
integer, | intent(inout) | :: | nfev |
Number of function evaluations. |
||
integer, | intent(inout) | :: | njev |
Number of Jacobian evaluations. |
||
integer, | intent(inout) | :: | int2 |
Number of internal doubling steps. |
||
real(kind=wp), | intent(inout) | :: | olmavg |
Average number of Levenberg-Marquardt steps per iteration. |
||
real(kind=wp), | intent(inout) | :: | rcond |
Approximate reciprocal condition of |
||
integer, | intent(inout) | :: | irank |
Rank deficiency of the Jacobian wrt |
||
real(kind=wp), | intent(inout) | :: | actrs |
Saved actual relative reduction in the sum-of-squares. |
||
real(kind=wp), | intent(inout) | :: | pnorm |
Norm of the scaled estimated parameters. |
||
real(kind=wp), | intent(inout) | :: | prers |
Saved predicted relative reduction in the sum-of-squares. |
||
real(kind=wp), | intent(inout) | :: | rnorms |
Norm of the saved weighted |
||
integer, | intent(inout) | :: | istop |
Variable designating whether there are problems computing the function at the
current |
Compute e = wd + alpha*tt**2
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the independent variable. |
||
real(kind=wp), | intent(in) | :: | wd(ldwd,ld2wd,m) |
Squared |
||
integer, | intent(in) | :: | ldwd |
Leading dimension of array |
||
integer, | intent(in) | :: | ld2wd |
Second dimension of array |
||
real(kind=wp), | intent(in) | :: | alpha |
Levenberg-Marquardt parameter. |
||
real(kind=wp), | intent(in) | :: | tt(ldtt,m) |
Scaling values used for |
||
integer, | intent(in) | :: | ldtt |
Leading dimension of array |
||
integer, | intent(in) | :: | i |
Indexing variable. |
||
real(kind=wp), | intent(out) | :: | e(m,m) |
Value of the array |
Compute noise and number of good digits in function results.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(fcn_t) | :: | fcn |
User-supplied subroutine for evaluating the model. |
|||
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the explanatory variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
real(kind=wp), | intent(in) | :: | xplusd(n,m) |
Values of |
||
real(kind=wp), | intent(in) | :: | beta(np) |
Function parameters. |
||
real(kind=wp), | intent(in) | :: | epsmac |
Value of machine precision. |
||
integer, | intent(in) | :: | nrow |
Row number at which the derivative is to be checked. |
||
real(kind=wp), | intent(out) | :: | partmp(np) |
Model parameters. |
||
real(kind=wp), | intent(in) | :: | pv0(n,q) |
Original predicted values. |
||
integer, | intent(in) | :: | ifixb(np) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ifixx(ldifx,m) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ldifx |
Leading dimension of array |
||
integer, | intent(out) | :: | istop |
Variable designating whether there are problems computing the function at the
current |
||
integer, | intent(inout) | :: | nfev |
Number of function evaluations. |
||
real(kind=wp), | intent(out) | :: | eta |
Noise in the model results. |
||
integer, | intent(out) | :: | neta |
Number of accurate digits in the model results. |
||
real(kind=wp), | intent(out) | :: | fjacd(n,m,q) |
Jacobian wrt |
||
real(kind=wp), | intent(out) | :: | f(n,q) |
Function values. |
||
real(kind=wp), | intent(out) | :: | fjacb(n,np,q) |
Jacobian wrt |
||
real(kind=wp), | intent(out) | :: | wrk7(-2:2,q) |
Work array of |
||
integer, | intent(out) | :: | info |
Variable indicating the status of the computation. |
||
real(kind=wp), | intent(in) | :: | lower(np) |
Lower bound of |
||
real(kind=wp), | intent(in) | :: | upper(np) |
Upper bound of |
Compute the weighted Jacobians wrt beta
and delta
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(fcn_t) | :: | fcn |
User-supplied subroutine for evaluating the model. |
|||
logical, | intent(in) | :: | anajac |
Variable designating whether the Jacobians are computed by finite differences
( |
||
logical, | intent(in) | :: | cdjac |
Variable designating whether the Jacobians are computed by central differences
( |
||
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the independent variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
real(kind=wp), | intent(in) | :: | betac(np) |
Current estimated values of the unfixed |
||
real(kind=wp), | intent(out) | :: | beta(np) |
Function parameters. |
||
real(kind=wp), | intent(in) | :: | stpb(np) |
Relative step used for computing finite difference derivatives with respect to |
||
integer, | intent(in) | :: | ifixb(np) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ifixx(ldifx,m) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ldifx |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | x(n,m) |
Independent variable. |
||
real(kind=wp), | intent(in) | :: | delta(n,m) |
Estimated values of |
||
real(kind=wp), | intent(out) | :: | xplusd(n,m) |
Values of |
||
real(kind=wp), | intent(in) | :: | stpd(ldstpd,m) |
Relative step used for computing finite difference derivatives with respect to |
||
integer, | intent(in) | :: | ldstpd |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | ssf(np) |
Scale used for the |
||
real(kind=wp), | intent(in) | :: | tt(ldtt,m) |
Scaling values used for |
||
integer, | intent(in) | :: | ldtt |
Leading dimension of array |
||
integer, | intent(in) | :: | neta |
Number of accurate digits in the function results. |
||
real(kind=wp), | intent(in) | :: | fn(n,q) |
Predicted values of the function at the current point. |
||
real(kind=wp), | intent(out) | :: | stp(n) |
Step used for computing finite difference derivatives with respect to |
||
real(kind=wp), | intent(out) | :: | wrk1(n,m,q) |
Work array of |
||
real(kind=wp), | intent(out) | :: | wrk2(n,q) |
Work array of |
||
real(kind=wp), | intent(out) | :: | wrk3(np) |
Work array of |
||
real(kind=wp), | intent(out) | :: | wrk6(n,np,q) |
Work array of |
||
real(kind=wp), | intent(inout) | :: | tempret(:,:) |
Temporary work array for holding return values before copying to a lower rank array. |
||
real(kind=wp), | intent(out) | :: | fjacb(n,np,q) |
Jacobian with respect to |
||
logical, | intent(in) | :: | isodr |
Variable designating whether the solution is by ODR ( |
||
real(kind=wp), | intent(out) | :: | fjacd(n,m,q) |
Jacobian with respect to |
||
real(kind=wp), | intent(in) | :: | we1(ldwe,ld2we,q) |
Square roots of the |
||
integer, | intent(in) | :: | ldwe |
Leading dimension of arrays |
||
integer, | intent(in) | :: | ld2we |
Second dimension of arrays |
||
integer, | intent(inout) | :: | njev |
Number of Jacobian evaluations. |
||
integer, | intent(inout) | :: | nfev |
Number of function evaluations. |
||
integer, | intent(out) | :: | istop |
Variable designating that the user wishes the computations stopped. |
||
integer, | intent(out) | :: | info |
Variable designating why the computations were stopped. |
||
real(kind=wp), | intent(in) | :: | lower(np) |
Lower bound of |
||
real(kind=wp), | intent(in) | :: | upper(np) |
Upper bound of |
Factor the positive (semi)definite matrix a
using a modified Cholesky factorization.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical, | intent(in) | :: | oksemi |
Flag indicating whether the factored array can be positive semidefinite
( |
||
real(kind=wp), | intent(inout) | :: | a(lda,n) |
Array to be factored. Upon return, |
||
integer, | intent(in) | :: | lda |
Leading dimension of array |
||
integer, | intent(in) | :: | n |
Number of rows and columns of data in array |
||
integer, | intent(out) | :: | info |
Output flag.
|
Check input parameters, indicating errors found using nonzero values of argument info
as described in the ODRPACK95 reference guide.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the explanatory variable. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
integer, | intent(in) | :: | npp |
Number of function parameters being estimated. |
||
logical, | intent(in) | :: | isodr |
Variable designating whether the solution is by ODR ( |
||
real(kind=wp), | intent(in) | :: | we(ldwe,ld2we,q) |
Squared |
||
integer, | intent(in) | :: | ldwe |
Leading dimension of array |
||
integer, | intent(in) | :: | ld2we |
Second dimension of array |
||
real(kind=wp), | intent(in) | :: | wd(ldwd,ld2wd,m) |
Squared |
||
integer, | intent(in) | :: | ldwd |
Leading dimension of array |
||
integer, | intent(in) | :: | ld2wd |
Second dimension of array |
||
real(kind=wp), | intent(out) | :: | wrk0(q,q) |
Work array of |
||
real(kind=wp), | intent(out) | :: | wrk4(m,m) |
Work array of |
||
real(kind=wp), | intent(out) | :: | we1(ldwe,ld2we,q) |
Factored |
||
integer, | intent(out) | :: | nnzw |
Number of nonzero weighted observations. |
||
integer, | intent(out) | :: | info |
Variable designating why the computations were stopped. |
Set flags indicating conditions specified by job
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | job |
Variable controlling problem initialization and computational method. |
||
logical, | intent(out) | :: | restart |
Variable designating whether the call is a restart ( |
||
logical, | intent(out) | :: | initd |
Variable designating whether |
||
logical, | intent(out) | :: | dovcv |
Variable designating whether the covariance matrix is to be computed ( |
||
logical, | intent(out) | :: | redoj |
Variable designating whether the Jacobian matrix is to be recomputed for the
computation of the covariance matrix ( |
||
logical, | intent(out) | :: | anajac |
Variable designating whether the Jacobians are computed by finite differences
( |
||
logical, | intent(out) | :: | cdjac |
Variable designating whether the Jacobians are computed by central differences
( |
||
logical, | intent(out) | :: | chkjac |
Variable designating whether the user-supplied Jacobians are to be checked
( |
||
logical, | intent(out) | :: | isodr |
Variable designating whether the solution is by ODR ( |
||
logical, | intent(out) | :: | implicit |
Variable designating whether the solution is by implicit ODR ( |
Set elements of t
to zero according to ifix
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of rows of data in the array. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the array. |
||
integer, | intent(in) | :: | ifix(ldifix,m) |
Array designating whether an element of |
||
integer, | intent(in) | :: | ldifix |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | t(ldt,m) |
Array being set to zero according to the elements of |
||
integer, | intent(in) | :: | ldt |
Leading dimension of array |
||
real(kind=wp), | intent(out) | :: | tfix(ldtfix,m) |
Resulting array. |
||
integer, | intent(in) | :: | ldtfix |
Leading dimension of array |
Get storage locations within integer work space.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | m |
Number of columns of data in the independent variable. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(out) | :: | msgbi |
Starting location in array |
||
integer, | intent(out) | :: | msgdi |
Starting location in array |
||
integer, | intent(out) | :: | ifix2i |
Starting location in array |
||
integer, | intent(out) | :: | istopi |
Location in array |
||
integer, | intent(out) | :: | nnzwi |
Location in array |
||
integer, | intent(out) | :: | nppi |
Location in array |
||
integer, | intent(out) | :: | idfi |
Location in array |
||
integer, | intent(out) | :: | jobi |
Location in array |
||
integer, | intent(out) | :: | iprinti |
Location in array |
||
integer, | intent(out) | :: | lunerri |
Location in array |
||
integer, | intent(out) | :: | lunrpti |
Location in array |
||
integer, | intent(out) | :: | nrowi |
Location in array |
||
integer, | intent(out) | :: | ntoli |
Location in array |
||
integer, | intent(out) | :: | netai |
Location in array |
||
integer, | intent(out) | :: | maxiti |
Location in array |
||
integer, | intent(out) | :: | niteri |
Location in array |
||
integer, | intent(out) | :: | nfevi |
Location in array |
||
integer, | intent(out) | :: | njevi |
Location in array |
||
integer, | intent(out) | :: | int2i |
Location in array |
||
integer, | intent(out) | :: | iranki |
Location in array |
||
integer, | intent(out) | :: | ldtti |
Location in array |
||
integer, | intent(out) | :: | boundi |
Location in array |
||
integer, | intent(out) | :: | liwkmin |
Minimum acceptable length of array |
Get storage locations within real work space.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the explanatory variable. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | ldwe |
Leading dimension of array |
||
integer, | intent(in) | :: | ld2we |
Second dimension of array |
||
logical, | intent(in) | :: | isodr |
Variable designating whether the solution is by ODR ( |
||
integer, | intent(out) | :: | deltai |
Starting location in array |
||
integer, | intent(out) | :: | epsi |
Starting location in array |
||
integer, | intent(out) | :: | xplusdi |
Starting location in array |
||
integer, | intent(out) | :: | fni |
Starting location in array |
||
integer, | intent(out) | :: | sdi |
Starting location in array |
||
integer, | intent(out) | :: | vcvi |
Starting location in array |
||
integer, | intent(out) | :: | rvari |
Location in array |
||
integer, | intent(out) | :: | wssi |
Location in array |
||
integer, | intent(out) | :: | wssdeli |
Location in array |
||
integer, | intent(out) | :: | wssepsi |
Location in array |
||
integer, | intent(out) | :: | rcondi |
Location in array |
||
integer, | intent(out) | :: | etai |
Location in array |
||
integer, | intent(out) | :: | olmavgi |
Location in array |
||
integer, | intent(out) | :: | taui |
Location in array |
||
integer, | intent(out) | :: | alphai |
Location in array |
||
integer, | intent(out) | :: | actrsi |
Location in array |
||
integer, | intent(out) | :: | pnormi |
Location in array |
||
integer, | intent(out) | :: | rnormsi |
Location in array |
||
integer, | intent(out) | :: | prersi |
Location in array |
||
integer, | intent(out) | :: | partoli |
Location in array |
||
integer, | intent(out) | :: | sstoli |
Location in array |
||
integer, | intent(out) | :: | taufaci |
Location in array |
||
integer, | intent(out) | :: | epsmaci |
Location in array |
||
integer, | intent(out) | :: | beta0i |
Starting location in array |
||
integer, | intent(out) | :: | betaci |
Starting location in array |
||
integer, | intent(out) | :: | betasi |
Starting location in array |
||
integer, | intent(out) | :: | betani |
Starting location in array |
||
integer, | intent(out) | :: | si |
Starting location in array |
||
integer, | intent(out) | :: | ssi |
Starting location in array |
||
integer, | intent(out) | :: | ssfi |
Starting location in array |
||
integer, | intent(out) | :: | qrauxi |
Starting location in array |
||
integer, | intent(out) | :: | ui |
Starting location in array |
||
integer, | intent(out) | :: | fsi |
Starting location in array |
||
integer, | intent(out) | :: | fjacbi |
Starting location in array |
||
integer, | intent(out) | :: | we1i |
Starting location in array |
||
integer, | intent(out) | :: | diffi |
Starting location in array |
||
integer, | intent(out) | :: | deltasi |
Starting location in array |
||
integer, | intent(out) | :: | deltani |
Starting location in array |
||
integer, | intent(out) | :: | ti |
Starting location in array |
||
integer, | intent(out) | :: | tti |
Starting location in array |
||
integer, | intent(out) | :: | omegai |
Starting location in array |
||
integer, | intent(out) | :: | fjacdi |
Starting location in array |
||
integer, | intent(out) | :: | wrk1i |
Starting location in array |
||
integer, | intent(out) | :: | wrk2i |
Starting location in array |
||
integer, | intent(out) | :: | wrk3i |
Starting location in array |
||
integer, | intent(out) | :: | wrk4i |
Starting location in array |
||
integer, | intent(out) | :: | wrk5i |
Starting location in array |
||
integer, | intent(out) | :: | wrk6i |
Starting location in array |
||
integer, | intent(out) | :: | wrk7i |
Starting location in array |
||
integer, | intent(out) | :: | loweri |
Starting location in array |
||
integer, | intent(out) | :: | upperi |
Starting location in array |
||
integer, | intent(out) | :: | lrwkmin |
Minimum acceptable length of vector |
Initialize work vectors as necessary.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the independent variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
real(kind=wp), | intent(out) | :: | rwork(lrwork) |
Real work space. |
||
integer, | intent(in) | :: | lrwork |
Length of vector |
||
integer, | intent(out) | :: | iwork(liwork) |
Integer work space. |
||
integer, | intent(in) | :: | liwork |
Length of vector |
||
real(kind=wp), | intent(in) | :: | x(n,m) |
Independent variable. |
||
integer, | intent(in) | :: | ifixx(ldifx,m) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ldifx |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | scld(ldscld,m) |
Scaling values for |
||
integer, | intent(in) | :: | ldscld |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | beta(np) |
Function parameters. |
||
real(kind=wp), | intent(in) | :: | sclb(np) |
Scaling values for |
||
real(kind=wp), | intent(in) | :: | sstol |
Sum-of-squares convergence stopping criteria. |
||
real(kind=wp), | intent(in) | :: | partol |
Parameter convergence stopping criteria. |
||
integer, | intent(in) | :: | maxit |
Maximum number of iterations allowed. |
||
real(kind=wp), | intent(in) | :: | taufac |
Factor used to compute the initial trust region diameter. |
||
integer, | intent(in) | :: | job |
Variable controlling problem initialization and computational method. |
||
integer, | intent(in) | :: | iprint |
Print control variable. |
||
integer, | intent(in) | :: | lunerr |
Logical unit number used for error messages. |
||
integer, | intent(in) | :: | lunrpt |
Logical unit number used for computation reports. |
||
real(kind=wp), | intent(in) | :: | lower(np) |
Lower bounds for the function parameters. |
||
real(kind=wp), | intent(in) | :: | upper(np) |
Upper bounds for the function parameters. |
||
integer, | intent(in) | :: | epsmai |
Location in array |
||
integer, | intent(in) | :: | sstoli |
Location in array |
||
integer, | intent(in) | :: | partli |
Location in array |
||
integer, | intent(in) | :: | maxiti |
Location in array |
||
integer, | intent(in) | :: | taufci |
Location in array |
||
integer, | intent(in) | :: | jobi |
Location in array |
||
integer, | intent(in) | :: | iprini |
Location in array |
||
integer, | intent(in) | :: | luneri |
Location in array |
||
integer, | intent(in) | :: | lunrpi |
Location in array |
||
integer, | intent(in) | :: | ssfi |
Starting location in array |
||
integer, | intent(in) | :: | tti |
Starting location in array |
||
integer, | intent(in) | :: | ldtti |
Leading dimension of array |
||
integer, | intent(in) | :: | deltai |
Starting location in array |
||
integer, | intent(in) | :: | loweri |
Starting location in array |
||
integer, | intent(in) | :: | upperi |
Starting location in array |
||
integer, | intent(in) | :: | boundi |
Location in array |
Compute central difference approximations to the Jacobian wrt the estimated beta
s and
wrt the delta
s.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(fcn_t) | :: | fcn |
User supplied subroutine for evaluating the model. |
|||
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the explanatory variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
real(kind=wp), | intent(inout) | :: | beta(np) |
Function parameters. |
||
real(kind=wp), | intent(in) | :: | x(n,m) |
Explanatory variable. |
||
real(kind=wp), | intent(in) | :: | delta(n,m) |
Estimated errors in the explanatory variables. |
||
real(kind=wp), | intent(inout) | :: | xplusd(n,m) |
Values of |
||
integer, | intent(in) | :: | ifixb(np) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ifixx(ldifx,m) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ldifx |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | stpb(np) |
Relative step used for computing finite difference derivatives with respect to each |
||
real(kind=wp), | intent(in) | :: | stpd(ldstpd,m) |
Relative step used for computing finite difference derivatives with respect to each |
||
integer, | intent(in) | :: | ldstpd |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | ssf(np) |
Scaling values used for |
||
real(kind=wp), | intent(in) | :: | tt(ldtt,m) |
Scaling values used for |
||
integer, | intent(in) | :: | ldtt |
Leading dimension of array |
||
integer, | intent(in) | :: | neta |
Number of good digits in the function results. |
||
real(kind=wp), | intent(in) | :: | fn(n,q) |
New predicted values from the function. Used when parameter is on a boundary. |
||
real(kind=wp), | intent(out) | :: | stp(n) |
Step used for computing finite difference derivatives with respect to each |
||
real(kind=wp), | intent(out) | :: | wrk1(n,m,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk2(n,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk3(np) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk6(n,np,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | fjacb(n,np,q) |
Jacobian with respect to |
||
logical, | intent(in) | :: | isodr |
Variable designating whether the solution is by ODR ( |
||
real(kind=wp), | intent(out) | :: | fjacd(n,m,q) |
Jacobian with respect to |
||
integer, | intent(inout) | :: | nfev |
Number of function evaluations. |
||
integer, | intent(out) | :: | istop |
Variable designating whether there are problems computing the function at the
current |
||
integer, | intent(out) | :: | info |
Variable designating why the computations were stopped. |
||
real(kind=wp), | intent(in) | :: | lower(np) |
Lower bound on |
||
real(kind=wp), | intent(in) | :: | upper(np) |
Upper bound on |
Compute forward difference approximations to the Jacobian wrt the estimated beta
s and
wrt the delta
s.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(fcn_t) | :: | fcn |
User supplied subroutine for evaluating the model. |
|||
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the explanatory variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
real(kind=wp), | intent(inout) | :: | beta(np) |
Function parameters. |
||
real(kind=wp), | intent(in) | :: | x(n,m) |
Explanatory variable. |
||
real(kind=wp), | intent(in) | :: | delta(n,m) |
Estimated errors in the explanatory variables. |
||
real(kind=wp), | intent(inout) | :: | xplusd(n,m) |
Values of |
||
integer, | intent(in) | :: | ifixb(np) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ifixx(ldifx,m) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ldifx |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | stpb(np) |
Relative step used for computing finite difference derivatives with respect to each |
||
real(kind=wp), | intent(in) | :: | stpd(ldstpd,m) |
Relative step used for computing finite difference derivatives with respect to each |
||
integer, | intent(in) | :: | ldstpd |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | ssf(np) |
Scaling values used for |
||
real(kind=wp), | intent(in) | :: | tt(ldtt,m) |
Scaling values used for |
||
integer, | intent(in) | :: | ldtt |
Leading dimension of array |
||
integer, | intent(in) | :: | neta |
Number of good digits in the function results. |
||
real(kind=wp), | intent(in) | :: | fn(n,q) |
New predicted values from the function. Used when parameter is on a boundary. |
||
real(kind=wp), | intent(out) | :: | stp(n) |
Step used for computing finite difference derivatives with respect to each |
||
real(kind=wp), | intent(out) | :: | wrk1(n,m,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk2(n,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk3(np) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk6(n,np,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | fjacb(n,np,q) |
Jacobian with respect to |
||
logical, | intent(in) | :: | isodr |
Variable designating whether the solution is by ODR ( |
||
real(kind=wp), | intent(out) | :: | fjacd(n,m,q) |
Jacobian with respect to |
||
integer, | intent(inout) | :: | nfev |
Number of function evaluations. |
||
integer, | intent(out) | :: | istop |
Variable designating whether there are problems computing the function at the
current |
||
integer, | intent(out) | :: | info |
Variable designating why the computations were stopped. |
||
real(kind=wp), | intent(in) | :: | lower(np) |
Lower bound on |
||
real(kind=wp), | intent(in) | :: | upper(np) |
Upper bound on |
Driver routine for the derivative checking process.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(fcn_t) | :: | fcn |
User supplied subroutine for evaluating the model. |
|||
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the explanatory variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
real(kind=wp), | intent(inout) | :: | beta(np) |
Function parameters. |
||
real(kind=wp), | intent(inout) | :: | betaj(np) |
Function parameters offset such that steps don't cross bounds. |
||
real(kind=wp), | intent(inout) | :: | xplusd(n,m) |
Values of |
||
integer, | intent(in) | :: | ifixb(np) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ifixx(ldifx,m) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ldifx |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | stpb(np) |
Step size for finite difference derivatives wrt |
||
real(kind=wp), | intent(in) | :: | stpd(ldstpd,m) |
Step size for finite difference derivatives wrt |
||
integer, | intent(in) | :: | ldstpd |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | ssf(np) |
Scaling values used for |
||
real(kind=wp), | intent(in) | :: | tt(ldtt,m) |
Scaling values used for |
||
integer, | intent(in) | :: | ldtt |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | eta |
Relative noise in the function results. |
||
integer, | intent(in) | :: | neta |
Number of reliable digits in the model results. |
||
integer, | intent(out) | :: | ntol |
Number of digits of agreement required between the numerical derivatives and the user supplied derivatives. |
||
integer, | intent(in) | :: | nrow |
Row number of the explanatory variable array at which the derivative is checked. |
||
logical, | intent(in) | :: | isodr |
Variable designating whether the solution is by ODR ( |
||
real(kind=wp), | intent(in) | :: | epsmac |
Value of machine precision. |
||
real(kind=wp), | intent(in) | :: | pv0i(n,q) |
Predicted values using the user supplied parameter estimates. |
||
real(kind=wp), | intent(out) | :: | fjacb(n,np,q) |
Jacobian with respect to |
||
real(kind=wp), | intent(out) | :: | fjacd(n,m,q) |
Jacobian with respect to |
||
integer, | intent(out) | :: | msgb(1+q*np) |
Error checking results for the Jacobian wrt |
||
integer, | intent(out) | :: | msgd(1+q*m) |
Error checking results for the Jacobian wrt |
||
real(kind=wp), | intent(out) | :: | diff(q,np+m) |
Relative differences between the user supplied and finite difference derivatives for each derivative checked. |
||
integer, | intent(out) | :: | istop |
Variable designating whether there are problems computing the function at the
current |
||
integer, | intent(inout) | :: | nfev |
Number of function evaluations. |
||
integer, | intent(inout) | :: | njev |
Number of Jacobian evaluations. |
||
real(kind=wp), | intent(out) | :: | wrk1(n,m,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk2(n,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk6(n,np,q) |
A work array of |
||
integer, | intent(in) | :: | interval(np) |
Specifies which checks can be performed when checking derivatives based on the interval of the bound constraints. |
Check whether high curvature could be the cause of the disagreement between the numerical and analytic derviatives.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(fcn_t) | :: | fcn |
User supplied subroutine for evaluating the model. |
|||
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the explanatory variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
real(kind=wp), | intent(inout) | :: | beta(np) |
Function parameters. |
||
real(kind=wp), | intent(inout) | :: | xplusd(n,m) |
Values of |
||
integer, | intent(in) | :: | ifixb(np) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ifixx(ldifx,m) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ldifx |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | eta |
Relative noise in the model. |
||
real(kind=wp), | intent(in) | :: | tol |
Agreement tolerance. |
||
integer, | intent(in) | :: | nrow |
Row number of the explanatory variable array at which the derivative is to be checked. |
||
real(kind=wp), | intent(in) | :: | epsmac |
Value of machine precision. |
||
integer, | intent(in) | :: | j |
Index of the partial derivative being examined. |
||
integer, | intent(in) | :: | lq |
Response currently being examined. |
||
real(kind=wp), | intent(in) | :: | hc |
Relative step size for central finite differences. |
||
logical, | intent(in) | :: | iswrtb |
Variable designating whether the derivatives wrt |
||
real(kind=wp), | intent(out) | :: | fd |
Forward difference derivative wrt the |
||
real(kind=wp), | intent(in) | :: | typj |
Typical size of the |
||
real(kind=wp), | intent(out) | :: | pvpstp |
Predicted value for row |
||
real(kind=wp), | intent(in) | :: | stp0 |
Initial step size for the finite difference derivative. |
||
real(kind=wp), | intent(in) | :: | pv |
Predicted value of the model for row |
||
real(kind=wp), | intent(in) | :: | d |
Derivative with respect to the |
||
real(kind=wp), | intent(out) | :: | diffj |
Relative differences between the user supplied and finite difference derivatives for the derivative being checked. |
||
integer, | intent(out) | :: | msg(q,j) |
Error checking results. |
||
integer, | intent(out) | :: | istop |
Variable designating whether there are problems computing the function at the
current |
||
integer, | intent(inout) | :: | nfev |
Number of function evaluations. |
||
real(kind=wp), | intent(out) | :: | wrk1(n,m,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk2(n,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk6(n,np,q) |
A work array of |
Check whether finite precision arithmetic could be the cause of the disagreement between the derivatives.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(fcn_t) | :: | fcn |
User supplied subroutine for evaluating the model. |
|||
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the explanatory variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
real(kind=wp), | intent(inout) | :: | beta(np) |
Function parameters. |
||
real(kind=wp), | intent(inout) | :: | xplusd(n,m) |
Values of |
||
integer, | intent(in) | :: | ifixb(np) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ifixx(ldifx,m) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ldifx |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | eta |
Relative noise in the model. |
||
real(kind=wp), | intent(in) | :: | tol |
Agreement tolerance. |
||
integer, | intent(in) | :: | nrow |
Row number of the explanatory variable array at which the derivative is to be checked. |
||
integer, | intent(in) | :: | j |
Index of the partial derivative being examined. |
||
integer, | intent(in) | :: | lq |
Response currently being examined. |
||
logical, | intent(in) | :: | iswrtb |
Variable designating whether the derivatives wrt |
||
real(kind=wp), | intent(out) | :: | fd |
Forward difference derivative wrt the |
||
real(kind=wp), | intent(in) | :: | typj |
Typical size of the |
||
real(kind=wp), | intent(out) | :: | pvpstp |
Predicted value for row |
||
real(kind=wp), | intent(in) | :: | stp0 |
Step size for the finite difference derivative. |
||
real(kind=wp), | intent(inout) | :: | curve |
A measure of the curvature in the model. |
||
real(kind=wp), | intent(in) | :: | pv |
Predicted value for row |
||
real(kind=wp), | intent(in) | :: | d |
Derivative with respect to the |
||
real(kind=wp), | intent(out) | :: | diffj |
Relative differences between the user supplied and finite difference derivatives for the derivative being checked. |
||
integer, | intent(out) | :: | msg(q,j) |
Error checking results. |
||
integer, | intent(out) | :: | istop |
Variable designating whether there are problems computing the function at the
current |
||
integer, | intent(inout) | :: | nfev |
Number of function evaluations. |
||
real(kind=wp), | intent(out) | :: | wrk1(n,m,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk2(n,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk6(n,np,q) |
A work array of |
Check user supplied analytic derivatives against numerical derivatives.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(fcn_t) | :: | fcn |
User supplied subroutine for evaluating the model. |
|||
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the explanatory variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
real(kind=wp), | intent(inout) | :: | beta(np) |
Function parameters. |
||
real(kind=wp), | intent(inout) | :: | xplusd(n,m) |
Values of |
||
integer, | intent(in) | :: | ifixb(np) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ifixx(ldifx,m) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ldifx |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | eta |
Relative noise in the model. |
||
real(kind=wp), | intent(in) | :: | tol |
Agreement tolerance. |
||
integer, | intent(in) | :: | nrow |
Row number of the explanatory variable array at which the derivative is to be checked. |
||
real(kind=wp), | intent(in) | :: | epsmac |
Value of machine precision. |
||
integer, | intent(in) | :: | j |
Index of the partial derivative being examined. |
||
integer, | intent(in) | :: | lq |
Response currently being examined. |
||
real(kind=wp), | intent(in) | :: | typj |
Typical size of the |
||
real(kind=wp), | intent(in) | :: | h0 |
Initial step size for the finite difference derivative. |
||
real(kind=wp), | intent(in) | :: | hc0 |
Relative step size for central finite differences. |
||
logical, | intent(in) | :: | iswrtb |
Variable designating whether the derivatives wrt |
||
real(kind=wp), | intent(in) | :: | pv |
Predicted value for row |
||
real(kind=wp), | intent(in) | :: | d |
Derivative with respect to the |
||
real(kind=wp), | intent(out) | :: | diffj |
Relative differences between the user supplied and finite difference derivatives for the derivative being checked. |
||
integer, | intent(out) | :: | msg1 |
First set of error checking results. |
||
integer, | intent(out) | :: | msg(q,j) |
Error checking results. |
||
integer, | intent(out) | :: | istop |
Variable designating whether there are problems computing the function at the
current |
||
integer, | intent(inout) | :: | nfev |
Number of function evaluations. |
||
real(kind=wp), | intent(out) | :: | wrk1(n,m,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk2(n,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk6(n,np,q) |
A work array of |
||
integer, | intent(in) | :: | interval(np) |
Specifies which checks can be performed when checking derivatives based on the interval of the bound constraints. |
Recheck the derivatives in the case where the finite difference derivative disagrees with the analytic derivative and the analytic derivative is zero.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(fcn_t) | :: | fcn |
User supplied subroutine for evaluating the model. |
|||
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the explanatory variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
real(kind=wp), | intent(inout) | :: | beta(np) |
Function parameters. |
||
real(kind=wp), | intent(inout) | :: | xplusd(n,m) |
Values of |
||
integer, | intent(in) | :: | ifixb(np) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ifixx(ldifx,m) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ldifx |
Leading dimension of array |
||
integer, | intent(in) | :: | nrow |
Row number of the explanatory variable array at which the derivative is to be checked. |
||
real(kind=wp), | intent(in) | :: | epsmac |
Value of machine precision. |
||
integer, | intent(in) | :: | j |
Index of the partial derivative being examined. |
||
integer, | intent(in) | :: | lq |
Response currently being examined. |
||
logical, | intent(in) | :: | iswrtb |
Variable designating whether the derivatives wrt |
||
real(kind=wp), | intent(in) | :: | tol |
Agreement tolerance. |
||
real(kind=wp), | intent(in) | :: | d |
Derivative with respect to the |
||
real(kind=wp), | intent(in) | :: | fd |
Forward difference derivative wrt the |
||
real(kind=wp), | intent(in) | :: | typj |
Typical size of the |
||
real(kind=wp), | intent(in) | :: | pvpstp |
Predicted value for row |
||
real(kind=wp), | intent(in) | :: | stp0 |
Initial step size for the finite difference derivative. |
||
real(kind=wp), | intent(in) | :: | pv |
Predicted value from the model for row |
||
real(kind=wp), | intent(out) | :: | diffj |
Relative differences between the user supplied and finite difference derivatives for the derivative being checked. |
||
integer, | intent(out) | :: | msg(q,j) |
Error checking results. |
||
integer, | intent(out) | :: | istop |
Variable designating whether there are problems computing the function at the
current |
||
integer, | intent(inout) | :: | nfev |
Number of function evaluations. |
||
real(kind=wp), | intent(out) | :: | wrk1(n,m,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk2(n,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk6(n,np,q) |
A work array of |
Check input parameters, indicating errors found using nonzero values of argument info
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the explanatory variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
logical, | intent(in) | :: | isodr |
Variable designating whether the solution is by ODR ( |
||
logical, | intent(in) | :: | anajac |
Variable designating whether the Jacobians are computed by finite differences
( |
||
real(kind=wp), | intent(in) | :: | beta(np) |
Function parameters. |
||
integer, | intent(in) | :: | ifixb(np) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ldifx |
Leading dimension of array |
||
integer, | intent(in) | :: | ldscld |
Leading dimension of array |
||
integer, | intent(in) | :: | ldstpd |
Leading dimension of array |
||
integer, | intent(in) | :: | ldwe |
Leading dimension of array |
||
integer, | intent(in) | :: | ld2we |
Second dimension of array |
||
integer, | intent(in) | :: | ldwd |
Leading dimension of array |
||
integer, | intent(in) | :: | ld2wd |
Second dimension of array |
||
integer, | intent(in) | :: | lrwork |
Length of vector |
||
integer, | intent(in) | :: | lrwkmin |
Minimum acceptable length of array |
||
integer, | intent(in) | :: | liwork |
Length of vector |
||
integer, | intent(in) | :: | liwkmin |
Minimum acceptable length of array |
||
real(kind=wp), | intent(in) | :: | sclb(np) |
Scaling values for |
||
real(kind=wp), | intent(in) | :: | scld(ldscld,m) |
Scaling value for |
||
real(kind=wp), | intent(in) | :: | stpb(np) |
Step for the finite difference derivative wrt |
||
real(kind=wp), | intent(in) | :: | stpd(ldstpd,m) |
Step for the finite difference derivative wrt |
||
integer, | intent(out) | :: | info |
Variable designating why the computations were stopped. |
||
real(kind=wp), | intent(in) | :: | lower(np) |
Lower bound on |
||
real(kind=wp), | intent(in) | :: | upper(np) |
Upper bound on |
Compute locally constrained steps s
and t
, and phi(alpha)
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the explanatory variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
integer, | intent(in) | :: | npp |
Number of function parameters being estimated. |
||
real(kind=wp), | intent(in) | :: | f(n,q) |
Weighted estimated values of |
||
real(kind=wp), | intent(in) | :: | fjacb(n,np,q) |
Jacobian with respect to |
||
real(kind=wp), | intent(in) | :: | fjacd(n,m,q) |
Jacobian with respect to |
||
real(kind=wp), | intent(in) | :: | wd(ldwd,ld2wd,m) |
Squared |
||
integer, | intent(in) | :: | ldwd |
Leading dimension of array |
||
integer, | intent(in) | :: | ld2wd |
Second dimension of array |
||
real(kind=wp), | intent(in) | :: | ss(np) |
Scaling values for the unfixed |
||
real(kind=wp), | intent(in) | :: | tt(ldtt,m) |
Scaling values for |
||
integer, | intent(in) | :: | ldtt |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | delta(n,m) |
Estimated errors in the explanatory variables. |
||
real(kind=wp), | intent(in) | :: | alpha |
Levenberg-Marquardt parameter. |
||
real(kind=wp), | intent(in) | :: | epsfcn |
Function's precision. |
||
logical, | intent(in) | :: | isodr |
Variable designating whether the solution is by ODR ( |
||
real(kind=wp), | intent(out) | :: | tfjacb(n,q,np) |
Array |
||
real(kind=wp), | intent(out) | :: | omega(q,q) |
Array defined such that:
|
||
real(kind=wp), | intent(out) | :: | u(np) |
Approximate null vector for |
||
real(kind=wp), | intent(out) | :: | qraux(np) |
Array required to recover the orthogonal part of the Q-R decomposition. |
||
integer, | intent(out) | :: | kpvt(np) |
Pivot vector. |
||
real(kind=wp), | intent(out) | :: | s(np) |
Step for |
||
real(kind=wp), | intent(out) | :: | t(n,m) |
Step for |
||
real(kind=wp), | intent(out) | :: | phi |
Difference between the norm of the scaled step and the trust region diameter. |
||
integer, | intent(out) | :: | irank |
Rank deficiency of the Jacobian wrt |
||
real(kind=wp), | intent(out) | :: | rcond |
Approximate reciprocal condition number of |
||
logical, | intent(in) | :: | forvcv |
Variable designating whether this subroutine was called to set up for the
covariance matrix computations ( |
||
real(kind=wp), | intent(out) | :: | wrk1(n,q,m) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk2(n,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk3(np) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk4(m,m) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk5(m) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk(lwrk) |
A work array of |
||
integer, | intent(in) | :: | lwrk |
Length of vector |
||
integer, | intent(inout) | :: | istopc |
Variable designating whether the computations were stopped due to a numerical
error within subroutine |
Compute covariance matrix of estimated parameters.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the explanatory variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
integer, | intent(in) | :: | npp |
Number of function parameters being estimated. |
||
real(kind=wp), | intent(in) | :: | f(n,q) |
Weighted estimated values of |
||
real(kind=wp), | intent(in) | :: | fjacb(n,np,q) |
Jacobian with respect to |
||
real(kind=wp), | intent(in) | :: | fjacd(n,m,q) |
Jacobian with respect to |
||
real(kind=wp), | intent(in) | :: | wd(ldwd,ld2wd,m) |
|
||
integer, | intent(in) | :: | ldwd |
Leading dimension of array |
||
integer, | intent(in) | :: | ld2wd |
Second dimension of array |
||
real(kind=wp), | intent(in) | :: | ssf(np) |
Scaling values used for |
||
real(kind=wp), | intent(in) | :: | ss(np) |
Scaling values for the unfixed |
||
real(kind=wp), | intent(in) | :: | tt(ldtt,m) |
Scaling values for |
||
integer, | intent(in) | :: | ldtt |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | delta(n,m) |
Estimated errors in the explanatory variables. |
||
real(kind=wp), | intent(in) | :: | epsfcn |
Function's precision. |
||
logical, | intent(in) | :: | isodr |
Variable designating whether the solution is by ODR ( |
||
real(kind=wp), | intent(out) | :: | vcv(np,np) |
Covariance matrix of the estimated |
||
real(kind=wp), | intent(out) | :: | sd(np) |
Standard deviations of the estimated |
||
real(kind=wp), | intent(out) | :: | wrk6(n*q,np) |
A work array of |
||
real(kind=wp), | intent(out) | :: | omega(q,q) |
Array defined such that |
||
real(kind=wp), | intent(out) | :: | u(np) |
Approximate null vector for |
||
real(kind=wp), | intent(out) | :: | qraux(np) |
Array required to recover the orthogonal part of the Q-R decomposition. |
||
integer, | intent(out) | :: | jpvt(np) |
Pivot vector. |
||
real(kind=wp), | intent(out) | :: | s(np) |
Step for |
||
real(kind=wp), | intent(out) | :: | t(n,m) |
Step for |
||
integer, | intent(out) | :: | irank |
Rank deficiency of the Jacobian wrt |
||
real(kind=wp), | intent(out) | :: | rcond |
Approximate reciprocal condition of |
||
real(kind=wp), | intent(inout) | :: | rss |
Residual sum of squares. |
||
integer, | intent(out) | :: | idf |
Degrees of freedom of the fit, equal to the number of observations with nonzero weighted derivatives minus the number of parameters being estimated. |
||
real(kind=wp), | intent(out) | :: | rvar |
Residual variance. |
||
integer, | intent(in) | :: | ifixb(np) |
Values designating whether the elements of |
||
real(kind=wp), | intent(out) | :: | wrk1(n,q,m) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk2(n,q) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk3(np) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk4(m,m) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk5(m) |
A work array of |
||
real(kind=wp), | intent(out) | :: | wrk(lwrk) |
A work array of |
||
integer, | intent(in) | :: | lwrk |
Length of vector |
||
integer, | intent(out) | :: | istopc |
Variable designating whether the computations were stoped due to a numerical
error within subroutine |
Select the unfixed elements of v2
and return them in v1
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n2 |
Number of items in |
||
integer, | intent(out) | :: | n1 |
Number of items in |
||
real(kind=wp), | intent(out) | :: | v1(n2) |
Vector of the unfixed items from |
||
real(kind=wp), | intent(in) | :: | v2(n2) |
Vector of the fixed and unfixed items from which the unfixed elements are to be extracted. |
||
integer, | intent(in) | :: | ifix(n2) |
Values designating whether the elements of |
Copy the elements of v1
into the locations of v2
which are unfixed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n2 |
Number of items in |
||
real(kind=wp), | intent(in) | :: | v1(n2) |
Vector of the unfixed items. |
||
real(kind=wp), | intent(out) | :: | v2(n2) |
Vector of the fixed and unfixed items into which the elements of |
||
integer, | intent(in) | :: | ifix(n2) |
Values designating whether the elements of |
Compute the nrow
-th function value using beta(j) + stp
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(fcn_t) | :: | fcn |
User-supplied subroutine for evaluating the model. |
|||
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the independent variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
real(kind=wp), | intent(inout) | :: | beta(np) |
Function parameters. |
||
real(kind=wp), | intent(in) | :: | xplusd(n,m) |
Values of |
||
integer, | intent(in) | :: | ifixb(np) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ifixx(ldifx,m) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ldifx |
Leading dimension of array |
||
integer, | intent(in) | :: | nrow |
Row number of the independent variable array at which the derivative is to be checked. |
||
integer, | intent(in) | :: | j |
Index of the partial derivative being examined. |
||
integer, | intent(in) | :: | lq |
Response currently being examined. |
||
real(kind=wp), | intent(in) | :: | stp |
Step size for the finite difference derivative. |
||
integer, | intent(out) | :: | istop |
Variable designating whether there are problems computing the function at the
current |
||
integer, | intent(inout) | :: | nfev |
Number of function evaluations. |
||
real(kind=wp), | intent(out) | :: | pvb |
Function value for the selected observation & response. |
||
real(kind=wp), | intent(out) | :: | fjacd(n,m,q) |
Jacobian wrt delta. |
||
real(kind=wp), | intent(out) | :: | f(n,q) |
Predicted function values. |
||
real(kind=wp), | intent(out) | :: | fjacb(n,np,q) |
Jocobian wrt beta. |
Compute nrow
-th function value using x(nrow, j) + delta(nrow, j) + stp
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(fcn_t) | :: | fcn |
User-supplied subroutine for evaluating the model. |
|||
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the independent variable. |
||
integer, | intent(in) | :: | np |
Number of function parameters. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
real(kind=wp), | intent(in) | :: | beta(np) |
Function parameters. |
||
real(kind=wp), | intent(inout) | :: | xplusd(n,m) |
Values of |
||
integer, | intent(in) | :: | ifixb(np) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ifixx(ldifx,m) |
Values designating whether the elements of |
||
integer, | intent(in) | :: | ldifx |
Leading dimension of array |
||
integer, | intent(in) | :: | nrow |
Row number of the independent variable array at which the derivative is to be checked. |
||
integer, | intent(in) | :: | j |
Index of the partial derivative being examined. |
||
integer, | intent(in) | :: | lq |
Response currently being examined. |
||
real(kind=wp), | intent(in) | :: | stp |
Step size for the finite difference derivative. |
||
integer, | intent(out) | :: | istop |
Variable designating whether there are problems computing the function at the
current |
||
integer, | intent(inout) | :: | nfev |
Number of function evaluations. |
||
real(kind=wp), | intent(out) | :: | pvd |
Function value for the selected observation & response. |
||
real(kind=wp), | intent(out) | :: | fjacd(n,m,q) |
Jacobian wrt delta. |
||
real(kind=wp), | intent(out) | :: | f(n,q) |
Predicted function values. |
||
real(kind=wp), | intent(out) | :: | fjacb(n,np,q) |
Jocobian wrt beta. |
Scale t
by the inverse of scl
, i.e., compute t/scl
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of rows of data in |
||
integer, | intent(in) | :: | m |
Number of columns of data in |
||
real(kind=wp), | intent(in) | :: | scl(ldscl,m) |
Scale values. |
||
integer, | intent(in) | :: | ldscl |
Leading dimension of array |
||
real(kind=wp), | intent(in) | :: | t(ldt,m) |
Array to be inversely scaled by |
||
integer, | intent(in) | :: | ldt |
Leading dimension of array |
||
real(kind=wp), | intent(out) | :: | sclt(ldsclt,m) |
Inversely scaled matrix. |
||
integer, | intent(in) | :: | ldsclt |
Leading dimension of array |
Select scaling values for beta
according to the algorithm given in the ODRPACK95
reference guide.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | np |
Number of function parameters. |
||
real(kind=wp), | intent(in) | :: | beta(np) |
Function parameters. |
||
real(kind=wp), | intent(out) | :: | ssf(np) |
Scaling values for |
Select scaling values for delta
according to the algorithm given in the ODRPACK95
reference guide.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the independent variable. |
||
real(kind=wp), | intent(in) | :: | x(n,m) |
Independent variable. |
||
real(kind=wp), | intent(out) | :: | tt(ldtt,m) |
Scaling values for |
||
integer, | intent(in) | :: | ldtt |
Leading dimension of array |
Select the row at which the derivative will be checked.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of observations. |
||
integer, | intent(in) | :: | m |
Number of columns of data in the independent variable. |
||
real(kind=wp), | intent(in) | :: | x(n,m) |
Independent variable. |
||
integer, | intent(inout) | :: | nrow |
Selected row number of the independent variable. |
Solve systems of the form:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of rows and columns of data in array |
||
real(kind=wp), | intent(in) | :: | t(ldt,n) |
Upper or lower tridiagonal system. |
||
integer, | intent(in) | :: | ldt |
Leading dimension of array |
||
real(kind=wp), | intent(inout) | :: | b(:) |
On input: the right hand side; On exit: the solution. |
||
integer, | intent(in) | :: | job |
What kind of system is to be solved:
1: Solve |
Compute v*e*trans(v)
for the (indx
)th m
by q
array in v
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | m |
Number of columns of data in the independent variable. |
||
integer, | intent(in) | :: | q |
Number of responses per observation. |
||
integer, | intent(in) | :: | indx |
Row in |
||
real(kind=wp), | intent(in) | :: | v(ldv,ld2v,q) |
An array of |
||
integer, | intent(in) | :: | ldv |
Leading dimension of array |
||
integer, | intent(in) | :: | ld2v |
Second dimension of array |
||
real(kind=wp), | intent(in) | :: | e(lde,m) |
Matrix of the factors, so |
||
integer, | intent(in) | :: | lde |
Leading dimension of array |
||
real(kind=wp), | intent(out) | :: | ve(ldve,ld2ve,m) |
Array |
||
integer, | intent(in) | :: | ldve |
Leading dimension of array |
||
integer, | intent(in) | :: | ld2ve |
Second dimension of array |
||
real(kind=wp), | intent(out) | :: | vev(ldvev,q) |
Array |
||
integer, | intent(in) | :: | ldvev |
Leading dimension of array |
||
real(kind=wp), | intent(out) | :: | wrk5(m) |
Work vector. |
Scale matrix t
using wt
, i.e., compute wtt = wt*t
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
Number of rows of data in |
||
integer, | intent(in) | :: | m |
Number of columns of data in |
||
real(kind=wp), | intent(in), | target | :: | wt(..) |
Array of shape conformable to |
|
integer, | intent(in) | :: | ldwt |
Leading dimension of array |
||
integer, | intent(in) | :: | ld2wt |
Second dimension of array |
||
real(kind=wp), | intent(in), | target | :: | t(..) |
Array of shape conformable to |
|
real(kind=wp), | intent(out), | target | :: | wtt(..) |
Array of shape conformable to |
Ensure range of bounds is large enough for derivative checking. Move beta away from bounds so that derivatives can be calculated.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | np |
Number of parameters |
||
real(kind=wp), | intent(inout) | :: | beta(np) |
Function parameters. |
||
real(kind=wp), | intent(in) | :: | lower(np) |
!! Lower bound on |
||
real(kind=wp), | intent(in) | :: | upper(np) |
Upper bound on |
||
real(kind=wp), | intent(in) | :: | ssf(np) |
Scale used for the |
||
real(kind=wp), | intent(in) | :: | stpb(np) |
Relative step used for computing finite difference derivatives with respect to |
||
integer, | intent(in) | :: | neta |
Number of good digits in the function results. |
||
real(kind=wp), | intent(in) | :: | eta |
Relative noise in the function results. |
||
integer, | intent(out) | :: | interval(np) |
Specifies which difference methods and step sizes are supported by the current
interval |