Best_Linear_Regression Subroutine

public subroutine Best_Linear_Regression(scn_nc, scn, scn_z, plus_z, a, b, r2, n_init, c_max_blr)

This subroutine calculates the best regression line for an fluid.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: scn_nc

integer input variable set to the total number of single cuts being considered in the fluid

integer, intent(in) :: scn(:)

set of singles cuts being considered in the fluid

real(kind=pr), intent(in) :: scn_z(:)

set of corresponding mole fractions of scn cuts

real(kind=pr), intent(in) :: plus_z

composition of residual fraction from input file

real(kind=pr), intent(out) :: a

output real variable. Slope of the best regression line.

real(kind=pr), intent(out) :: b

output real variable. Intercept of the best regression line.

real(kind=pr), intent(out) :: r2

output real variable. Square correlation coefficient.

integer, intent(out) :: n_init

minimum carbon number obtained from the best linear regression

integer, intent(out) :: c_max_blr

output CN at which plus_z is reached, as the summation of single z(i) from the best linear distribution (blr)


Calls

proc~~best_linear_regression~~CallsGraph proc~best_linear_regression Best_Linear_Regression proc~linear_regression Linear_Regression proc~best_linear_regression->proc~linear_regression

Called by

proc~~best_linear_regression~~CalledByGraph proc~best_linear_regression Best_Linear_Regression proc~difference_mw_plus difference_mw_plus proc~difference_mw_plus->proc~best_linear_regression proc~get_c_or_m_plus get_c_or_m_plus proc~get_c_or_m_plus->proc~difference_mw_plus proc~characterize characterize proc~characterize->proc~get_c_or_m_plus

Variables

Type Visibility Attributes Name Initial
real(kind=pr), public :: a_best
real(kind=pr), public :: a_old
real(kind=pr), public :: b_best
real(kind=pr), public :: b_old
integer, public :: i
integer, public :: j
integer, public :: k
integer, public :: k_old
integer, public :: n_best
real(kind=pr), public :: r2_best
real(kind=pr), public :: r2_old
integer, public :: x_aux
real(kind=pr), public, dimension(scn_nc) :: x_blr
real(kind=pr), public, dimension(scn_nc) :: y_blr
real(kind=pr), public :: z_aux
real(kind=pr), public :: z_sum