File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import asyncio
22from datetime import timedelta
3+ from decimal import Decimal
34
45import numpy as np
56import pandas as pd
@@ -46,9 +47,9 @@ async def fetch() -> pd.DataFrame:
4647va_model = np .zeros ((len (va_short ), len (ttm )))
4748cir_model = np .zeros ((len (cir_short ), len (ttm )))
4849for t in range (len (va_short )):
49- vasicek .rate = float (va_short [t ])
50+ vasicek .rate = Decimal ( str ( float (va_short [t ])) )
5051 va_model [t ] = np .asarray (vasicek .rates (ttm ), dtype = float )
51- cir .rate = float (cir_short [t ])
52+ cir .rate = Decimal ( str ( float (cir_short [t ])) )
5253 cir_model [t ] = np .asarray (cir .rates (ttm ), dtype = float )
5354
5455# observed (par -> continuous) and both model yields per tenor, over time
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ def continuously_compounded_rate(
109109 )
110110 return maybe_float (result )
111111
112- def rate (
112+ def rates (
113113 self ,
114114 ttm : Annotated [ArrayLike , Doc ("Time to maturity in years" )],
115115 frequency : Annotated [
You can’t perform that action at this time.
0 commit comments