tests/manual/Test_Curves.R

ts<-new('zero_flat_yield_TS')
ts<-new('zero_flat_yield_TS', r = c(.02,.1))

ts<-new('zero_flat_yield_TS', r = .02)


ts@r

get_r(ts,1)
get_r(ts,2)

get_df(ts,1)

get_df(ts,c(1,2))


get_fwd(ts,1,2)

get_fwd(ts,c(1,2),c(2,3))

# Equivalenti modi di creare un oggetto
tsi<-new('zero_yield_TS', t=c(0,1,2), r = c(0,.01,0.02), interp=lin_interp)
tsi<-zero_yield_TS( t=c(0,1,2), r = c(0,.01,0.02), interp=lin_interp)

get_df(tsi,c(1,1.5,2))
get_r(tsi,c(1,1.5,2))


tsi_df<-new('disc_yield_TS', t=c(0,1,2), df = c(1.0000000, 0.9900498, 0.9607894))


get_df(tsi_df,c(0,1.2,2))
tsi_df@df

get_r(tsi_df,c(.001,1.2,2))


ts_spreaded<-spreaded_zero_yield_TS(t=c(0,1,2), z = c(0,.005,0.01), basecurve = tsi)
get_r(ts_spreaded,c(1,1.5,2))

ts_spreaded2<-spreaded_zero_yield_TS(t=c(0,1,2), z = c(0,.005,0.01), basecurve = tsi_df)
get_r(ts_spreaded2,c(1,1.5,2))

get_df(ts_spread,c(1,1.5,2))
get_r(ts_spreaded,c(1,1.5,2))
lampoverde/Der documentation built on Jan. 8, 2018, 12:01 p.m.