f_dst_t_pdf_core Function

public elemental function f_dst_t_pdf_core(x, df, mu, sigma) result(fx)

Probability density function for student t distribution.

Arguments

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

sample position

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

degrees of freedom

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_t_pdf_core~~CalledByGraph proc~f_dst_t_pdf_core f_dst_t_pdf_core proc~f_dst_t_pdf f_dst_t_pdf proc~f_dst_t_pdf->proc~f_dst_t_pdf_core interface~fsml_t_pdf fsml_t_pdf interface~fsml_t_pdf->proc~f_dst_t_pdf

Source Code

elemental function f_dst_t_pdf_core(x, df, mu, sigma) result(fx)

! ==== Description
!! Probability density function for student t distribution.

! ==== Declarations
  real(wp), intent(in) :: x       !! sample position
  real(wp), intent(in) :: df      !! degrees of freedom
  real(wp), intent(in) :: mu      !! distribution location (~mean)
  real(wp), intent(in) :: sigma   !! distribution dispersion/scale (~standard deviation)
  real(wp)             :: fx

! ==== Instructions

! ---- compute PDF

  ! calculate probability/fx
  fx = gamma((df + 1.0_wp) / 2.0_wp) / &
     & (sigma * sqrt(df * c_pi) * gamma(df / 2.0_wp)) * &
     & (1.0_wp + ( ( (x - mu) / sigma )**2 ) / df)** &
     & (-(df + 1.0_wp) / 2.0_wp)

end function f_dst_t_pdf_core