fynance.features.metrics.perf_index¶
-
fynance.features.metrics.
perf_index
(X, base=100.0, axis=0, dtype=None)¶ Compute performance of prices or index values along time axis.
Parameters: - X : np.ndarray[dtype, ndim=1 or 2]
Time-series of prices or index values.
- base : float, optional
Initial value for measure the performance, default is 100.
- axis : {0, 1}, optional
Axis along wich the computation is done. Default is 0.
- dtype : np.dtype, optional
The type of the output array. If dtype is not given, infer the data type from X input.
Returns: - np.ndarray[dtype, ndim=1 or 2]
Performances along time axis.
See also
Examples
>>> X = np.array([10., 12., 15., 14., 16., 18., 16.]) >>> perf_index(X, base=100.) array([100., 120., 150., 140., 160., 180., 160.])