This project is archived

Qiskit Finance is no longer maintained and this documentation is no longer updated. It is kept online for reference only, and the code it describes may not work with current versions of Qiskit. See the project repository for more information.

BaseDataProvider#

class BaseDataProvider[source]#

Bases: ABC

The abstract base class for data_provider modules within Qiskit Finance module.

To create add-on data_provider module subclass the BaseDataProvider class in this module. Doing so requires that the required driver interface is implemented.

To use the subclasses, please see https://qiskit-community.github.io/qiskit-finance/tutorials/11_time_series.html

Methods

get_coordinates()[source]#

Returns random coordinates for visualisation purposes.

Return type:

Tuple[ndarray, ndarray]

get_covariance_matrix()[source]#

Returns the covariance matrix.

Returns:

an asset-to-asset covariance matrix.

Raises:

QiskitFinanceError – no data loaded

Return type:

ndarray

get_mean_vector()[source]#

Returns a vector containing the mean value of each asset.

Returns:

a per-asset mean vector.

Raises:

QiskitFinanceError – no data loaded

Return type:

ndarray

get_period_return_covariance_matrix()[source]#

Returns a vector containing the mean value of each asset.

Returns:

a per-asset mean vector.

Raises:

QiskitFinanceError – no data loaded

Return type:

ndarray

get_period_return_mean_vector()[source]#

Returns a vector containing the mean value of each asset.

Returns:

a per-asset mean vector.

Raises:

QiskitFinanceError – no data loaded

Return type:

ndarray

get_similarity_matrix()[source]#

Returns time-series similarity matrix computed using dynamic time warping.

Returns:

an asset-to-asset similarity matrix.

Raises:

QiskitFinanceError – no data loaded

Return type:

ndarray

abstract run()[source]#

Loads data.