def process(rates, update_date): irates = interpolate(rates) forward = makeForward(YEARS*12, irates) prob = makeProb(PROB_SCALE, forward) x = range(1,20*12+1) plt.plot(x, map(irates, x))
def get(self): YEARS = 7 PROB_SCALE = 5 irates = interpolate(cache.rates) forward = makeForward(YEARS*12, irates) prob = makeProb(5, forward) lastMonth = cache.rates[-1][0] x = range(1, lastMonth - YEARS*12 + 1) ret = mapzip(prob, x) self.write(json.dumps(ret))
def get(self, months): months = int(months) lastMonth = cache.rates[-1][0] if months >= lastMonth: return self.write("") irates = interpolate(cache.rates) forward = makeForward(months, irates) x = range(1, lastMonth - months + 1) ret = mapzip(forward, x) self.write(json.dumps(ret))