Common Type Definitions¶
The type aliases below are defined in arch._typing and are used in the
signatures of the public API. They are documented here so that the names that
appear in type annotations can be looked up. They are not part of the public
API and may change between releases.
Array Types¶
-
arch._typing.NDArray =
numpy.ndarray¶ A NumPy array of any shape and data type.
-
arch._typing.Float64Array =
numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.float64]]¶ A NumPy array with any number of dimensions containing 64-bit floating point values.
-
arch._typing.Float64Array1D =
numpy.ndarray[tuple[int], numpy.dtype[numpy.float64]]¶ A 1-dimensional NumPy array containing 64-bit floating point values.
-
arch._typing.Float64Array2D =
numpy.ndarray[tuple[int, int], numpy.dtype[numpy.float64]]¶ A 2-dimensional NumPy array containing 64-bit floating point values.
-
arch._typing.Int64Array =
numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.int64]]¶ A NumPy array with any number of dimensions containing 64-bit integers.
-
arch._typing.Int64Array1D =
numpy.ndarray[tuple[int], numpy.dtype[numpy.int64]]¶ A 1-dimensional NumPy array containing 64-bit integers.
-
arch._typing.Int64Array2D =
numpy.ndarray[tuple[int, int], numpy.dtype[numpy.int64]]¶ A 2-dimensional NumPy array containing 64-bit integers.
-
arch._typing.Int32Array =
numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.intc]]¶ A NumPy array with any number of dimensions containing C
intvalues, which are 32-bit integers on all supported platforms.
-
arch._typing.IntArray =
numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.int64]]¶ A NumPy array with any number of dimensions containing 64-bit integers.
-
arch._typing.Uint32Array =
numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.uintc]]¶ A NumPy array with any number of dimensions containing unsigned C
intvalues.
-
arch._typing.BoolArray =
numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]]¶ A NumPy array with any number of dimensions containing boolean values.
-
arch._typing.AnyArray =
numpy.ndarray[tuple[int, ...], typing.Any]¶ A NumPy array with any number of dimensions and any data type.
-
arch._typing.AnyArray1D =
numpy.ndarray[tuple[int], typing.Any]¶ A 1-dimensional NumPy array with any data type.
Array-like Types¶
-
arch._typing.ArrayLike1D =
Float64Array1D | pandas.Series¶ A 1-dimensional array of floats, either a NumPy array or a pandas
Series.
-
arch._typing.ArrayLike2D =
Float64Array2D | pandas.DataFrame¶ A 2-dimensional array of floats, either a NumPy array or a pandas
DataFrame.
-
arch._typing.ArrayLike =
numpy.ndarray | pandas.DataFrame | pandas.Series¶ A NumPy array, a pandas
DataFrameor a pandasSeries.
-
arch._typing.AnyPandas =
pandas.Series | pandas.DataFrame¶ A pandas
SeriesorDataFrame.
-
arch._typing.NDArrayOrFrame : TypeVar =
TypeVar("NDArrayOrFrame", Float64Array, DataFrame)¶ A type variable that is either a NumPy array of floats or a pandas
DataFrame. It is used when the type of the output matches the type of the input.
-
arch._typing.FloatOrArray : TypeVar =
TypeVar("FloatOrArray", float, numpy.ndarray)¶ A type variable that is either a Python
floator a NumPy array. It is used when the type of the output matches the type of the input.
Other Types¶
-
arch._typing.RandomStateState =
tuple[str, Uint32Array, int, int, float]¶ The state of a legacy
numpy.random.RandomState, as returned bynumpy.random.RandomState.get_state().
-
arch._typing.RNGType =
Callable[[int | tuple[int, ...]], Float64Array]¶ A function that takes a size, either an integer or a tuple of integers, and returns an array of random numbers of that size.
-
arch._typing.BootstrapIndexT =
Int64Array1D | tuple[Int64Array1D, ...] | tuple[list[Int64Array1D], dict[str, Int64Array1D]]¶ The indices used to construct a bootstrap sample. They are either a single array of indices, a tuple with an array of indices for each positional input, or a tuple containing a list of arrays of indices for the positional inputs and a dictionary of arrays of indices for the keyword inputs.
-
arch._typing.DateLike =
str | datetime.datetime | numpy.datetime64 | pandas.Timestamp¶ A value that can be interpreted as a date.
-
arch._typing.Label =
collections.abc.Hashable | None¶ A label for an element in a pandas
Index, for example a column name.
-
arch._typing.UnitRootTrend =
Literal["n", "c", "ct", "ctt"]¶ The deterministic trend terms that are available in unit root tests: no deterministic terms (
"n"), a constant ("c"), a constant and a linear time trend ("ct"), and a constant, a linear and a quadratic time trend ("ctt").
-
arch._typing.ForecastingMethod =
Literal["analytic", "simulation", "bootstrap"]¶ The methods that can be used to construct volatility forecasts.