[Yield-curve-commits] r53 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jan 20 21:30:12 CET 2013


Author: guirreri
Date: 2013-01-20 21:30:11 +0100 (Sun, 20 Jan 2013)
New Revision: 53

Modified:
   pkg/R/Svensson.R
Log:
reducing the tau2 values 

Modified: pkg/R/Svensson.R
===================================================================
--- pkg/R/Svensson.R	2013-01-19 12:00:30 UTC (rev 52)
+++ pkg/R/Svensson.R	2013-01-20 20:30:11 UTC (rev 53)
@@ -6,7 +6,7 @@
     if(ncol(rate)==1) rate<-matrix(as.vector(rate),1,nrow(rate))
     pillars.number <- length(maturity)
     Tau1Values <- seq(maturity[1], median(maturity), by=1)
-    Tau2Values <- seq(median(maturity), maturity[pillars.number], by=0.5)
+    Tau2Values <- seq(median(maturity), maturity[pillars.number], by=1.5)
     
     FinalResults <- matrix(0, nrow(rate), 6)
     FinalResultsTau2 <- matrix(0, length(Tau1Values), 7)   
@@ -23,7 +23,7 @@
             for( a in 1:length(Tau2Values))
               {
                 Tau2Temp <- optimize(.beta2Spot,interval=c(0.001,maturity[pillars.number]),maturity=Tau2Values[a],maximum=TRUE)$maximum
-                InterEstimation <- .NSS.estimator(rate[j,], maturity, Tau1Temp, Tau2Temp)
+                InterEstimation <- .NSS.estimator(as.numric(rate[j,]), maturity, Tau1Temp, Tau2Temp)
                 BetaCoef <- InterEstimation$Par
                 SSR <- sum(InterEstimation$Res^2)
                 InterResultsTau2[a,] <- c(BetaCoef, Tau1Temp, Tau2Temp, SSR)



More information about the Yield-curve-commits mailing list