Skip to content

Commit

Permalink
more cleanup of dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
open-risk committed Feb 21, 2022
1 parent 41a8035 commit 07e38f0
Show file tree
Hide file tree
Showing 13 changed files with 186 additions and 240 deletions.
346 changes: 173 additions & 173 deletions datasets/yahoo_log_returns.csv

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions examples/python/conditional_correlation_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@
import correlationMatrix as cm

from correlationMatrix import source_path
dataset_path = source_path + "datasets/"

dataset_path = source_path + "datasets/"

# Initialize a correlation matrix from the available examples
myMatrix = cm.CorrelationMatrix()


# Select method to stress

# TODO Perform PCA Analysis
Expand All @@ -40,4 +39,3 @@

# TODO stress API
# myMatrix.stress(Scenario, Method)

3 changes: 0 additions & 3 deletions examples/python/empirical_correlation_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@
timeseries data. The datasets are produced in examples/generate_synthetic_data.py
"""
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

import correlationMatrix as cm
from correlationMatrix import source_path
from correlationMatrix.utils.converters import datetime_to_float

dataset_path = source_path + "datasets/"

Expand Down
1 change: 0 additions & 1 deletion examples/python/factor_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,3 @@
print("> Step 2: Estimate Credit Metrics style model")
myMatrix = cm.FactorCorrelationMatrix()
myMatrix.fit(data, method='CreditMetrics')

1 change: 0 additions & 1 deletion examples/python/generate_synthetic_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,3 @@
rho = cm.CorrelationMatrix(type='UniformSingleFactor', rho=0.3, n=m)
data = dataset_generators.sector_model(n=n, b=b, rho=rho, sample=10000)
data.to_csv(dataset_path + 'synthetic_data4.csv', index=False)

2 changes: 0 additions & 2 deletions examples/python/generate_visuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,3 @@
)
# plt.show()
plt.savefig('dendrogram.png')


1 change: 0 additions & 1 deletion examples/python/matrix_from_json_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from correlationMatrix.utils.preprocessing import construct_returns, \
normalize_log_returns, json_file_to_frame


input_dataset_path = source_path + "datasets/"
output_dataset_path = source_path + "datasets/"

Expand Down
2 changes: 0 additions & 2 deletions examples/python/matrix_from_sector_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,3 @@
myMatrix = cm.FactorCorrelationMatrix()
data = pd.read_csv(in_filename)
myMatrix.fit(data, method='CreditMetrics')


2 changes: 0 additions & 2 deletions examples/python/matrix_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
E = cm.CorrelationMatrix(values=[[1.0, 0.25], [0.0, 1.0]])
print(E.validate())


print("> Values can be loaded from json or csv files")
F = cm.CorrelationMatrix(json_file=dataset_path + "SingleFactor.json")
F.print()
Expand Down Expand Up @@ -79,4 +78,3 @@
# Apply Cholesky decomposition
print("> Calculate its Cholesky decomposition")
matrix_print(G.decompose('cholesky'), accuracy=2)

53 changes: 8 additions & 45 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,45 +1,8 @@
alabaster==0.7.12
Babel==2.9.1
certifi==2021.10.8
charset-normalizer==2.0.12
cycler==0.11.0
docutils==0.17.1
fonttools==4.29.1
idna==3.3
imagesize==1.3.0
importlib-metadata==4.11.1
Jinja2==3.0.3
joblib==1.1.0
kiwisolver==1.3.2
lxml==4.8.0
MarkupSafe==2.1.0
matplotlib==3.5.1
mpmath==1.2.1
numpy==1.21.0
packaging==21.3
pandas==0.25.3
pandas-datareader==0.10.0
patsy==0.5.2
Pillow==9.0.1
Pygments==2.11.2
pyparsing==3.0.7
python-dateutil==2.8.2
pytz==2021.3
requests==2.27.1
scikit-learn==1.0.2
scipy==1.8.0
six==1.16.0
snowballstemmer==2.2.0
Sphinx==4.4.0
sphinx-rtd-theme==1.0.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
statsmodels==0.13.2
sympy==1.9
threadpoolctl==3.1.0
urllib3==1.26.8
zipp==3.7.0
matplotlib
numpy
pandas
requests
scipy
setuptools
Sphinx
sphinx-rtd-theme
4 changes: 2 additions & 2 deletions tests/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@


class TestDatasets(unittest.TestCase):
'''
"""
Load in-memory matrices
'''
"""

def test_minimal_matrix(self):
a = cm.CorrelationMatrix(values=Minimal)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@


class TestcorrelationMatrix(unittest.TestCase):
'''
"""
Default instance (2x2 identity matrix)
'''
"""

def test_instantiate_matrix(self):
a = cm.CorrelationMatrix()
Expand Down
3 changes: 0 additions & 3 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
# limitations under the License.

import unittest
import correlationMatrix as cm
from correlationMatrix import source_path
import pandas as pd

ACCURATE_DIGITS = 7

Expand Down

0 comments on commit 07e38f0

Please sign in to comment.