[Uwgarp-commits] r220 - pkg/GARPFRM/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Feb 7 17:24:39 CET 2015


Author: rossbennett34
Date: 2015-02-07 17:24:38 +0100 (Sat, 07 Feb 2015)
New Revision: 220

Modified:
   pkg/GARPFRM/R/riskMetricsAndHedges.R
Log:
fixing bug in modified duration function

Modified: pkg/GARPFRM/R/riskMetricsAndHedges.R
===================================================================
--- pkg/GARPFRM/R/riskMetricsAndHedges.R	2015-02-07 15:50:21 UTC (rev 219)
+++ pkg/GARPFRM/R/riskMetricsAndHedges.R	2015-02-07 16:24:38 UTC (rev 220)
@@ -28,7 +28,7 @@
   #Get the macaulay duration using bondDuration.MC function
   duration = bondDuration.MC(bond, discountCurve, percentChangeYield)  
   #Calculating yield to maturity using bondYTM function
-  ytm = bondYTM(bond,df)
+  ytm = bondYTM(bond,discountCurve)
   mduration = duration/(1+ytm/bond$m)
   return(mduration)
 }



More information about the Uwgarp-commits mailing list