TABLE OF CONTENTS


ABINIT/m_Stat [ Modules ]

[ Top ] [ Modules ]

NAME

  m_Stat

FUNCTION

  FIXME: add description. 

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

28 #include "defs.h"
29 MODULE m_Stat
30 USE m_global
31 IMPLICIT NONE
32   
33 PRIVATE
34 
35 PUBLIC :: Stat_average
36 PUBLIC :: Stat_variance
37 PUBLIC :: Stat_coVariance
38 PUBLIC :: Stat_deviation
39 PUBLIC :: Stat_linearReg
40 PUBLIC :: Stat_powerReg
41 
42 CONTAINS

ABINIT/m_Stat/Stat_linearReg [ Functions ]

[ Top ] [ Functions ]

NAME

  Stat_linearReg

FUNCTION

  FIXME: add description.

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  argin(sizein)=description

OUTPUT

  argout(sizeout)=description

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

182 SUBROUTINE Stat_linearReg(tabX, tabY, a, b, R)
183 !Arguments ------------------------------------
184 
185 !This section has been created automatically by the script Abilint (TD).
186 !Do not modify the following lines by hand.
187 #undef ABI_FUNC
188 #define ABI_FUNC 'Stat_linearReg'
189 !End of the abilint section
190 
191   DOUBLE PRECISION, DIMENSION(:), INTENT(IN ) :: tabX
192   DOUBLE PRECISION, DIMENSION(:), INTENT(IN ) :: tabY
193   DOUBLE PRECISION              , INTENT(OUT) :: a
194   DOUBLE PRECISION              , INTENT(OUT) :: b
195   DOUBLE PRECISION              , INTENT(OUT) :: R
196   DOUBLE PRECISION                            :: coVar
197   DOUBLE PRECISION                            :: Var
198 
199   coVar = Stat_coVariance(tabX, tabY)
200   Var   = Stat_variance(tabX)
201   a = coVar / var
202   b = Stat_average(tabY) - a* Stat_average(tabX)
203   R = ABS(a * SQRT(var) / Stat_deviation(tabY))
204 END SUBROUTINE Stat_linearReg

ABINIT/m_Stat/Stat_powerReg [ Functions ]

[ Top ] [ Functions ]

NAME

  Stat_powerReg

FUNCTION

  FIXME: add description.

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  argin(sizein)=description

OUTPUT

  argout(sizeout)=description

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

238 SUBROUTINE Stat_powerReg(tabX, tabY, a, b, R)
239 !Arguments ------------------------------------
240 
241 !This section has been created automatically by the script Abilint (TD).
242 !Do not modify the following lines by hand.
243 #undef ABI_FUNC
244 #define ABI_FUNC 'Stat_powerReg'
245 !End of the abilint section
246 
247   DOUBLE PRECISION, DIMENSION(:), INTENT(IN ) :: tabX
248   DOUBLE PRECISION, DIMENSION(:), INTENT(IN ) :: tabY
249   DOUBLE PRECISION              , INTENT(OUT) :: a
250   DOUBLE PRECISION              , INTENT(OUT) :: b
251   DOUBLE PRECISION              , INTENT(OUT) :: R
252   INTEGER                                     :: size1
253   DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: tab1
254   DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: tab2
255   INTEGER :: i
256 
257   size1 = SIZE(tabX)
258   IF ( size1 .NE. SIZE(tabY) ) &
259     CALL ERROR("Stat_powerReg : Array sizes mismatch              ")
260 
261   FREEIF(tab1)
262   FREEIF(tab2)
263   MALLOC(tab1,(1:size1))
264   MALLOC(tab2,(1:size1))
265 
266 
267 !  IF ( ISNAN(a) .OR. ISNAN(b) ) THEN
268     DO i = 1, size1 
269       tab1(i) = LOG(tabX(i))
270       IF ( tabY(i) .NE. 0.d0 ) THEN
271         tab2(i) = LOG(tabY(i))
272       ELSE
273         tab2(i) = LOG(1.d-16)
274       END IF
275       !WRITE(92,'(4E22.14)') tabX(i), tab1(i), tabY(i), tab2(i)
276     END DO
277     !WRITE(92,*)
278   !END IF
279   CALL Stat_linearReg(tab1, tab2, b, a, R)
280   a = EXP(a)
281   FREE(tab1)
282   FREE(tab2)
283 END SUBROUTINE Stat_powerReg