 | CVVURollingStats Method |
Calculate a statistic in a rolling window.
Namespace:
Geosoft.Desktop.GXNet
Assembly:
geosoft.desktop.gxnet (in geosoft.desktop.gxnet.dll) Version: 2024.2.0.25
Syntaxpublic static void RollingStats(
CVV vv_i,
CVV vv_o,
int stat,
int window,
int shrink
)
public static void RollingStats(
CVV vv_i,
CVV vv_o,
int stat,
int window,
int shrink
)
Public Shared Sub RollingStats (
vv_i As CVV,
vv_o As CVV,
stat As Integer,
window As Integer,
shrink As Integer
)
Public Shared Sub RollingStats (
vv_i As CVV,
vv_o As CVV,
stat As Integer,
window As Integer,
shrink As Integer
)
public:
static void RollingStats(
CVV^ vv_i,
CVV^ vv_o,
int stat,
int window,
int shrink
)
public:
static void RollingStats(
CVV^ vv_i,
CVV^ vv_o,
int stat,
int window,
int shrink
)
static member RollingStats :
vv_i : CVV *
vv_o : CVV *
stat : int *
window : int *
shrink : int -> unit
static member RollingStats :
vv_i : CVV *
vv_o : CVV *
stat : int *
window : int *
shrink : int -> unit
Parameters
- vv_i
- Type: GeoEngine.Core.GXNetCVV
Input VV - vv_o
- Type: GeoEngine.Core.GXNetCVV
Output VV - stat
- Type: SystemInt32
<define>ST_INFO</define> - window
- Type: SystemInt32
Window size (>0, increased to nearest odd value) - shrink
- Type: SystemInt32
Shrink window at ends (1:Yes, 0:No)
Remarks
If the input VVs are not REAL, copies are made to
temporary REALs for processing.
If the window size is even, it is increased by 1 so that the
output value is put at the exact center index of the window.
Statistics are calculated on the values in a window
surrounding the individual data points.
By shrinking the window at the ends, one-sided effects can be
eliminated. For instance, if the data is linear to begin with,
a rolling mean will not alter the original data.
However, if the window size is kept constant, then values
near the ends tend to be pulled up or down.
With shrinking, the window is shrunk so that it always has the
same width on both sides of the data point under analysis;
at the end points the window width is 1, at the next point in
it is 3, and so on, until the full width is reached.
The median value is calculated by sorting the valid data in
the window, then selecting the middle value. If the number
of valid data points is even, then the average of the two
central values is returned.
The mode value is defined as the value which occurs most
frequently in the data. This value may not even exist, or
may not be unique. In this implementation, the following
algorithm is used: The valid data in the window is sorted
in ascending order. The number of occurrences of each data
value is tracked, and if it occurs more times than any
value, it becomes the modal value. If all
values are different, this procedure returns the smallest
value. If two or more values each have the same (maximum)
number of occurrences, then the smallest of these values is
returned.
See Also