f_sts_cov_core Function

public pure function f_sts_cov_core(x, y, ddf) result(cov)

Computes covariance.

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)

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

delta degrees of freedom

Return Value real(kind=wp)

covariance


Calls

proc~~f_sts_cov_core~~CallsGraph proc~f_sts_cov_core f_sts_cov_core proc~f_sts_mean_core f_sts_mean_core proc~f_sts_cov_core->proc~f_sts_mean_core

Called by

proc~~f_sts_cov_core~~CalledByGraph proc~f_sts_cov_core f_sts_cov_core proc~f_lin_mahalanobis_core f_lin_mahalanobis_core proc~f_lin_mahalanobis_core->proc~f_sts_cov_core proc~f_sts_cov f_sts_cov proc~f_sts_cov->proc~f_sts_cov_core proc~f_sts_pcc_core f_sts_pcc_core proc~f_sts_pcc_core->proc~f_sts_cov_core proc~f_sts_trend_core f_sts_trend_core proc~f_sts_trend_core->proc~f_sts_cov_core proc~s_lin_lda_2c s_lin_lda_2c proc~s_lin_lda_2c->proc~f_sts_cov_core proc~s_nlp_hclust_core s_nlp_hclust_core proc~s_nlp_hclust_core->proc~f_sts_cov_core proc~s_nlp_hclust_core->proc~f_lin_mahalanobis_core proc~s_nlp_kmeans_core s_nlp_kmeans_core proc~s_nlp_kmeans_core->proc~f_sts_cov_core proc~s_nlp_kmeans_core->proc~f_lin_mahalanobis_core interface~fsml_cov fsml_cov interface~fsml_cov->proc~f_sts_cov interface~fsml_lda_2class fsml_lda_2class interface~fsml_lda_2class->proc~s_lin_lda_2c proc~f_lin_mahalanobis f_lin_mahalanobis proc~f_lin_mahalanobis->proc~f_lin_mahalanobis_core proc~f_sts_pcc f_sts_pcc proc~f_sts_pcc->proc~f_sts_pcc_core proc~f_sts_scc_core f_sts_scc_core proc~f_sts_scc_core->proc~f_sts_pcc_core proc~f_sts_trend f_sts_trend proc~f_sts_trend->proc~f_sts_trend_core proc~s_nlp_hclust s_nlp_hclust proc~s_nlp_hclust->proc~s_nlp_hclust_core proc~s_nlp_hkmeans_core s_nlp_hkmeans_core proc~s_nlp_hkmeans_core->proc~s_nlp_hclust_core proc~s_nlp_hkmeans_core->proc~s_nlp_kmeans_core proc~s_nlp_kmeans s_nlp_kmeans proc~s_nlp_kmeans->proc~s_nlp_kmeans_core interface~fsml_hclust fsml_hclust interface~fsml_hclust->proc~s_nlp_hclust interface~fsml_kmeans fsml_kmeans interface~fsml_kmeans->proc~s_nlp_kmeans interface~fsml_mahalanobis fsml_mahalanobis interface~fsml_mahalanobis->proc~f_lin_mahalanobis interface~fsml_pcc fsml_pcc interface~fsml_pcc->proc~f_sts_pcc interface~fsml_trend fsml_trend interface~fsml_trend->proc~f_sts_trend proc~f_sts_scc f_sts_scc proc~f_sts_scc->proc~f_sts_scc_core proc~s_nlp_hkmeans s_nlp_hkmeans proc~s_nlp_hkmeans->proc~s_nlp_hkmeans_core interface~fsml_hkmeans fsml_hkmeans interface~fsml_hkmeans->proc~s_nlp_hkmeans interface~fsml_scc fsml_scc interface~fsml_scc->proc~f_sts_scc

Source Code

pure function f_sts_cov_core(x, y, ddf) result(cov)

! ==== Description
!! Computes covariance.

! ==== Declarations
  real(wp), intent(in) :: x(:) !! x vector (assumed size array)
  real(wp), intent(in) :: y(:) !! y vector (assumed size array)
  real(wp), intent(in) :: ddf  !! delta degrees of freedom
  real(wp)             :: xbar !! mean of x
  real(wp)             :: ybar !! mean of y
  real(wp)             :: cov  !! covariance

! ==== Instructions
  xbar = f_sts_mean_core(x)
  ybar = f_sts_mean_core(y)
  cov = dot_product( (x - xbar), (y - ybar) ) / &
      & (real(size(x), kind=wp) - ddf)

end function f_sts_cov_core