示例#1
0
    def calc_other(self, df):
        '''
        Calculates variables that depend on z and rho
        '''
        dfs = {'c': df[df['tax_treat'] == 'corporate'].copy(),
               'nc': df[df['tax_treat'] == 'non-corporate'].copy()}
        # separate into corp and non-corp dataframe here
        for t in self.__p.entity_list:
            for f in self.__p.financing_list:
                dfs[t]['ucc_' + str(f)] = eq_ucc(
                    dfs[t]['rho_' + str(f)], dfs[t]['delta'])
                dfs[t]['metr_' + str(f)] = eq_metr(
                    dfs[t]['rho_' + str(f)], self.__p.r_prime[t][f],
                    self.__p.inflation_rate)
                dfs[t]['mettr_' + str(f)] = eq_mettr(
                    dfs[t]['rho_' + str(f)], self.__p.s[t][f])
                dfs[t]['tax_wedge_' + str(f)] = eq_tax_wedge(
                    dfs[t]['rho_' + str(f)], self.__p.s[t][f])
                dfs[t]['eatr_' + str(f)] = eq_eatr(
                    dfs[t]['rho_' + str(f)], dfs[t]['metr_' + str(f)],
                    self.__p.profit_rate, self.__p.u[t])
        df = pd.concat(dfs, ignore_index=True, copy=True)

        return df
示例#2
0
def test_eq_mettr(rho, s, expected_val):
    test_val = cf.eq_mettr(rho, s)

    assert(np.allclose(test_val, expected_val))
def test_eq_mettr(rho, s, expected_val):
    test_val = cf.eq_mettr(rho, s)

    assert (np.allclose(test_val, expected_val))