# Path: cmepy/statistics.py
# @property
# def statistics(self):
#     return {
#         'expectation' : self.expectation,
#         'expected_value' : self.expectation,
#         'variance' : self.variance,
#         'covariance' : self.covariance,
#         'standard_deviation' : self.standard_deviation
#     }


import unittest
import numpy
from numpy.testing.utils import assert_almost_equal
from cmepy import statistics
    def test_distribution_addition(self):
        a = statistics.Distribution(
            {
                (0, 0) : 0.4,
                (0, 1) : 0.3,
                (1, 0) : 0.2,
                (1, 1) : 0.1
            }
        )
        
        b = statistics.Distribution(
            {
                (0, -1) : 0.1,
                (0, 0) : 0.2,
                (0, 1) : 0.3,
                (0, 2) : 0.4
            }
        )
        
        c = a + b
        
        assert len(c) == 6
        assert_almost_equal(c[(0, -1)], 0.1)
        assert_almost_equal(c[(0, 0)], 0.6)
        assert_almost_equal(c[(0, 1)], 0.6)
        assert_almost_equal(c[(1, 0)], 0.2)
        assert_almost_equal(c[(1, 1)], 0.1)
        assert_almost_equal(c[(0, 2)], 0.4)
    
    def test_distribution_subtraction(self):

# Path: cmepy/statistics.py
# @property
# def statistics(self):
#     return {
#         'expectation' : self.expectation,
#         'expected_value' : self.expectation,
#         'variance' : self.variance,
#         'covariance' : self.covariance,
#         'standard_deviation' : self.standard_deviation
#     }


# Path: cmepy/tests/statistics_tests.py
import unittest
import numpy
from numpy.testing.utils import assert_almost_equal
from cmepy import statistics

    def test_distribution_addition(self):
        a = statistics.Distribution(
            {
                (0, 0) : 0.4,
                (0, 1) : 0.3,
                (1, 0) : 0.2,
                (1, 1) : 0.1
            }
        )
        
        b = statistics.Distribution(
            {
                (0, -1) : 0.1,
                (0, 0) : 0.2,
                (0, 1) : 0.3,
                (0, 2) : 0.4
            }
        )
        
        c = a + b
        
        assert len(c) == 6
        assert_almost_equal(c[(0, -1)], 0.1)
        assert_almost_equal(c[(0, 0)], 0.6)
        assert_almost_equal(c[(0, 1)], 0.6)
        assert_almost_equal(c[(1, 0)], 0.2)
        assert_almost_equal(c[(1, 1)], 0.1)
        assert_almost_equal(c[(0, 2)], 0.4)
    
    def test_distribution_subtraction(self):

        a = statistics.Distribution(