<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='meancov1'>
<!--  @(#)meancov.1 2001/04/02 NIST -->
<!--  I Image Group -->
<!--  G. T. Candela &amp; Craig I. Watson -->

<refmeta>
<refentrytitle>MEANCOV</refentrytitle>
<manvolnum>1A</manvolnum>
<refmiscinfo class='date'>02 April 2001</refmiscinfo>
<refmiscinfo class='source'>NIST</refmiscinfo>
<refmiscinfo class='manual'>NFIS Reference Manual</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>meancov</refname>
<refpurpose>computes mean vector and covariance matrix for a set of feature vectors.</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
  <command>meancov</command>    
    <arg choice='plain'><replaceable>&lt;vecsfile_in</replaceable></arg>
    <arg choice='opt' rep='repeat'><replaceable>vecsfile_in</replaceable></arg>
    <arg>&gt;</arg>
    <arg choice='plain'><replaceable>&lt;meanfile_out&gt;&lt;meanfile_out_desc&gt;&lt;covfile_out&gt;&lt;covfile_out_desc&gt;&lt;ascii_outfiles&gt;&lt;message_freq&gt;</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>


<refsect1 id='description'><title>DESCRIPTION</title>
<para><emphasis remap='B'>Meancov</emphasis>
computes sample mean vector and sample covariance matrix of a set of
feature vectors.</para>

<para>If several processors are available, it may be possible to save time,
when computing the mean and covariance of a large set of feature vectors.
First, run several simultaneous instances of meancov, each
instance computing the mean and covariance of a subset of the vectors.
Then, use cmbmcs to combine the resulting output files.  See the
cmbmcs man page.
<emphasis remap='B'>Note:</emphasis>
If using cmbmcs, the subset mean vectors made by the meancov instances
must be saved for later use by cmbmcs even if, ultimately, all that
is wanted is the overall covariance matrix. Construction of the
overall covariance requires the subset means, as well as the
subset covariances.</para>
</refsect1>

<refsect1 id='options'><title>OPTIONS</title>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>&lt;vecsfile_in[vecsfile_in...]&gt;</emphasis></term>
  <listitem>
<para>Input data file(s) in PCASYS "matrix" format, each consisting of a
block of the vectors that are to be used, i.e. the vectors are the
rows of the matrix (matrices).  Of course, all input matrices must
have the same second dimension, which is the dimension of the
constituent vectors. (Usually the output of <emphasis remap='B'>mkoas</emphasis>.)</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&lt;meanfile_out&gt;</emphasis></term>
  <listitem>
<para>Mean file to be written, in PCASYS "matrix" format, with first dimension
set to 1 and with second dimension set to the dimension of the input
vectors.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&lt;meanfile_out_desc&gt;</emphasis></term>
  <listitem>
<para>A string to be written into the mean output file as its description
string.  This string can be of any length, but must not contain
embedded newline characters.  If it contains spaces, tabs, or shell
metacharacters that are not to be expanded, then it should be quoted.
To leave the description empty, use '' (two single quotes, i.e.
single-quoted empty string).  To let meancov make a description
(stating that this is a mean vector made by meancov and listing the
names of the input files), use - (hyphen).</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&lt;covfile_out&gt;</emphasis></term>
  <listitem>
<para>Covariance file to be written.  Meancov saves memory and cycles by
allocating a buffer only large enough for the nonstrict lower triangle
of the symmetric covariance matrix and computing only those elements,
and it saves disk space by storing the covariance in PCASYS
"covariance" format, which stores only the nonstrict lower triangle.
The order of the covariance is the dimension of the input vectors.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&lt;covfile_out_desc&gt;</emphasis></term>
  <listitem>
<para>Description string for covariance file or - to let meancov make the
description, same as for the mean file description argument.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&lt;ascii_outfiles&gt;</emphasis></term>
  <listitem>
<para>If y, makes ascii output files; if n, binary.  Binary is recommended,
unless the output files must be portable across different byte orders
or floating-point formats.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&lt;message_freq&gt;</emphasis></term>
  <listitem>
<para>If a positive integer, then every this many vectors through each input
file, during the accumulation phase, meancov writes a progress message
to the standard output, and it also writes a few other progress
messages.  If 0, no messages.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='examples'><title>EXAMPLE(S)</title>
<variablelist remap='TP'>
  <varlistentry>
  <term>From <emphasis remap='I'>test/pcasys/execs/meancov/meancov.src</emphasis>:</term>
  <listitem>
<para></para> <!-- FIXME: blank list item -->
  </listitem>
  </varlistentry>
</variablelist>

<!-- .RS -->
<para><emphasis remap='B'>% meancov ../../data/oas/fv[1-9].oas fv1-9.men - fv1-9.cov - n 100</emphasis>
<!-- .br -->
Compute the mean and covariance matrices for a set of feature vectors.</para>
</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para>cmbmcs (1), mkoas (1)</para>

</refsect1>

<refsect1 id='author'><title>AUTHOR</title>
<para>NIST/ITL/DIV894/Image Group</para>
</refsect1>
</refentry>

