Subprogrammes in ~/sas/p/sastat.f


subroutine save_statistics
 19:      entry save_statistics_cnf (varr,degf)
 51:      entry set_confidence_level (scfdlvl)
 60:      entry save_confidence (cnfl,cnfu)
 66:      entry get_confidence (cnfl,cnfu)
 75:      entry clear_statistics ()
 81:      entry clear_confidence ()

 85:      logical function enq_statistics ()
 94:      logical function enq_confidence ()

102:      function conf_coherence (cflq)
145:      complex function conf_cohc (cohc,qsignf)
164:      complex function conf_gain (gain,cohc,qpartial,qsignf)
194:      complex function conf_phase (phase,cohc,qpartial,qsignf)

The complex functions have in common that
  1.  you specify the value of coherence, gain or phase: V
  2.  you equivalence a real*4 variable of dimension 2. with a complex*8 variable: EQUIVALENCE (CV,RV(1))
  3.  your confidence interval is [RV(1),RV(2)] with V inbetween, CV=CONF_
You can first plot the result for the error bar with the centralised variables
(RV(2)+RV(1))/2.,
(RV(2)-RV(1))/2.
and then superimpose a symbol for the estimate V. Skip the error bar or even everything if .not.qsignf
 
qpartial (logical, input
The first time these functions are called internal parameters are set for the Fisher-CDF and the CDF of the coherence distribution (Normal distribution of Fisher-transform of COHC).

In all procedures in HGS's SAS package COHC is the squared parameter, coherence-proper (the square root is usually named Coherency).

Note that significant coherence does not necessarily imply that confidence limits for gain and phase stay inside the permissible range. The limit for coherence will always be too narrow. Especially for phase the Arcsin argument will become greater than 1.
For details, see ORE: HGs/Mathematica/FisherConfid.nb (.pdf).
In this case, conf_phase will return an interval ±90o around phase; the lower limit for gain will become less than zero. For easy handling qsignf will be .false. on return.

subroutine save_corr_statistics
272:      entry save_acv_statistics (c0,ampf)
285:      entry get_acv_statistics (a0,af)
290:      entry clear_corr_statistics ()
295:      entry clear_acv_statistics ()
300:      entry get_corr_statistics (a0,al,ah,af)
309:      entry set_sas_cfdlevel (cfdq)
315:      entry show_csstat ()
321:      logical function enq_corr_statistics ()
330:      logical function enq_acv_statistics ()


Required routines to solve CDF equations:
/home/hgs/math/afor/p/libmath.a(fisherds.o)
/home/hgs/math/afor/p/libmath.a(normalds.o)
/home/hgs/math/afor/p/libmath.a(stdti.o)
/home/hgs/math/afor/p/librcp.a(zbrent.o)

.bye