File: displayFunction.bf

package info (click to toggle)
hyphy 2.5.28%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 24,780 kB
  • sloc: cpp: 76,872; xml: 467; lisp: 341; python: 156; javascript: 117; sh: 106; makefile: 86; ansic: 86
file content (23 lines) | stat: -rw-r--r-- 614 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function echoCatVar (distrInfo)
{
	D = Columns(distrInfo);
	E = 0.0;
	for (k=0; k<D; k=k+1)
	{
		E = distrInfo[0][k]*distrInfo[1][k]+E;
	}
	sampleVar = 0.0;
	for (k=0; k<D; k=k+1)
	{
		sampleVar = sampleVar+(distrInfo[0][k]-E)*(distrInfo[0][k]-E);
	}
	sampleVar = sampleVar/(D-1);
	fprintf  (stdout,"\n\nSample mean = ",E, " (sample variance = ",sampleVar,")\n");
	for (k=0; k<D; k=k+1)
	{
		fprintf (stdout,"\nRate[",Format(k,0,0),"]=",Format(distrInfo[0][k],12,8), " (weight=", 
						  Format(distrInfo[1][k],9,7),")");
	}
	fprintf (stdout,"\n------------------------------------------------\n");
	return 0.0;
}