(function) A user defined R function. See the 'Details'
section for more on defining this function
n.bin
(scalar integer) The fixed number of bins to use to
define the moving expanding window
n.xx
(scalar integer) The length of the numeric vector
returned by f
ff
(scalar double) The fraction of the samples to included
in each window
n.save
(scalar integer OR NULL)The number of estimates to
save and return. The default value is NULL since this argument can
be derived from i.to.save. The argument is kept for
compatibility with older versions of this package
n.iter
(scalar integer OR NULL) The number of times to call
f. The default value is NULL since this argument can be
derived from i.to.save. The argument is kept for
compatibility with older versions of this package
i.to.save
(vector integer length n.iter) A vector of zeros
and ones of length n.iter where position i is 1 if an
average should be calculated and saved at iteration i, and zero
otherwise
...
The initial named arguments to f.
Details
The function f should generate the sequence of
random vectors one at a time. The returned value from a single call
should be a list with at least one element. The first element
should be a numeric vector of length n.xx (the next vector
in the sequence), and the remaining elements should be the updated
arguments for the next call to f, named appropriately for
the argument of f to update. The 'Examples' section
provides further guidance.
The downfall of this interface is that the user cannot run the
algorithm for some number of iterations, pause, assess convergence
of the mean and then pick up from where they paused. To accomplish
that see the examples associated with the mewMean function.
Value
A matrix of dimension n.save by n.xx
containing the saved averages