[Distr-commits] r719 - in pkg/distrMod: R tests/Examples

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 7 16:11:13 CET 2011


Author: stamats
Date: 2011-01-07 16:11:10 +0100 (Fri, 07 Jan 2011)
New Revision: 719

Modified:
   pkg/distrMod/R/L2ParamFamily.R
   pkg/distrMod/tests/Examples/distrMod-Ex.Rout.save
Log:
added computation of relative error in checkL2deriv - maybe there is a better idea avoiding division by zero, updated distrMod-Ex.Rout.save

Modified: pkg/distrMod/R/L2ParamFamily.R
===================================================================
--- pkg/distrMod/R/L2ParamFamily.R	2011-01-07 14:32:50 UTC (rev 718)
+++ pkg/distrMod/R/L2ParamFamily.R	2011-01-07 15:11:10 UTC (rev 719)
@@ -180,10 +180,13 @@
         if(out) cat("precision of centering:\t", cent, "\n")
 
         consist <- E(object = L2Fam, fun = L2deriv %*% t(L2deriv))
-        consist <- consist - as(L2Fam at FisherInfo, "matrix")
+        FI <- as(L2Fam at FisherInfo, "matrix")
+        consist <- consist - FI
         if(out){
             cat("precision of Fisher information:\n")
             print(consist)
+            cat("precision of Fisher information - relativ error [%]:\n")
+            print(100*consist/FI)
         }
 
         prec <- max(abs(cent), abs(consist))

Modified: pkg/distrMod/tests/Examples/distrMod-Ex.Rout.save
===================================================================
--- pkg/distrMod/tests/Examples/distrMod-Ex.Rout.save	2011-01-07 14:32:50 UTC (rev 718)
+++ pkg/distrMod/tests/Examples/distrMod-Ex.Rout.save	2011-01-07 15:11:10 UTC (rev 719)
@@ -204,6 +204,10 @@
               shape1        shape2
 shape1 -1.851068e-05  1.648326e-06
 shape2  1.648326e-06 -1.851068e-05
+precision of Fisher information - relativ error [%]:
+              shape1        shape2
+shape1 -0.0018510679 -0.0002555806
+shape2 -0.0002555806 -0.0018510679
 $maximum.deviation
 [1] 3.963591e-05
 
@@ -272,6 +276,9 @@
 precision of Fisher information:
              prob
 prob 2.842171e-14
+precision of Fisher information - relativ error [%]:
+             prob
+prob 2.131628e-14
 $maximum.deviation
 [1] 2.842171e-14
 
@@ -326,6 +333,10 @@
                 loc       scale
 loc   -3.137524e-05  0.00000000
 scale  0.000000e+00 -0.02118143
+precision of Fisher information - relativ error [%]:
+               loc     scale
+loc   -0.006275047       NaN
+scale          NaN -4.236286
 $maximum.deviation
 [1] 0.02119711
 
@@ -582,13 +593,16 @@
 {
     ((x - 0)/1 * LogDeriv((x - 0)/1) - 1)/1
 }
-<environment: 0x57d27d8>
+<environment: 0x4b4b8b0>
 
 > checkL2deriv(E1)
 precision of centering:	 -1.511810e-06 
 precision of Fisher information:
              scale
 scale -2.61793e-05
+precision of Fisher information - relativ error [%]:
+            scale
+scale -0.00261793
 $maximum.deviation
 [1] 2.61793e-05
 
@@ -714,6 +728,10 @@
               scale         shape
 scale -2.617930e-05 -7.165188e-06
 shape -7.165188e-06 -2.862712e-05
+precision of Fisher information - relativ error [%]:
+              scale         shape
+scale -0.0026179301 -0.0007165188
+shape -0.0007165188 -0.0017403202
 $maximum.deviation
 [1] 2.862712e-05
 
@@ -759,13 +777,16 @@
 {
     LogDeriv(x - 0)
 }
-<environment: 0x3e950f8>
+<environment: 0x3545d10>
 
 > checkL2deriv(G1)
 precision of centering:	 1.511810e-06 
 precision of Fisher information:
              loc
 loc -2.61793e-05
+precision of Fisher information - relativ error [%]:
+            loc
+loc -0.00261793
 $maximum.deviation
 [1] 2.61793e-05
 
@@ -798,7 +819,7 @@
 Slot "fct":
 function (x) 
 QuadFormNorm(x, A = A)
-<environment: 0x5eba8d8>
+<environment: 0x520bce0>
 
 > 
 > ## The function is currently defined as
@@ -1076,13 +1097,16 @@
 {
     ((x - 0)/1 * LogDeriv((x - 0)/1) - 1)/1
 }
-<environment: 0x67e6d48>
+<environment: 0x5e5d5f0>
 
 > checkL2deriv(L1)
 precision of centering:	 -0.003003394 
 precision of Fisher information:
             meanlog
 meanlog -0.01027919
+precision of Fisher information - relativ error [%]:
+          meanlog
+meanlog -1.027919
 $maximum.deviation
 [1] 0.01027919
 
@@ -1694,6 +1718,9 @@
 precision of Fisher information:
            prob
 prob -0.1601189
+precision of Fisher information - relativ error [%]:
+           prob
+prob -0.0300223
 $maximum.deviation
 [1] 0.1601189
 
@@ -1724,6 +1751,10 @@
               size          prob
 size -4.182531e-06  0.0008481424
 prob  8.481424e-04 -0.1601189384
+precision of Fisher information - relativ error [%]:
+            size        prob
+size -0.01373598 -0.02120356
+prob -0.02120356 -0.03002230
 $maximum.deviation
 [1] 0.1601189
 
@@ -1754,6 +1785,10 @@
               size          mean
 size -1.783076e-06   -0.01493583
 mean -1.493583e-02 -114.12730267
+precision of Fisher information - relativ error [%]:
+            size        mean
+size -0.01551567 -0.02177089
+mean -0.02177089 -0.02771248
 $maximum.deviation
 [1] 114.1273
 
@@ -1891,6 +1926,10 @@
               mean            sd
 mean -5.794001e-06  0.0000000000
 sd    0.000000e+00 -0.0001572173
+precision of Fisher information - relativ error [%]:
+              mean           sd
+mean -0.0005794001          NaN
+sd             NaN -0.007860863
 $maximum.deviation
 [1] 0.0001572173
 
@@ -1944,6 +1983,10 @@
               mean            sd
 mean -5.794001e-06  0.0000000000
 sd    0.000000e+00 -0.0001572173
+precision of Fisher information - relativ error [%]:
+              mean           sd
+mean -0.0005794001          NaN
+sd             NaN -0.007860863
 $maximum.deviation
 [1] 0.0001572173
 
@@ -1994,6 +2037,9 @@
 precision of Fisher information:
               sd
 sd -0.0001572173
+precision of Fisher information - relativ error [%]:
+             sd
+sd -0.007860863
 $maximum.deviation
 [1] 0.0001572173
 
@@ -2047,6 +2093,10 @@
                 sd          mean
 sd   -5.794001e-06  0.0000000000
 mean  0.000000e+00 -0.0001572173
+precision of Fisher information - relativ error [%]:
+                sd         mean
+sd   -0.0005794001          NaN
+mean           NaN -0.007860863
 $maximum.deviation
 [1] 0.0001572173
 
@@ -2536,6 +2586,9 @@
 precision of Fisher information:
               lambda
 lambda -3.268427e-06
+precision of Fisher information - relativ error [%]:
+             lambda
+lambda -0.001470792
 $maximum.deviation
 [1] 3.268427e-06
 
@@ -2568,7 +2621,7 @@
 Slot "fct":
 function (x) 
 QuadFormNorm(x, A = A0)
-<environment: 0x5fd40b8>
+<environment: 0x4cfb1b8>
 
 > 
 > ## The function is currently defined as
@@ -2606,7 +2659,7 @@
 Slot "fct":
 function (x) 
 QuadFormNorm(x, A = A)
-<environment: 0x467acb8>
+<environment: 0x4a341a8>
 
 > 
 > ## The function is currently defined as
@@ -2983,6 +3036,9 @@
 precision of Fisher information:
               [,1]
 [1,] -5.794001e-06
+precision of Fisher information - relativ error [%]:
+              [,1]
+[1,] -0.0005794001
 $maximum.deviation
 [1] 5.794001e-06
 
@@ -4054,7 +4110,7 @@
 > ### * <FOOTER>
 > ###
 > cat("Time elapsed: ", proc.time() - get("ptime", pos = 'CheckExEnv'),"\n")
-Time elapsed:  49.35 0.08 49.469 0 0 
+Time elapsed:  49.45 0.17 49.649 0 0 
 > grDevices::dev.off()
 null device 
           1 



More information about the Distr-commits mailing list