diff --git a/quantecon/markov/core.py b/quantecon/markov/core.py index b8854ac43..e9034ecbc 100644 --- a/quantecon/markov/core.py +++ b/quantecon/markov/core.py @@ -186,7 +186,7 @@ def __init__(self, P, state_values=None): raise ValueError('The rows of P must sum to 1') # Call the setter method - self._state_values = state_values + self.state_values = state_values # To analyze the structure of P as a directed graph self._digraph = None diff --git a/quantecon/markov/tests/test_core.py b/quantecon/markov/tests/test_core.py index 3c10216f8..0f5679241 100644 --- a/quantecon/markov/tests/test_core.py +++ b/quantecon/markov/tests/test_core.py @@ -383,18 +383,19 @@ def test_mc_sample_path_lln(): class TestMCStateValues: def setUp(self): - self.state_values = np.array([[0, 1], [2, 3], [4, 5]]) + state_values = [[0, 1], [2, 3], [4, 5]] # Pass python list + self.state_values = np.array(state_values) self.mc_reducible_dict = { 'mc': MarkovChain([[1, 0, 0], [1, 0, 0], [0, 0, 1]], - state_values=self.state_values), + state_values=state_values), 'coms': [[0], [1], [2]], 'recs': [[0], [2]] } self.mc_periodic_dict = { 'mc': MarkovChain([[0, 1, 0], [0, 0, 1], [1, 0, 0]], - state_values=self.state_values), + state_values=state_values), 'coms': [[0, 1, 2]], 'recs': [[0, 1, 2]], 'cycs': [[0], [1], [2]]