f_sts_pcc_core Function

public pure function f_sts_pcc_core(x, y) result(corr)

Computes Pearson correlation coefficient.

Arguments

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

x vector (assumed size array)

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

y vector (assumed size array)

Return Value real(kind=wp)

Pearson correlation coefficient


Calls

proc~~f_sts_pcc_core~~CallsGraph proc~f_sts_pcc_core f_sts_pcc_core proc~f_sts_cov_core f_sts_cov_core proc~f_sts_pcc_core->proc~f_sts_cov_core proc~f_sts_var_core f_sts_var_core proc~f_sts_pcc_core->proc~f_sts_var_core proc~f_sts_mean_core f_sts_mean_core proc~f_sts_cov_core->proc~f_sts_mean_core proc~f_sts_var_core->proc~f_sts_mean_core

Called by

proc~~f_sts_pcc_core~~CalledByGraph proc~f_sts_pcc_core f_sts_pcc_core proc~f_sts_pcc f_sts_pcc proc~f_sts_pcc->proc~f_sts_pcc_core interface~fsml_pcc fsml_pcc interface~fsml_pcc->proc~f_sts_pcc

Source Code

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