qiskit.finance.data_providers.WikipediaDataProvider¶
-
class
WikipediaDataProvider
(token=None, tickers=None, start=datetime.datetime(2016, 1, 1, 0, 0), end=datetime.datetime(2016, 1, 30, 0, 0))[source]¶ Wikipedia data provider.
Please see: https://github.com/Qiskit/qiskit-tutorials/blob/master/tutorials/finance/11_time_series.ipynb for instructions on use.
Initializer :type token:
Optional
[str
] :param token: quandl access token, which is not needed, strictly speaking :type tickers:Union
[str
,List
[str
],None
] :param tickers: tickers :type start:datetime
:param start: start time :type end:datetime
:param end: end time- Raises:
MissingOptionalLibraryError: Quandl not installed
-
__init__
(token=None, tickers=None, start=datetime.datetime(2016, 1, 1, 0, 0), end=datetime.datetime(2016, 1, 30, 0, 0))[source]¶ Initializer :type token:
Optional
[str
] :param token: quandl access token, which is not needed, strictly speaking :type tickers:Union
[str
,List
[str
],None
] :param tickers: tickers :type start:datetime
:param start: start time :type end:datetime
:param end: end time- Raises:
MissingOptionalLibraryError: Quandl not installed
Methods
__init__
([token, tickers, start, end])Initializer :type token:
Optional
[str
] :param token: quandl access token, which is not needed, strictly speaking :type tickers:Union
[str
,List
[str
],None
] :param tickers: tickers :type start:datetime
:param start: start time :type end:datetime
:param end: end timeReturns random coordinates for visualisation purposes.
Returns the covariance matrix.
Returns a vector containing the mean value of each asset.
Returns a vector containing the mean value of each asset.
Returns a vector containing the mean value of each asset.
Returns time-series similarity matrix computed using dynamic time warping.
run
()Loads data, thus enabling get_similarity_matrix and get_covariance_matrix methods in the base class.
-
get_coordinates
()¶ Returns random coordinates for visualisation purposes.
- Return type
Tuple
[ndarray
,ndarray
]
-
get_covariance_matrix
()¶ Returns the covariance matrix.
- Return type
ndarray
- Returns
an asset-to-asset covariance matrix.
- Raises
QiskitFinanceError – no data loaded
-
get_mean_vector
()¶ Returns a vector containing the mean value of each asset.
- Return type
ndarray
- Returns
a per-asset mean vector.
- Raises
QiskitFinanceError – no data loaded
-
get_period_return_covariance_matrix
()¶ Returns a vector containing the mean value of each asset.
- Return type
ndarray
- Returns
a per-asset mean vector.
- Raises
QiskitFinanceError – no data loaded
-
get_period_return_mean_vector
()¶ Returns a vector containing the mean value of each asset.
- Return type
ndarray
- Returns
a per-asset mean vector.
- Raises
QiskitFinanceError – no data loaded
-
get_similarity_matrix
()¶ Returns time-series similarity matrix computed using dynamic time warping.
- Return type
ndarray
- Returns
an asset-to-asset similarity matrix.
- Raises
QiskitFinanceError – no data loaded