Exemple #1
0
    def test_lower_b_min(self):
        current_b_min = self.baseline_hh.b_vals.min()
        modified_b_min = current_b_min - 1.
        modified_b_vals = np.insert(self.baseline_hh.b_vals, 0, modified_b_min)
        modified_hh = Household(b_vals=modified_b_vals)
        modified_model = KnightianInnovationModel(modified_hh, Firm())

        do_test(self.baseline_model, modified_model)
Exemple #2
0
    def test_higher_b_max(self):
        current_b_max = self.baseline_hh.b_vals.max()
        modified_b_max = current_b_max - 1.
        modified_b_vals = np.insert(self.baseline_hh.b_vals, -1, modified_b_max)
        modified_hh = Household(b_vals=modified_b_vals)
        modified_model = KnightianInnovationModel(modified_hh, Firm())

        do_test(self.baseline_model, modified_model)
Exemple #3
0
    def setup(self):
        self.baseline_hh = Household()
        self.baseline_firms = Firm()
        self.baseline_model = KnightianInnovationModel(self.baseline_hh,
                                                       self.baseline_firms)
        self.baseline_model.solve_household_DP_problem()
        self.ϵ = 1.05

        check_weakly_increasing(self.baseline_model)
def test_invalid_aggregate():
    invalid_aggregate = -0.5

    hh = Household()
    firms = Firm()

    with pytest.raises(ValueError) as e_info:
        KnightianInnovationModel(hh, firms, K=invalid_aggregate)

    with pytest.raises(ValueError) as e_info:
        KnightianInnovationModel(hh, firms, L=invalid_aggregate)

    with pytest.raises(ValueError) as e_info:
        KnightianInnovationModel(hh, firms, M=invalid_aggregate)
Exemple #5
0
    def test_lower_risk_free_rate(self):
        modified_model = KnightianInnovationModel(Household(),
                                                  Firm(),
                                                  R=self.baseline_model.R / self.ϵ)

        do_test(self.baseline_model, modified_model)
Exemple #6
0
    def test_higher_δ(self):
        modified_hh = Household(δ_vals=self.baseline_hh.δ_vals * self.ϵ)
        modified_model = KnightianInnovationModel(modified_hh, Firm())

        do_test(self.baseline_model, modified_model)
Exemple #7
0
    def test_higher_γ(self):
        modified_model = KnightianInnovationModel(Household(),
                                                  Firm(),
                                                  γ=self.baseline_model.γ * self.ϵ)

        do_test(self.baseline_model, modified_model)
Exemple #8
0
    def test_higher_A(self):
        modified_firms = Firm(A=self.baseline_firms.A * self.ϵ)
        modified_model = KnightianInnovationModel(Household(),
                                                  modified_firms)

        do_test(self.baseline_model, modified_model)