odrpack Module

Main driver routines for finding the weighted explicit or implicit orthogonal distance regression (ODR) or ordinary linear or nonlinear least squares (OLS) solution.


Uses

  • module~~odrpack~~UsesGraph module~odrpack odrpack iso_fortran_env iso_fortran_env module~odrpack->iso_fortran_env module~odrpack_kinds odrpack_kinds module~odrpack->module~odrpack_kinds module~odrpack_kinds->iso_fortran_env

Used by

  • module~~odrpack~~UsedByGraph module~odrpack odrpack module~odrpack_capi odrpack_capi module~odrpack_capi->module~odrpack program~example1 example1 program~example1->module~odrpack program~example2 example2 program~example2->module~odrpack program~example3 example3 program~example3->module~odrpack program~example4 example4 program~example4->module~odrpack program~example5 example5 program~example5->module~odrpack

Subroutines

public impure subroutine odr(fcn, n, m, q, np, beta, y, x, delta, we, wd, ifixb, ifixx, job, ndigit, taufac, sstol, partol, maxit, iprint, lunerr, lunrpt, stpb, stpd, sclb, scld, rwork, iwork, info, lower, upper)

Driver routine for finding the weighted explicit or implicit orthogonal distance regression (ODR) or ordinary linear or nonlinear least squares (OLS) solution.

Arguments

Type IntentOptional 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) :: q

Number of responses per observation.

integer, intent(in) :: np

Number of function parameters.

real(kind=wp), intent(inout) :: beta(:)

Function parameters. Shape: (np).

real(kind=wp), intent(in) :: y(:,:)

Dependent variable. Shape: (n, q). Unused when the model is implicit.

real(kind=wp), intent(in) :: x(:,:)

Explanatory variable. Shape: (n, m).

real(kind=wp), intent(inout), optional :: delta(:,:)

Error in the x data. Shape: (n, m). Initial guess on input and estimated value on output.

real(kind=wp), intent(in), optional, target :: we(:,:,:)

epsilon weights. Shape: ({1,n}, {1,q}, q). See p. 25.

real(kind=wp), intent(in), optional, target :: wd(:,:,:)

delta weights. Shape: ({1,n}, {1,m}, m). See p. 26.

integer, intent(in), optional, target :: ifixb(:)

Values designating whether the elements of beta are fixed at their input values or not. Shape: (np).

integer, intent(in), optional, target :: ifixx(:,:)

Values designating whether the elements of x are fixed at their input values or not. Shape: ({1,n}, m). See p. 27.

integer, intent(in), optional :: job

Variable controlling problem initialization and computational method.

integer, intent(in), optional :: ndigit

Number of accurate digits in the function results, as supplied by the user.

real(kind=wp), intent(in), optional :: taufac

Factor used to compute the initial trust region diameter.

real(kind=wp), intent(in), optional :: sstol

Sum-of-squares convergence stopping tolerance.

real(kind=wp), intent(in), optional :: partol

Parameter convergence stopping tolerance.

integer, intent(in), optional :: maxit

Maximum number of iterations allowed.

integer, intent(in), optional :: iprint

Print control variable.

integer, intent(in), optional :: lunerr

Logical unit number for error messages. Available options are: 0: No output. 6: Output to standard output. k /= 0,6: Output to logical unit k.

integer, intent(in), optional :: lunrpt

Logical unit number for computation reports. Available options are: 0: No output. 6: Output to standard output. k /= 0,6: Output to logical unit k.

real(kind=wp), intent(in), optional, target :: stpb(:)

Relative step for computing finite difference derivatives with respect to beta. Shape: (np).

real(kind=wp), intent(in), optional, target :: stpd(:,:)

Relative step for computing finite difference derivatives with respect to delta. Shape: ({1,n}, m). See p. 31.

real(kind=wp), intent(in), optional, target :: sclb(:)

Scaling values for beta. Shape: (np).

real(kind=wp), intent(in), optional, target :: scld(:,:)

Scaling values for delta. Shape: ({1,n}, m). See p. 32.

real(kind=wp), intent(inout), optional, target :: rwork(:)

Real work space.

integer, intent(inout), optional, target :: iwork(:)

Integer work space.

integer, intent(out), optional :: info

Variable designating why the computations were stopped.

real(kind=wp), intent(in), optional, target :: lower(:)

Lower bound on beta. Shape: (np).

real(kind=wp), intent(in), optional, target :: upper(:)

Upper bound on beta. Shape: (np).

public pure subroutine workspace_dimensions(n, m, q, np, isodr, lrwork, liwork)

Calculate the dimensions of the workspace arrays.

Arguments

Type IntentOptional 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) :: q

Number of responses per observation.

integer, intent(in) :: np

Number of function parameters.

logical, intent(in) :: isodr

Variable designating whether the solution is by ODR (.true.) or by OLS (.false.).

integer, intent(out) :: lrwork

Length of rwork array.

integer, intent(out) :: liwork

Length of iwork array.