gs_quant.timeseries.statistics.min_¶
- min_(x, w=<gs_quant.timeseries.helper.Window object>)[source]¶
Minimum value of series over given window
- Parameters:
x (
Union
[Series
,List
[Series
]]) – series: a timeseries or an array of timeseriesw (
Union
[Window
,int
,str
]) – window: size of window and ramp up to use. e.g. Window(22, 10) where 22 is the window size and 10 the ramp up value. If w is a string, it should be a relative time duration like ‘1m’, ‘1d’, etc. Window size defaults to length of series.
- Return type:
Series
- Returns:
timeseries of minimum value
Usage
Returns the minimum value of the series over each window.
If \(x\) is a series:
\(R_t = min(X_{t-w+1}:X_t)\)
where \(w\) is the size of the rolling window.
If \(x\) is an array of series:
\(R_t = min(X_{1, t-w+1}:X_{n, t})\)
where \(w\) is the size of the rolling window, and \(n\) is the number of series.
If window is not provided, returns the minimum value over the full series. If the window size is greater than the available data, will return minimum of available values.
If \(w\) is a string, it should be a relative time duration such as ‘1m’, ‘5d’, etc. The available frequency strings can be found below:
Frequency
Description
y
one year
m
one month
w
one week
d
one day
h
one hour
Examples
Minimum value of price series over the last \(22\) observations:
>>> prices = generate_series(100) >>> min_(prices, 22)
See also