What is a MonteCarloMeasurement
?
There are two defined MonteCarloMeasurement
s that one can make:
TimeSeries
: stores the entire data stream as a time record for further analysis- The memory cost is $O(N)$.
- The worst-case cost to
push!
data into a (pre-allocated)TimeSeries
is ammortized at $O(1)$.
AccumulatedSeries
: accumulates the data stream into aBinningAccumulator
fromOnlineLogBinning.jl
.- The memory cost is $O(\log N)$.
- The worst-case cost to
push!
data into a (pre-allocated)AccumulatedSeries
is also $O(\log N)$.
As one can see, there are inherent tradeoffs to saving either type of MonteCarloMeasurement
generated from a simulation. A TimeSeries
provides the most sweep-to-sweep information regarding the evolution of a particular measurement, but can be cost-prohibitive in the limit of long simulations with many measurements. An AccumulatedSeries
, on the other hand, is incredibly cheap to store, allowing for long runs with many different observables, but no fine detail about the temporal evolution can be recovered.
In light of these tradeoffs, we recommend storing a few of the slowest-evolving (scalar) observables as TimeSeries
and storing all others as AccumulatedSeries
.
After one is finished push!
ing data into either Series
, for example at the end of a Monte Carlo random walk, either MonteCarloMeasurement
can be analyzed using a binning_analysis
that returns a BinningAnalysisResult
from OnlineLogBinning.jl
. This provides as estimate of the mean
of a given observable as well the variance of the mean (var_of_mean
), assuming the data stream was correlated. Additionally, it provides other information about the stream, such as the effective uncorrelated length of the stream, etc. – see OnlineLogBinning.jl
: Perform the Binning Analysis for details.
We extend the Measurements.jl
interface for our MonteCarloMeasurement
as well by dispatching on their measurement
function which transforms either a TimeSeries
or an AccumulatedSeries
into a Measurement
. One can then make use of the Measurements.jl
package's propagation of error formulas, etc., for all of one's MonteCarloMeasurement
s.