f_dst_norm_pdf_core Function

public elemental function f_dst_norm_pdf_core(x, mu, sigma) result(fx)

Probability density function for normal distribution.

Arguments

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

sample position

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

distribution location (mean)

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

distribution dispersion/scale (standard deviation)

Return Value real(kind=wp)


Called by

proc~~f_dst_norm_pdf_core~~CalledByGraph proc~f_dst_norm_pdf_core f_dst_norm_pdf_core proc~f_dst_norm_pdf f_dst_norm_pdf proc~f_dst_norm_pdf->proc~f_dst_norm_pdf_core interface~fsml_norm_pdf fsml_norm_pdf interface~fsml_norm_pdf->proc~f_dst_norm_pdf

Source Code

elemental function f_dst_norm_pdf_core(x, mu, sigma) result(fx)

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

! ==== Declarations
  real(wp), intent(in) :: x       !! sample position
  real(wp), intent(in) :: mu      !! distribution location (mean)
  real(wp), intent(in) :: sigma   !! distribution dispersion/scale (standard deviation)
  real(wp)             :: z       !! z-score
  real(wp)             :: fx

! ==== Instructions

! ---- compute PDF

  ! compute z-score
  z = (x - mu) / sigma

  ! calculate probability/fx
  fx = (1.0_wp / (sigma * sqrt(2.0_wp * c_pi))) * exp( -0.5_wp * (z * z) )

end function f_dst_norm_pdf_core