Skip to content

Commit 2c09394

Browse files
committed
Added variance text
1 parent a8b1d2b commit 2c09394

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

docs/manual.adoc

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,3 +686,47 @@ An instance of Mean can be reset between samples using the reset() method.
686686
If the state of a Mean object is required to be saved between simulation runs then it can be made persistent by using either of the saveState methods. The first instance saves the state to a file, whereas the second can be used to save the state to an instance of the java.io.DataOutputStream class. There are likewise two corresponding ways in which the state can be restored.
687687

688688
The print method simply prints to System.out the current state of the object.
689+
690+
=== Variance
691+
692+
This class is derived from Mean, and in addition to providing the above mentioned functionality also provides the following:
693+
694+
----
695+
public class Variance extends Mean
696+
{
697+
public void setValue (double value) throws IllegalArgumentException;
698+
699+
public void reset ();
700+
701+
public double variance ();
702+
public double stdDev ();
703+
704+
public double confidence (double value);
705+
706+
public void print ();
707+
708+
public boolean saveState (String fileName) throws IOException;
709+
public boolean saveState (DataOutputStream oFile) throws IOException;
710+
711+
public boolean restoreState (String fileName) throws FileNotFoundException, IOException;
712+
public boolean restoreState (DataInputStream iFile) throws IOException;
713+
};
714+
----
715+
716+
variance() returns the variance of the samples:
717+
718+
1
719+
n
720+
721+
722+
2
723+
724+
_
725+
Σ (Si-Mean())
726+
727+
n
728+
729+
i=1
730+
731+
732+
stdDev() returns the standard deviation of the samples, which is the square root of the variance.

0 commit comments

Comments
 (0)