Computes Pearson correlation coefficient.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x(:) |
x vector (assumed size array) |
||
real(kind=wp), | intent(in) | :: | y(:) |
y vector (assumed size array) |
Pearson correlation coefficient
pure function f_sts_pcc_core(x, y) result(corr) ! ==== Description !! Computes Pearson correlation coefficient. ! ==== Declarations real(wp), intent(in) :: x(:) !! x vector (assumed size array) real(wp), intent(in) :: y(:) !! y vector (assumed size array) real(wp) :: corr !! Pearson correlation coefficient ! ==== Instructions corr = f_sts_cov_core(x, y, 0.0_wp) / & & sqrt( f_sts_var_core(x, 0.0_wp) * f_sts_var_core(y, 0.0_wp) ) end function f_sts_pcc_core