f_dst_exp_pdf_core Function

public elemental function f_dst_exp_pdf_core(x, lambda, loc) result(fx)

Probability density function for exponential distribution.

Arguments

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

sample position

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

lambda parameter, beta(scale) = 1/lambda = mu/mean

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

location parameter

Return Value real(kind=wp)


Called by

proc~~f_dst_exp_pdf_core~~CalledByGraph proc~f_dst_exp_pdf_core f_dst_exp_pdf_core proc~f_dst_exp_pdf f_dst_exp_pdf proc~f_dst_exp_pdf->proc~f_dst_exp_pdf_core interface~fsml_exp_pdf fsml_exp_pdf interface~fsml_exp_pdf->proc~f_dst_exp_pdf

Source Code

elemental function f_dst_exp_pdf_core(x, lambda, loc) result(fx)

! ==== Description
!! Probability density function for exponential distribution.

! ==== Declarations
  real(wp), intent(in) :: x        !! sample position
  real(wp), intent(in) :: loc      !! location parameter
  real(wp), intent(in) :: lambda   !! lambda parameter, beta(scale) = 1/lambda = mu/mean
  real(wp)             :: fx

! ==== Instructions

! ---- compute PDF

  ! calculate probability/fx
  if (x .lt. loc) then
     fx = 0.0_wp
  elseif (lambda .lt. 0.0_wp) then
     fx = 0.0_wp
  else
     fx = lambda * exp( -lambda * (x - loc) )
  endif

end function f_dst_exp_pdf_core