Best_Linear_Regression Subroutine

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

This subroutine calculates the best regression line for an oil.

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 oil

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

set of singles cuts being considered in the oil

real, intent(in), allocatable :: scn_z(:)

set of corresponding mole fractions of scn cuts

real(kind=pr), intent(in) :: plus_z
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) :: ninit

minimum carbon number obtained from the best linear regression


Calls

proc~~best_linear_regression~2~~CallsGraph proc~best_linear_regression~2 Best_Linear_Regression linearregression linearregression proc~best_linear_regression~2->linearregression

Variables

Type Visibility Attributes Name Initial
real(kind=pr), public :: abest
real(kind=pr), public :: aold
real(kind=pr), public :: bbest
real(kind=pr), public :: bold
integer, public :: cbmax
integer, public :: i
integer, public :: j
integer, public :: k
integer, public :: kold
integer, public :: nbest
real(kind=pr), public :: r2best
real(kind=pr), public :: r2old
real(kind=pr), public, allocatable :: xBR(:)
integer, public :: xaux
real(kind=pr), public, allocatable :: yBR(:)
real(kind=pr), public :: zaux
real(kind=pr), public :: zsum