def constant_returns(stocks=Decimal('.04'), bonds=Decimal('.02'), inflation=Decimal('.02')): return itertools.repeat( AnnualChange(year=0, stocks=stocks, bonds=bonds, inflation=inflation))
def fmt(self, row): return AnnualChange(year=row.name, stocks=row['NIKKEI225'], bonds=row['Spliced Bond'], inflation=row['CPI Japan'])
def random_year(self): ''' This is the same method name as in market.US_1871_Returns...which allows this to be a drop-in replacement for that when simulating data ''' r = lognormal(self.mean, self.sigma) - 1 r = Decimal(r) return AnnualChange(year=0, stocks=r, bonds=r, inflation=Decimal(0))