fpvb Subroutine

public subroutine fpvb(fcn, n, m, np, q, beta, xplusd, ifixb, ifixx, ldifx, nrow, j, lq, stp, istop, nfev, pvb, fjacd, f, fjacb)

Compute the nrow-th function value using beta(j) + stp.

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) :: 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 x + delta.

integer, intent(in) :: ifixb(np)

Values designating whether the elements of beta are fixed at their input values or not.

integer, intent(in) :: ifixx(ldifx,m)

Values designating whether the elements of x are fixed at their input values or not.

integer, intent(in) :: ldifx

Leading dimension of array ifixx.

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 beta and delta.

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.


Called by

proc~~fpvb~~CalledByGraph proc~fpvb fpvb proc~check_jac_curv check_jac_curv proc~check_jac_curv->proc~fpvb proc~check_jac_fp check_jac_fp proc~check_jac_curv->proc~check_jac_fp proc~check_jac_fp->proc~fpvb proc~check_jac_value check_jac_value proc~check_jac_value->proc~fpvb proc~check_jac_value->proc~check_jac_curv proc~check_jac_zero check_jac_zero proc~check_jac_value->proc~check_jac_zero proc~check_jac_zero->proc~fpvb proc~check_jac check_jac proc~check_jac->proc~check_jac_value proc~odr odr proc~odr->proc~check_jac proc~odr_long_c odr_long_c proc~odr_long_c->proc~odr proc~odr_medium_c odr_medium_c proc~odr_medium_c->proc~odr proc~odr_short_c odr_short_c proc~odr_short_c->proc~odr program~example1 example1 program~example1->proc~odr program~example2 example2 program~example2->proc~odr program~example3 example3 program~example3->proc~odr program~example4 example4 program~example4->proc~odr program~example5 example5 program~example5->proc~odr

Variables

Type Visibility Attributes Name Initial
real(kind=wp), public :: betaj

Source Code

   subroutine fpvb &
      (fcn, &
       n, m, np, q, &
       beta, xplusd, ifixb, ifixx, ldifx, &
       nrow, j, lq, stp, &
       istop, nfev, pvb, &
       fjacd, f, fjacb)
   !! Compute the `nrow`-th function value using `beta(j) + stp`.

      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(wp), intent(inout) :: beta(np)
         !! Function parameters.
      real(wp), intent(in) :: xplusd(n, m)
         !! Values of `x + delta`.
      integer, intent(in) :: ifixb(np)
         !! Values designating whether the elements of `beta` are fixed at their input values or not.
      integer, intent(in) :: ifixx(ldifx, m)
         !! Values designating whether the elements of `x` are fixed at their input values or not.
      integer, intent(in) :: ldifx
         !! Leading dimension of array `ifixx`.
      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(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 `beta` and `delta`.
      integer, intent(inout) :: nfev
         !! Number of function evaluations.
      real(wp), intent(out) :: pvb
         !! Function value for the selected observation & response.
      real(wp), intent(out) :: fjacd(n, m, q)
         !! Jacobian wrt delta.
      real(wp), intent(out) :: f(n, q)
         !! Predicted function values.
      real(wp), intent(out) :: fjacb(n, np, q)
         !! Jocobian wrt beta.

      ! Local scalars
      real(wp) :: betaj

      ! Variable Definitions (alphabetically)
      !  BETAJ:   The current estimate of the jth parameter.

      betaj = beta(j)
      beta(j) = beta(j) + stp

      istop = 0
      call fcn(beta, xplusd, ifixb, ifixx, 003, f, fjacb, fjacd, istop)
      if (istop == 0) then
         nfev = nfev + 1
      else
         return
      end if

      beta(j) = betaj
      pvb = f(nrow, lq)

   end subroutine fpvb