Probability density function for student t distribution.
Type | Intent | Optional | 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) |
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