Exemple #1
0
 def load_inputs(self, bool_print=False):
     self.beta = stream_functions.compute_beta(self.benchmark, self.ric)
     self.beta_usd = self.beta*self.delta
     betas = [stream_functions.compute_beta(self.benchmark, hedge_ric) \
                    for hedge_ric in self.hedge_rics]
     self.betas = np.asarray(betas).reshape([len(self.hedge_rics),1])
     self.dataframe['ric'] = self.hedge_rics
     self.dataframe['beta'] = self.betas
     if bool_print:
         print('------')
         print('Input portfolio:')
         print('Delta mnUSD for ' + self.ric + ' is ' + str(self.delta))
         print('Beta for ' + self.ric + ' vs ' + self.benchmark + ' is ' + str(self.beta))
         print('Beta mnUSD for ' + self.ric + ' vs ' + self.benchmark + ' is ' + str(self.beta_usd))
         print('------')
         print('Input hedges:')
         for n in range(self.dataframe.shape[0]):
             print('Beta for hedge[' + str(n) + '] = ' + self.dataframe['ric'][n] \
                   + ' vs ' + self.benchmark + ' is ' + str(self.dataframe['beta'][n]))
 def load_inputs(self, bool_print=False):
     # portfolio input
     self.beta = stream_functions.compute_beta(self.ric, self.benchmark)
     self.beta_usd = self.beta * self.delta
     # hedge input
     hedge_betas = [stream_functions.compute_beta(hedge_ric, self.benchmark) \
                    for hedge_ric in self.hedge_rics]
     self.dataframe['ric'] = self.hedge_rics
     self.dataframe['beta'] = hedge_betas
     # print inputs
     if bool_print:
         print('------')
         print('Input portfolio:')
         print('Delta mnUSD for ' + self.ric + ' is ' + str(self.delta))
         print('Beta for ' + self.ric + ' vs ' + self.benchmark + ' is ' +
               str(self.beta))
         print('Beta mnUSD for ' + self.ric + ' vs ' + self.benchmark +
               ' is ' + str(self.beta_usd))
         print('------')
         print('Input hedges:')
         for n in range(self.dataframe.shape[0]):
             print('Beta for hedge[' + str(n) + '] = ' + self.dataframe['ric'][n] \
                   + ' vs ' + self.benchmark + ' is ' + str(self.dataframe['beta'][n]))