f_dst_logistic_pdf Function

public impure function f_dst_logistic_pdf(x, mu, scale) result(fx)

Impure wrapper function for f_dst_logistic_pdf_core. Handles optional arguments and invalid values for arguments.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

sample position

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

distribution location

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

distribution scale

Return Value real(kind=wp)


Calls

proc~~f_dst_logistic_pdf~~CallsGraph proc~f_dst_logistic_pdf f_dst_logistic_pdf proc~f_dst_logistic_pdf_core f_dst_logistic_pdf_core proc~f_dst_logistic_pdf->proc~f_dst_logistic_pdf_core proc~f_utl_assign_nan f_utl_assign_nan proc~f_dst_logistic_pdf->proc~f_utl_assign_nan proc~s_err_print s_err_print proc~f_dst_logistic_pdf->proc~s_err_print

Called by

proc~~f_dst_logistic_pdf~~CalledByGraph proc~f_dst_logistic_pdf f_dst_logistic_pdf interface~fsml_logistic_pdf fsml_logistic_pdf interface~fsml_logistic_pdf->proc~f_dst_logistic_pdf

Source Code

impure function f_dst_logistic_pdf(x, mu, scale) result(fx)

! ==== Description
!! Impure wrapper function for `f_dst_logistic_pdf_core`.
!! Handles optional arguments and invalid values for arguments.

! ==== Declarations
  real(wp), intent(in)           :: x       !! sample position
  real(wp), intent(in), optional :: mu      !! distribution location
  real(wp), intent(in), optional :: scale   !! distribution scale
  real(wp)                       :: mu_w    !! final value for mu
  real(wp)                       :: scale_w !! final value for scale
  real(wp)                       :: fx

! ==== Instructions

! ---- handle input

  ! assume location/mean = 0, overwrite if specified
  mu_w = 0.0_wp
  if (present(mu)) mu_w = mu

  ! assume sscale = 1, overwrite if specified
  scale_w = 1.0_wp
  if (present(scale)) scale_w = scale

  ! check if scale value is valid
  if (scale_w .le. 0.0_wp) then
     call s_err_print(fsml_error(1))
     fx = f_utl_assign_nan()
     return
  endif

! ---- compute PDF

  ! call pure function to calculate probability/fx
  fx = f_dst_logistic_pdf_core(x, mu_w, scale_w)

end function f_dst_logistic_pdf