From noreply at r-forge.r-project.org Tue Jul 9 09:54:23 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 9 Jul 2013 09:54:23 +0200 (CEST) Subject: [Vinecopula-commits] r11 - in pkg: . R inst man Message-ID: <20130709075423.5DC04184DB0@r-forge.r-project.org> Author: ulf Date: 2013-07-09 09:54:22 +0200 (Tue, 09 Jul 2013) New Revision: 11 Added: pkg/man/RvineMatrixCheck.Rd Modified: pkg/DESCRIPTION pkg/NAMESPACE pkg/R/RVineMatrix.R pkg/VineCopula.pdf pkg/inst/ChangeLog pkg/man/VineCopula-package.Rd Log: Neue Funktion RVineMatrixCheck Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2013-04-23 13:08:58 UTC (rev 10) +++ pkg/DESCRIPTION 2013-07-09 07:54:22 UTC (rev 11) @@ -2,7 +2,7 @@ Type: Package Title: Statistical inference of vine copulas Version: 1.1-2 -Date: 2013-02-07 +Date: 2013-07-09 Author: Ulf Schepsmeier, Jakob Stoeber, Eike Christian Brechmann Maintainer: Ulf Schepsmeier Depends: R (>= 2.11.0), MASS, mvtnorm, igraph0 Modified: pkg/NAMESPACE =================================================================== --- pkg/NAMESPACE 2013-04-23 13:08:58 UTC (rev 10) +++ pkg/NAMESPACE 2013-07-09 07:54:22 UTC (rev 11) @@ -28,6 +28,7 @@ export(RVineAIC) export(RVineBIC) export(RVineMatrix) +export(RVineMatrixCheck) export(RVineSim) export(RVineSeqEst) export(RVineCopSelect) Modified: pkg/R/RVineMatrix.R =================================================================== --- pkg/R/RVineMatrix.R 2013-04-23 13:08:58 UTC (rev 10) +++ pkg/R/RVineMatrix.R 2013-07-09 07:54:22 UTC (rev 11) @@ -17,7 +17,7 @@ if(any(!(family %in% c(0,1:10,13,14,16:20,23,24,26:30,33,34,36:40,43,44)))) stop("Copula family not implemented.") if(length(names)>0 & length(names)!=dim(Matrix)[1]) stop("Length of the vector 'names' is not correct.") - if(varraycheck(Matrix)!=1) stop("'Matrix' is not a valid R-vine matrix") + if(RVineMatrixCheck(Matrix)!=1) stop("'Matrix' is not a valid R-vine matrix") if(!all(par %in% c(0,NA))) { @@ -350,8 +350,9 @@ # return -3 for diagonal not 1:d # return -2 for not permutation of 1:j in column j # return -1 if cannot find proper binary array from array in natural order -varraycheck=function(A) +RVineMatrixCheck=function(M) { + A=M d=nrow(A) if(d!=ncol(A)) return(-1) Modified: pkg/VineCopula.pdf =================================================================== --- pkg/VineCopula.pdf 2013-04-23 13:08:58 UTC (rev 10) +++ pkg/VineCopula.pdf 2013-07-09 07:54:22 UTC (rev 11) @@ -1,654 +1,511 @@ -%PDF-1.5 -% -1 0 obj -<< /S /GoTo /D (Rfn.VineCopula.Rdash.package.1) >> -endobj -4 0 obj -(VineCopula-package) -endobj -5 0 obj -<< /S /GoTo /D (Rfn.BiCopCDF.1) >> -endobj -8 0 obj -(BiCopCDF) -endobj -9 0 obj -<< /S /GoTo /D (Rfn.BiCopChiPlot.1) >> -endobj -12 0 obj -(BiCopChiPlot) -endobj -13 0 obj -<< /S /GoTo /D (Rfn.BiCopDeriv.1) >> -endobj -16 0 obj -(BiCopDeriv) -endobj -17 0 obj -<< /S /GoTo /D (Rfn.BiCopDeriv2.1) >> -endobj -20 0 obj -(BiCopDeriv2) -endobj -21 0 obj -<< /S /GoTo /D (Rfn.BiCopEst.1) >> -endobj -24 0 obj -(BiCopEst) -endobj -25 0 obj -<< /S /GoTo /D (Rfn.BiCopGofTest.1) >> -endobj -28 0 obj -(BiCopGofTest) -endobj -29 0 obj -<< /S /GoTo /D (Rfn.BiCopHfunc.1) >> -endobj -32 0 obj -(BiCopHfunc) -endobj -33 0 obj -<< /S /GoTo /D (Rfn.BiCopHfuncDeriv.1) >> -endobj -36 0 obj -(BiCopHfuncDeriv) -endobj -37 0 obj -<< /S /GoTo /D (Rfn.BiCopHfuncDeriv2.1) >> -endobj -40 0 obj -(BiCopHfuncDeriv2) -endobj -41 0 obj -<< /S /GoTo /D (Rfn.BiCopIndTest.1) >> -endobj -44 0 obj -(BiCopIndTest) -endobj -45 0 obj -<< /S /GoTo /D (Rfn.BiCopKPlot.1) >> -endobj -48 0 obj -(BiCopKPlot) -endobj -49 0 obj -<< /S /GoTo /D (Rfn.BiCopLambda.1) >> -endobj -52 0 obj -(BiCopLambda) -endobj -53 0 obj -<< /S /GoTo /D (Rfn.BiCopMetaContour.1) >> -endobj -56 0 obj -(BiCopMetaContour) -endobj -57 0 obj -<< /S /GoTo /D (Rfn.BiCopName.1) >> -endobj -60 0 obj -(BiCopName) -endobj -61 0 obj -<< /S /GoTo /D (Rfn.BiCopPar2TailDep.1) >> -endobj -64 0 obj -(BiCopPar2TailDep) -endobj -65 0 obj -<< /S /GoTo /D (Rfn.BiCopPar2Tau.1) >> -endobj -68 0 obj -(BiCopPar2Tau) -endobj -69 0 obj -<< /S /GoTo /D (Rfn.BiCopPDF.1) >> -endobj -72 0 obj -(BiCopPDF) -endobj -73 0 obj -<< /S /GoTo /D (Rfn.BiCopSelect.1) >> -endobj -76 0 obj -(BiCopSelect) -endobj -77 0 obj -<< /S /GoTo /D (Rfn.BiCopSim.1) >> -endobj -80 0 obj -(BiCopSim) -endobj -81 0 obj -<< /S /GoTo /D (Rfn.BiCopTau2Par.1) >> -endobj -84 0 obj -(BiCopTau2Par) -endobj -85 0 obj -<< /S /GoTo /D (Rfn.BiCopVuongClarke.1) >> -endobj -88 0 obj -(BiCopVuongClarke) -endobj -89 0 obj -<< /S /GoTo /D (Rfn.C2RVine.1) >> -endobj -92 0 obj -(C2RVine) -endobj -93 0 obj -<< /S /GoTo /D (Rfn.D2RVine.1) >> -endobj -96 0 obj -(D2RVine) -endobj -97 0 obj -<< /S /GoTo /D (Rfn.daxreturns.1) >> -endobj -100 0 obj -(daxreturns) -endobj -101 0 obj -<< /S /GoTo /D (Rfn.RVineAIC/BIC.1) >> -endobj -104 0 obj -(RVineAIC/BIC) -endobj -105 0 obj -<< /S /GoTo /D (Rfn.RVineClarkeTest.1) >> -endobj -108 0 obj -(RVineClarkeTest) -endobj -109 0 obj -<< /S /GoTo /D (Rfn.RVineCopSelect.1) >> -endobj -112 0 obj -(RVineCopSelect) -endobj -113 0 obj -<< /S /GoTo /D (Rfn.RVineGrad.1) >> -endobj -116 0 obj -(RVineGrad) -endobj -117 0 obj -<< /S /GoTo /D (Rfn.RVineHessian.1) >> -endobj -120 0 obj -(RVineHessian) -endobj -121 0 obj -<< /S /GoTo /D (Rfn.RVineLogLik.1) >> -endobj -124 0 obj -(RVineLogLik) -endobj -125 0 obj -<< /S /GoTo /D (Rfn.RVineMatrix.1) >> -endobj -128 0 obj -(RVineMatrix) -endobj -129 0 obj -<< /S /GoTo /D (Rfn.RVineMLE.1) >> -endobj -132 0 obj -(RVineMLE) -endobj -133 0 obj -<< /S /GoTo /D (Rfn.RVinePar2Tau.1) >> -endobj -136 0 obj -(RVinePar2Tau) -endobj -137 0 obj -<< /S /GoTo /D (Rfn.RVineSeqEst.1) >> -endobj -140 0 obj -(RVineSeqEst) -endobj -141 0 obj -<< /S /GoTo /D (Rfn.RVineSim.1) >> -endobj -144 0 obj -(RVineSim) -endobj -145 0 obj -<< /S /GoTo /D (Rfn.RVineStdError.1) >> -endobj -148 0 obj -(RVineStdError) -endobj -149 0 obj -<< /S /GoTo /D (Rfn.RVineStructureSelect.1) >> -endobj -152 0 obj -(RVineStructureSelect) -endobj -153 0 obj -<< /S /GoTo /D (Rfn.RVineTreePlot.1) >> -endobj -156 0 obj -(RVineTreePlot) -endobj -157 0 obj -<< /S /GoTo /D (Rfn.RVineVuongTest.1) >> -endobj -160 0 obj -(RVineVuongTest) -endobj -161 0 obj -<< /S /GoTo /D (Rfn.TauMatrix.1) >> -endobj -164 0 obj -(TauMatrix) -endobj -165 0 obj -<< /S /GoTo /D (index.0) >> -endobj -168 0 obj -(Index) -endobj -169 0 obj -<< /S /GoTo /D [170 0 R /Fit] >> -endobj -189 0 obj << -/Length 1240 -/Filter /FlateDecode ->> -stream -x[o6+68ubMd tHE] -"X^&KDsx!e ˓?/0Poqnc{Aco{'7SLhvOl#L4WLۂ~7cA<AJzH DBQtn֏FK\Q{չ4B(I)] 18<ٶd!H0VO\ą1fJ01L&\BؙK*y#yF 'XͪBw8ٌ;gl琱IO0auE5LQ[vČ] gĻBC力H+W -0VXlM8m}:ŭ ]U׍VfxZlUҪge5Tl4p,S^mE)Q~l&\R xQ!|֬ʛ1gC:tv?WH'[@@}-w-d%ҎU057:oKR{?F}诃?Q![L?qr/⬐l1Fl9g*jQp|ezv_Ry?+ZT5px<ǖk&陨hkm/z0" hȜ/N⹓V -endstream -endobj -170 0 obj << -/Type /Page -/Contents 189 0 R -/Resources 188 0 R -/MediaBox [0 0 595.276 841.89] -/Parent 198 0 R -/Annots [ 171 0 R 172 0 R 173 0 R 174 0 R 175 0 R 176 0 R 177 0 R 178 0 R 179 0 R 180 0 R 181 0 R 182 0 R 183 0 R 184 0 R ] ->> endobj -171 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [506.111 267.172 513.085 275.919] -/A << /S /GoTo /D (page.2) >> ->> endobj -172 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [506.111 255.117 513.085 263.964] -/A << /S /GoTo /D (page.5) >> ->> endobj -173 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [506.111 243.162 513.085 252.008] -/A << /S /GoTo /D (page.6) >> ->> endobj -174 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [506.111 231.207 513.085 240.053] -/A << /S /GoTo /D (page.8) >> ->> endobj -175 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [506.111 219.132 513.085 228.098] -/A << /S /GoTo /D (page.9) >> ->> endobj -176 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 207.396 513.085 216.143] -/A << /S /GoTo /D (page.11) >> ->> endobj -177 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 195.441 513.085 204.188] -/A << /S /GoTo /D (page.14) >> ->> endobj -178 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 183.386 513.085 192.233] -/A << /S /GoTo /D (page.17) >> ->> endobj -179 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 171.431 513.085 180.277] -/A << /S /GoTo /D (page.18) >> ->> endobj -180 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 159.476 513.085 168.322] -/A << /S /GoTo /D (page.20) >> ->> endobj -181 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 147.62 513.085 156.367] -/A << /S /GoTo /D (page.21) >> ->> endobj -182 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 135.565 513.085 144.412] -/A << /S /GoTo /D (page.23) >> ->> endobj -183 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 123.71 513.085 132.457] -/A << /S /GoTo /D (page.24) >> ->> endobj -184 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 111.655 513.085 120.502] -/A << /S /GoTo /D (page.26) >> ->> endobj -190 0 obj << -/D [170 0 R /XYZ 99.346 773.487 null] ->> endobj -191 0 obj << -/D [170 0 R /XYZ 100.346 742.532 null] ->> endobj -192 0 obj << -/D [170 0 R /XYZ 100.346 742.532 null] ->> endobj -196 0 obj << -/D [170 0 R /XYZ 100.346 308.367 null] ->> endobj -188 0 obj << -/Font << /F35 193 0 R /F36 194 0 R /F22 195 0 R /F39 197 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -240 0 obj << -/Length 1502 -/Filter /FlateDecode ->> -stream -x[Ks6WH΄4HfI3NǍ4$9",HJaZI֭v!,\O&gW;Ipك -hȝQRK/wgW!RF%q\&ZB~d' %tVJz~Ȑx>CcIIY(RM$١5) c=<\Q#WB=?&tz?)wOn<l궴?EY8~:Oe&d)?z>a'V܏^ܦ(=\3ekZ˻#yLF?{ bWE#'~8O2NFO'x/l77goo;ڧ#3/ - #!^a6G? -wr_"G C*%rh??bq=?"c"?׾uƘD"^B9ۓOz~EB8O6gx%س#bC^eoEǠ_6)ew4Ḍ- -}@FCVtDջ^#_cxp:; -_6]QFH f \nT>ރ#Q=^=lu[zyI$ uɧ/IIՒT# -)3g:㇙KB.1 -xIE}R_)p wK֢VU"mdȕ\wAva -LS6CD~ռTZľN$[ϖ%@Ae -eT*}hR?d-b+H-VX^S뛺k:uQd#+(kVDǠĕzO(E]ϺiȞ+UEyLGcl3bH/ -Rljp]j'֮6tl]2CkV0=z)KFYlj -ro*2ēZ5+S))Sˢ8$1wbT0"[% l>0]M8tW^iebvQJS+09ϳ&qF2SUͪ];TֶWiUmXZMjӴ弹mZDUჂfC+فehѲl@#.r}CעL{v:]Z}oi6^Y4m6YeI;=8PXKv2}<@o1!A -ֱi -@ځx򥜻a#hVe^{}wkP"n~ -Fktcm:p(`w3"[8`xCc_cܣ]0st_h@a߭ih^u3[ʖԢe -C4`!,`.Z$y免e3 -N|[T%`e5}5 -endstream -endobj -239 0 obj << -/Type /Page -/Contents 240 0 R -/Resources 238 0 R -/MediaBox [0 0 595.276 841.89] -/Parent 198 0 R -/Annots [ 185 0 R 186 0 R 187 0 R 213 0 R 214 0 R 215 0 R 216 0 R 217 0 R 218 0 R 219 0 R 220 0 R 221 0 R 222 0 R 223 0 R 224 0 R 225 0 R 226 0 R 227 0 R 228 0 R 229 0 R 230 0 R 231 0 R 232 0 R 233 0 R 234 0 R 235 0 R 236 0 R 237 0 R ] ->> endobj -185 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 731.354 513.085 740.321] -/A << /S /GoTo /D (page.29) >> ->> endobj -186 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 719.519 513.085 728.365] -/A << /S /GoTo /D (page.31) >> ->> endobj -187 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 707.564 513.085 716.41] -/A << /S /GoTo /D (page.33) >> ->> endobj -213 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 695.608 513.085 704.455] -/A << /S /GoTo /D (page.35) >> ->> endobj -214 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 683.653 513.085 692.5] -/A << /S /GoTo /D (page.36) >> ->> endobj -215 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 671.578 513.085 680.545] -/A << /S /GoTo /D (page.39) >> ->> endobj -216 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 659.842 513.085 668.59] -/A << /S /GoTo /D (page.41) >> ->> endobj -217 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 647.887 513.085 656.634] -/A << /S /GoTo /D (page.42) >> ->> endobj -218 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 635.932 513.085 644.679] -/A << /S /GoTo /D (page.44) >> ->> endobj -219 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 623.877 513.085 632.724] -/A << /S /GoTo /D (page.46) >> ->> endobj -220 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 611.922 513.085 620.769] -/A << /S /GoTo /D (page.48) >> ->> endobj -221 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 599.967 513.085 608.814] -/A << /S /GoTo /D (page.48) >> ->> endobj -222 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 588.012 513.085 596.859] -/A << /S /GoTo /D (page.50) >> ->> endobj -223 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 576.057 513.085 584.903] -/A << /S /GoTo /D (page.52) >> ->> endobj -224 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 564.102 513.085 572.948] -/A << /S /GoTo /D (page.54) >> ->> endobj -225 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 552.146 513.085 560.993] -/A << /S /GoTo /D (page.56) >> ->> endobj -226 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 540.191 513.085 549.038] -/A << /S /GoTo /D (page.58) >> ->> endobj -227 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 528.236 513.085 537.083] -/A << /S /GoTo /D (page.60) >> ->> endobj -228 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 516.281 513.085 525.128] -/A << /S /GoTo /D (page.62) >> ->> endobj -229 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 504.326 513.085 513.172] -/A << /S /GoTo /D (page.64) >> ->> endobj -230 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 492.371 513.085 501.217] -/A << /S /GoTo /D (page.65) >> ->> endobj -231 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 480.415 513.085 489.262] -/A << /S /GoTo /D (page.67) >> ->> endobj -232 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 468.46 513.085 477.307] -/A << /S /GoTo /D (page.68) >> ->> endobj -233 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 456.505 513.085 465.352] -/A << /S /GoTo /D (page.70) >> ->> endobj -234 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 444.55 513.085 453.397] -/A << /S /GoTo /D (page.72) >> ->> endobj -235 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 432.595 513.085 441.441] -/A << /S /GoTo /D (page.74) >> ->> endobj -236 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 420.64 513.085 429.486] -/A << /S /GoTo /D (page.76) >> ->> endobj -237 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 398.702 513.085 407.678] -/A << /S /GoTo /D (page.78) >> ->> endobj -199 0 obj << -/D [239 0 R /XYZ 99.346 773.487 null] ->> endobj -242 0 obj << -/D [239 0 R /XYZ 100.346 379.892 null] ->> endobj -2 0 obj << -/D [239 0 R /XYZ 100.346 379.892 null] ->> endobj -244 0 obj << -/D [239 0 R /XYZ 100.346 342.408 null] ->> endobj -245 0 obj << -/D [239 0 R /XYZ 100.346 332.929 null] ->> endobj -246 0 obj << -/D [239 0 R /XYZ 100.346 239.903 null] ->> endobj -247 0 obj << -/D [239 0 R /XYZ 100.346 213.133 null] ->> endobj -238 0 obj << -/Font << /F36 194 0 R /F43 241 0 R /F35 193 0 R /F22 195 0 R /F44 243 0 R /F14 248 0 R /F8 249 0 R /F11 250 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -280 0 obj << -/Length 2268 -/Filter /FlateDecode ->> -stream +%PDF-1.5 +% +1497 0 obj +<> +endobj + +1509 0 obj +<>/Filter/FlateDecode/ID[<5DEF61CE29E4AE189F5134CD12229590><1AC35D00EB3CE74ABB0E67A64C6A4401>]/Index[1497 174]/Info 1496 0 R/Length 86/Prev 404978/Root 1498 0 R/Size 1671/Type/XRef/W[1 2 1]>>stream +hbbd``b`W } BH0Ɂ4>0 $ V ebng`bdic`dQf=0| +endstream +endobj +startxref +0 +%%EOF + +1670 0 obj +<>stream +hS[kAݙlBki*Z-&Z/FVl|5xC4MZ6TlA_P^A|P + +**gw(p3;wp!"%*FD#HS-ratFY~)J&IV #Er:״xax.t;&$lI p)בCxO'\c1`?~@J oFv{r5% +/_>;M=t3.}d +K"#OԞnu6wmI2&YiÆPNO,_/2jǃmV?)pluNg–knD> o6Ou0V&&,O⭎ PXQj`l䥪Y+Q9O)rU6m\Ã^Mƺ@ysŬ2^Kpt-jᶮ RZUЁpAیoavT(XCMR9?*XNﰼYdX1+̎hP$]VgOx ZU\T%xs,~loƌ@phNAʊۍug=6B=jN ,[9 + g:TyNniѧ/`,G.t54`Ƙ.'jDQS V5!B&R4 b\UMPb.˭GsE+T:4kܐ*$&YŏGeO^xdbh7TUzwt9];? ywCAop +DSgLa/|' +endstream +endobj +1498 0 obj +<> +endobj +1499 0 obj +<> +endobj +1500 0 obj +<> +endobj +1501 0 obj +<>stream +hXRF~\&zTLlpl' ;*ޕ֒yt% ,Jw?Pϱçq&L$L(Mb͔҄$Ieƅ1EDɎ9M%w1MؔN4w$ajDq3)xX0iE.yQ $i$S@n \LBpRARLҌ:D%;x髺b&3]`!~Jg>%P-(yD#p'6hfi1pdl"'5\o/+gYޒtE}_|VEu1:42<[g2FGܨu1:I8xRQf8Rnt +<)\G"yxDE*NFR=g2Bg,"68E#{|N"p$RRsD GF>RXѩu3` [xM%#mӎP)DdO<)^R682͇i4\ +%x]K__'aϗ/}>Օi]~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f !=i)YϿ֫Dga'ƒ N`YY@cIgR73J.VSX0R@xﳭr!_p+5vurN2Ơ(bGBcHjiYr'_wW6$C_ Ǒ.8?[FTv7X1㤝IΧƳ)}۫6 +:?=2 + at jtLt1]? + .5;vpl!cvɘi\]*JMfa(,/ d̴>* +endstream +endobj +1503 0 obj +<>stream +xڭweT\.N@c +4%[pN@}gΜY3w~[T=ڛJCMl ;qs +@N-X*xɸ-A`gY w0@h +Z\BBB(t/_&Kj.oU +#- +|`rݽ7 at BMʿqjwdoa䜭ۤ/_y{@o2J}Fv{=aY~.0&j0'. Ҁd4LE[],!虧1.ms~2-{F qCg +, +£sJoj©/>9O>c黂8 eɋG H=Jq1wmz);b&ÞhҙjS1Rkݍj^I]GB+\Wr,Jߺ -pGw(s|<5QQ?(*Ty&|ŸRgK,Ԟ-?{n~@ K f^cZ"T"]Q5wxM3Fd +Ze6n9[ y+4aWc)L8^zG]-_= [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/vinecopula -r 11 From noreply at r-forge.r-project.org Tue Jul 9 19:04:29 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 9 Jul 2013 19:04:29 +0200 (CEST) Subject: [Vinecopula-commits] r12 - in pkg: . R man Message-ID: <20130709170429.532A91852AD@r-forge.r-project.org> Author: ben_graeler Date: 2013-07-09 19:04:28 +0200 (Tue, 09 Jul 2013) New Revision: 12 Added: pkg/R/RVinePartialcorr.R pkg/man/cor2pcor.Rd Modified: pkg/DESCRIPTION pkg/NAMESPACE Log: partial correlations Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2013-07-09 07:54:22 UTC (rev 11) +++ pkg/DESCRIPTION 2013-07-09 17:04:28 UTC (rev 12) @@ -3,7 +3,7 @@ Title: Statistical inference of vine copulas Version: 1.1-2 Date: 2013-07-09 -Author: Ulf Schepsmeier, Jakob Stoeber, Eike Christian Brechmann +Author: Ulf Schepsmeier, Jakob Stoeber, Eike Christian Brechmann, Benedikt Graeler Maintainer: Ulf Schepsmeier Depends: R (>= 2.11.0), MASS, mvtnorm, igraph0 Suggests: CDVine, TSP Modified: pkg/NAMESPACE =================================================================== --- pkg/NAMESPACE 2013-07-09 07:54:22 UTC (rev 11) +++ pkg/NAMESPACE 2013-07-09 17:04:28 UTC (rev 12) @@ -1,53 +1,54 @@ -import(MASS) -import(mvtnorm) -import(igraph0) - -export(BiCopEst) -export(BiCopMetaContour) -export(BiCopChiPlot) -export(BiCopKPlot) -export(BiCopLambda) -export(BiCopVuongClarke) -export(BiCopIndTest) -export(BiCopSim) -export(BiCopPDF) -export(BiCopCDF) -export(BiCopPar2Tau) -export(BiCopPar2TailDep) -export(BiCopTau2Par) -export(BiCopSelect) -export(BiCopName) -export(BiCopHfunc) -export(BiCopDeriv) -export(BiCopDeriv2) -export(BiCopHfuncDeriv) -export(BiCopHfuncDeriv2) -export(BiCopGofTest) - -export(RVineLogLik) -export(RVineAIC) -export(RVineBIC) -export(RVineMatrix) -export(RVineMatrixCheck) -export(RVineSim) -export(RVineSeqEst) -export(RVineCopSelect) -export(RVineMLE) -export(RVineStructureSelect) -export(RVineTreePlot) -export(RVineVuongTest) -export(RVineClarkeTest) -export(RVinePar2Tau) -export(RVineGrad) -export(RVineHessian) -export(RVineStdError) - -export(C2RVine) -export(D2RVine) - -export(TauMatrix) - - -S3method(print, RVineMatrix) - -useDynLib("VineCopula") +import(MASS) +import(mvtnorm) +import(igraph0) + +export(BiCopEst) +export(BiCopMetaContour) +export(BiCopChiPlot) +export(BiCopKPlot) +export(BiCopLambda) +export(BiCopVuongClarke) +export(BiCopIndTest) +export(BiCopSim) +export(BiCopPDF) +export(BiCopCDF) +export(BiCopPar2Tau) +export(BiCopPar2TailDep) +export(BiCopTau2Par) +export(BiCopSelect) +export(BiCopName) +export(BiCopHfunc) +export(BiCopDeriv) +export(BiCopDeriv2) +export(BiCopHfuncDeriv) +export(BiCopHfuncDeriv2) +export(BiCopGofTest) + +export(RVineLogLik) +export(RVineAIC) +export(RVineBIC) +export(RVineMatrix) +export(RVineMatrixCheck) +export(RVineSim) +export(RVineSeqEst) +export(RVineCopSelect) +export(RVineMLE) +export(RVineStructureSelect) +export(RVineTreePlot) +export(RVineVuongTest) +export(RVineClarkeTest) +export(RVinePar2Tau) +export(RVineGrad) +export(RVineHessian) +export(RVineStdError) + +export(C2RVine) +export(D2RVine) + +export(TauMatrix) + +export(cor2pcor,pcor2cor) + +S3method(print, RVineMatrix) + +useDynLib("VineCopula") \ No newline at end of file Added: pkg/R/RVinePartialcorr.R =================================================================== --- pkg/R/RVinePartialcorr.R (rev 0) +++ pkg/R/RVinePartialcorr.R 2013-07-09 17:04:28 UTC (rev 12) @@ -0,0 +1,175 @@ +# functions for partial correlations + +# specific partial correlation from a covariance or correlation matrix +# 'given' is vector indices for the given variables +# j,k are indices for the conditioning variables +partcor=function(S,given,j,k) { + S11=S[given,given] + jk=c(j,k) + S12=S[given,jk] + S21=S[jk,given] + S22=S[jk,jk] + if(length(given)>1) { tem=solve(S11,S12); Om212=S21%*%tem } + else { tem=S12/S11; Om212=outer(S21,tem) } + om11=1-Om212[1,1] + om22=1-Om212[2,2] + om12=S[j,k]-Om212[1,2] + om12/sqrt(om11*om22) +} + +#============================================================ + +# correlations to partial correlations and vice +# versa for general R-vine with RVineMatrix + +# param: cor, correlation matrix +# param: RVM, RVineMatrix defining the strucutre of the RVine +# result: RVineMatrix with transformed partial correlations +cor2pcor=function(corMat, RVM) { + d <- nrow(corMat) + stopifnot(d == nrow(RVM$Matrix)) + if(d<=2) + return(corMat) + + pp <- matrix(0, d, d) + A <- matrix(0, d, d) + + # rotate towards notation in Kurowicka and Joe (2011), p. 9 + for (i in 1:d) { + A[i,] <- rev(RVM$Matrix[d-i+1,]) + } + + # following algorithm is credited to Harry Joe + for(j in 2:d) { # j <- 2 + pp[1,j] <- corMat[A[1,j],j] + } + + # tree 2 + for(j in 3:d) { + a1 <- A[1,j] + a2 <- A[2,j] + pp[2,j] <- (corMat[j,a2]-corMat[j,a1]*corMat[a1,a2])/sqrt((1-corMat[j,a1]^2)*(1-corMat[a1,a2]^2)) + } + + # remaining trees + for(ell in 3:(d-1)) { + for(j in (ell+1):d) { + given <- A[1:(ell-1),j] + pp[ell,j] <- partcor(corMat,given,A[ell,j],j) # assuming A[j,j]=j + } + } + + # re-rotate towards VineCopula notation + pc <- pp + for (i in 1:d) { + pc[i,] <- rev(pp[d-i+1,]) + } + + RVM$par <- pc + return(RVM) +} + + +# corMat <- matrix(c(1.00, 0.17, 0.15, 0.14, 0.13, +# 0.17, 1.00, 0.30, 0.28, 0.05, +# 0.15, 0.30, 1.00, 0.17, 0.05, +# 0.14, 0.28, 0.17, 1.00, 0.04, +# 0.13, 0.05, 0.05, 0.04, 1.00),5,5) +# +# +# +# RVM <- vineCopula(5L)@RVM +# str(RVM) +# +# cor2pcor.cvine(corMat) +# +# newRVM <- cor2pcor(corMat, RVM) +# newRVM$family <- matrix(1,5,5) +# +# # classic +# round(cor(rmvnorm(10000,rep(0,5),corMat))-corMat,2) +# # vine +# round(cor(qnorm(rCopula(10000, vineCopula(newRVM))))-corMat,2) +# +# pcor2cor(cor2pcor(corMat, RVM)) +# round(pcor2cor(RVM=newRVM)-corMat,2) +# cor2pcor(corMat, RVM)$par +# + +# library(gstat) +# data(sic2004) +# coordinates(sic.val) <- ~x+y +# hist(variogramLine(vgm(0.8,"Mat",150000,0.2),covariance=T,dist_vector=spDists(sic.val[,]))) +# +# +# tauFromCor <- function(x) { +# tau(normalCopula(x)) +# } +# +# plot(1:200*2500,sapply(variogramLine(vgm(0.8,"Mat",150000,0.2),covariance=T,dist_vector=1:200*2500)[,2], +# tauFromCor),type="l",ylim=c(0,1)) +# +# points(1:200*2500,variogramLine(vgm(0.8,"Mat",150000,0.2),covariance=T,dist_vector=1:200*2500)[,2], +# type="l", col="red") + + + +# generate correlation matrix based on partial correlations of R-vine +# with vine array A that has 1:d on diagonal; + +pcor2cor <- function(RVM) { + d=nrow(RVM$Matrix) + + A <- matrix(0,d,d) + # rotate towards notation in Kurowicka and Joe (2011), p. 9 + for (i in 1:d) { + A[i,] <- rev(RVM$Matrix[d-i+1,]) + } + + pc <- matrix(0,d,d) + for (i in 1:d) { + pc[i,] <- rev(RVM$par[d-i+1,]) + } + + if(d<=2) { + corMat <- matrix(c(1,pc[1,2],pc[1,2],1)) + return(corMat) + } + + corMat <- matrix(0,d,d) + diag(corMat) <- 1 + for(j in 2:d) { + a1 <- A[1,j] + corMat[a1,j] <- pc[1,j] + corMat[j,a1] <- pc[1,j] + } + + # tree 2 + for(j in 3:d) { + a1 <- A[1,j] + a2 <- A[2,j] + corMat[j,a2] <- corMat[j,a1]*corMat[a1,a2]+pc[2,j]*sqrt((1-corMat[j,a1]^2)*(1-corMat[a1,a2]^2)) + corMat[a2,j] <- corMat[j,a2] + } + + # remaining trees + for(ell in 3:(d-1)) { + for(j in (ell+1):d) { + given <- A[1:(ell-1),j] + S11 <- corMat[given,given] + anew <- A[ell,j] + jk <- c(anew,j) + S12 <- corMat[given,jk] + S21 <- corMat[jk,given] + S22 <- corMat[jk,jk] + tem <- solve(S11,S12) + Om212 <- S21%*%tem + om11 <- 1-Om212[1,1] + om22 <- 1-Om212[2,2] + tem12 <- pc[ell,j]*sqrt(om11*om22) + corMat[anew,j] <- tem12+Om212[1,2] + corMat[j,anew] <- corMat[anew,j] + } + } + corMat +} \ No newline at end of file Added: pkg/man/cor2pcor.Rd =================================================================== --- pkg/man/cor2pcor.Rd (rev 0) +++ pkg/man/cor2pcor.Rd 2013-07-09 17:04:28 UTC (rev 12) @@ -0,0 +1,53 @@ +\name{cor2pcor} +\Rdversion{1.1} +\alias{pcor2cor} +\alias{cor2pcor} + +\title{correlations to partial correlations and vice versa for R-vines} +\description{ +correlations to partial correlations and vice versa for R-vines +(C vine, D vine or general R vine) +} + +\usage{ +cor2pcor(corMat, RVM) +pcor2cor(RVM) +} +\arguments{ + \item{corMat}{correlation matrix} + \item{RVM}{\code{\link{RVineMatrix}} defining only the R-vine structure for \code{cor2pcor} and providing as well the partial correlations for \code{pcor2cor}.} +} +\value{ + \item{cor}{correlation matrix} + \item{RVM}{RVineMatrix with transformed partial correlations} +} + +\examples{ +corMat <- matrix(c(1.00, 0.17, 0.15, 0.14, 0.13, + 0.17, 1.00, 0.30, 0.28, 0.05, + 0.15, 0.30, 1.00, 0.17, 0.05, + 0.14, 0.28, 0.17, 1.00, 0.04, + 0.13, 0.05, 0.05, 0.04, 1.00),5,5) + +RVM <- list() +RVM$Matrix <- matrix(c(5,4,3,2,1, + 0,4,3,2,1, + 0,0,3,2,1, + 0,0,0,2,1, + 0,0,0,0,1),5,5) +class(RVM) <- "RVineMatrix" +cor2pcor(corMat, RVM) + +newRVM <- cor2pcor(corMat, RVM) +newRVM$family <- matrix(1,5,5) +newRVM$par2 <- matrix(0,5,5) + +# simulate a 5-dim normal from the vine and calculate its correlations +round(cor(qnorm(RVineSim(10000, newRVM))),2) + +pcor2cor(cor2pcor(corMat, RVM)) +pcor2cor(newRVM) +} + +\keyword{vine} +\keyword{partial correlation} From noreply at r-forge.r-project.org Wed Jul 10 16:46:49 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 10 Jul 2013 16:46:49 +0200 (CEST) Subject: [Vinecopula-commits] r13 - / pkg pkg/R pkg/man www Message-ID: <20130710144649.2010D184468@r-forge.r-project.org> Author: ben_graeler Date: 2013-07-10 16:46:48 +0200 (Wed, 10 Jul 2013) New Revision: 13 Added: VineCopula_1.1-2.tar.gz VineCopula_1.1-2.zip pkg/man/RVineCor2pcor.Rd pkg/man/RVineMatrixNormalize.Rd Removed: README pkg/man/cor2pcor.Rd Modified: pkg/DESCRIPTION pkg/NAMESPACE pkg/R/RVineMatrix.R pkg/R/RVinePartialcorr.R www/index.php Log: - added RVinePcor2cor and RVineCor2pcor - fixed permutation issues for partial correlations - added exported RVineMatrixNormalize - inserted a link to vine-copula.org on the project website Deleted: README =================================================================== --- README 2013-07-09 17:04:28 UTC (rev 12) +++ README 2013-07-10 14:46:48 UTC (rev 13) @@ -1,76 +0,0 @@ - R-Forge SVN README - -This file explains the repository structure of your project. A more -detailed guide to R-Forge is available by -Theul and Zeileis (2010) [1] and the R-Forge Administration and -Development Team (2009) [2]. - -1. Introduction ------------------------------------------------------------------------ -R is free software distributed under a GNU-style copyleft. R-Forge is -a central platform for the development of R packages, R-related -software and further projects. Among many other web-based features it -provides facilities for collaborative source code management via -Subversion (SVN) [3]. - -2. The directory you're in ------------------------------------------------------------------------ -This is the repository of your project. It contains two important -pre-defined directories namely 'pkg' and 'www'. These directories must -not be deleted otherwise R-Forge's core functionality will not be -available (i.e., daily checking and building of your package or the -project websites). -'pkg' and 'www' are standardized and therefore are going to be -described in this README. The rest of your repository can be used as -you like. - -3. 'pkg' directory ------------------------------------------------------------------------ -To make use of the package building and checking feature the package -source code has to be put into the 'pkg' directory of your repository -(i.e., 'pkg/DESCRIPTION', 'pkg/R', 'pkg/man', etc.) or, alternatively, -a subdirectory of 'pkg'. The latter structure allows for having more -than one package in a single project, e.g., if a project consists of -the packages foo and bar then the source code will be located in -'pkg/foo' and 'pkg/bar', respectively. - -R-Forge automatically examines the 'pkg' directory of every repository -and builds the package sources as well as the package binaries on a -daily basis for Mac OS X and Windows (if applicable). The package builds -are provided in the 'R Packages' tab for download or can be installed -directly in R from a CRAN-style repository using -'install.packages("foo", repos="http://R-Forge.R-project.org")'. -Furthermore, in the 'R Packages' tab developers can examine logs -generated on different platforms by the build and check process. - -4. 'www' directory ------------------------------------------------------------------------ -Developers may present their project on a subdomain of R-Forge, e.g., -'http://foo.R-Forge.R-project.org', or via a link to an external -website. - -This directory contains the project homepage which gets updated hourly -on R-Forge, so please take into consideration that it will not be -available right after you commit your changes or additions. - -5. Help ------------------------------------------------------------------------ -If you need help don't hesitate to submit a support request at -https://r-forge.r-project.org/tracker/?func=add&group_id=34&atid=194, -search the forum -https://r-forge.r-project.org/forum/forum.php?forum_id=78&group_id=34, -or contact us at R-Forge at R-project.org. - -6. References ------------------------------------------------------------------------ - -[1] Stefan Theul and Achim Zeileis. Collaborative software development -using R-Forge. The R Journal, 1(1):9-14, May 2009. URL -http://journal.r-project.org/2009-1/RJournal_2009-1_Theussl+Zeileis.pdf - -[2] R-Forge Administration and Development Team. RForge User?s Manual, -2008. URL http://download.R-Forge.R-project.org/R-Forge.pdf - -[3] C. M. Pilato, B. Collins-Sussman, and B. W. Fitzpatrick. Version -Control with Subversion. O?Reilly, 2004. Full book available online at -http://svnbook.red-bean.com/ Added: VineCopula_1.1-2.tar.gz =================================================================== (Binary files differ) Property changes on: VineCopula_1.1-2.tar.gz ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: VineCopula_1.1-2.zip =================================================================== (Binary files differ) Property changes on: VineCopula_1.1-2.zip ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2013-07-09 17:04:28 UTC (rev 12) +++ pkg/DESCRIPTION 2013-07-10 14:46:48 UTC (rev 13) @@ -2,7 +2,7 @@ Type: Package Title: Statistical inference of vine copulas Version: 1.1-2 -Date: 2013-07-09 +Date: 2013-07-10 Author: Ulf Schepsmeier, Jakob Stoeber, Eike Christian Brechmann, Benedikt Graeler Maintainer: Ulf Schepsmeier Depends: R (>= 2.11.0), MASS, mvtnorm, igraph0 Modified: pkg/NAMESPACE =================================================================== --- pkg/NAMESPACE 2013-07-09 17:04:28 UTC (rev 12) +++ pkg/NAMESPACE 2013-07-10 14:46:48 UTC (rev 13) @@ -47,7 +47,7 @@ export(TauMatrix) -export(cor2pcor,pcor2cor) +export(RVineCor2pcor,RVinePcor2cor, RVineMatrixNormalize) S3method(print, RVineMatrix) Modified: pkg/R/RVineMatrix.R =================================================================== --- pkg/R/RVineMatrix.R 2013-07-09 17:04:28 UTC (rev 12) +++ pkg/R/RVineMatrix.R 2013-07-10 14:46:48 UTC (rev 13) @@ -68,7 +68,7 @@ oldOrder = diag(RVM$Matrix) Matrix = reorderRVineMatrix(RVM$Matrix) - return(RVineMatrix(Matrix, RVM$family, RVM$par, RVM$par2, names = rev(RVM$names[oldOrder]))) + return(RVineMatrix(Matrix, RVM$family, RVM$par, RVM$par2, names = rev(RVM$names[oldOrder]))) } reorderRVineMatrix = function(Matrix){ @@ -83,6 +83,17 @@ return(Matrix) } +# exported version of normalizeRVineMatrix +RVineMatrixNormalize <- function(RVM) { + stopifnot(is(RVM, "RVineMatrix")) + + if(is.null(RVM$names)) + RVM$names <- paste("V",1:nrow(RVM$Matrix),sep="") + oldOrder = diag(RVM$Matrix) + + return(normalizeRVineMatrix(RVM)) +} + dim.RVineMatrix = function(x){ RVine=x return(dim(RVine$Matrix)[1]) @@ -272,16 +283,19 @@ } # This function is not in NAMESPACE (not for direct use). -# Function with T(x,y)=ell if x-y are conditioned partners in tree l -vpartner=function(A) -{ d=nrow(A); - T=matrix(0,d,d) - for(j in 2:d) - { x=A[j,j] - for(k in 1:(j-1)) - { y=A[k,j]; T[x,y]=k; T[y,x]=k } +# Function with T(x,y)=k if x-y are conditioned partners in tree k +vpartner <- function(A){ + d=nrow(A); + tree=matrix(0,d,d) + for(j in 2:d) { + x=A[j,j] + for(k in 1:(j-1)) { + y=A[k,j] + tree[x,y]=k + tree[y,x]=k + } } - T + tree } # Check whether A in natural order is a valid vine array if it has Modified: pkg/R/RVinePartialcorr.R =================================================================== --- pkg/R/RVinePartialcorr.R 2013-07-09 17:04:28 UTC (rev 12) +++ pkg/R/RVinePartialcorr.R 2013-07-10 14:46:48 UTC (rev 13) @@ -1,4 +1,4 @@ -# functions for partial correlations +# functions for partial correlations by H. Joe # specific partial correlation from a covariance or correlation matrix # 'given' is vector indices for the given variables @@ -9,8 +9,13 @@ S12=S[given,jk] S21=S[jk,given] S22=S[jk,jk] - if(length(given)>1) { tem=solve(S11,S12); Om212=S21%*%tem } - else { tem=S12/S11; Om212=outer(S21,tem) } + if(length(given)>1) { + tem=solve(S11,S12) + Om212=S21%*%tem + } else { + tem=S12/S11 + Om212=outer(S21,tem) + } om11=1-Om212[1,1] om22=1-Om212[2,2] om12=S[j,k]-Om212[1,2] @@ -25,20 +30,40 @@ # param: cor, correlation matrix # param: RVM, RVineMatrix defining the strucutre of the RVine # result: RVineMatrix with transformed partial correlations -cor2pcor=function(corMat, RVM) { +RVineCor2pcor=function(RVM, corMat) { d <- nrow(corMat) stopifnot(d == nrow(RVM$Matrix)) + stopifnot(is(RVM, "RVineMatrix")) + stopifnot(all(RVM$family%in%c(0,1,2))) + if(d<=2) return(corMat) pp <- matrix(0, d, d) - A <- matrix(0, d, d) + + oldRVM <- RVM + oldOrder = diag(RVM$Matrix) + if(any(oldOrder != length(oldOrder):1)) { + RVM = normalizeRVineMatrix(RVM) + corMat <- corMat[rev(oldOrder),rev(oldOrder)] + } - # rotate towards notation in Kurowicka and Joe (2011), p. 9 - for (i in 1:d) { - A[i,] <- rev(RVM$Matrix[d-i+1,]) + if(!is.null(oldRVM$names)) { + if(any(!(oldRVM$names %in% paste("V", 1:d, sep="")))) { + warning("RVM$names are not default and cannot be checked. Make sure that + the correlation matrix has the same ordering of variables as the + RVM.") + } else { + nameOrder <- order(oldRVM$names) + if(any(nameOrder != 1:length(oldRVM$names))){ + corMat <- corMat[nameOrder,nameOrder] + } + } } + # rotate towards notation in Kurowicka and Joe (2011), p. 9 + A <- RVM$Matrix[d:1,d:1] + # following algorithm is credited to Harry Joe for(j in 2:d) { # j <- 2 pp[1,j] <- corMat[A[1,j],j] @@ -60,79 +85,35 @@ } # re-rotate towards VineCopula notation - pc <- pp - for (i in 1:d) { - pc[i,] <- rev(pp[d-i+1,]) - } + pc <- pp[d:1,d:1] - RVM$par <- pc - return(RVM) + oldRVM$par <- pc + return(oldRVM) } -# corMat <- matrix(c(1.00, 0.17, 0.15, 0.14, 0.13, -# 0.17, 1.00, 0.30, 0.28, 0.05, -# 0.15, 0.30, 1.00, 0.17, 0.05, -# 0.14, 0.28, 0.17, 1.00, 0.04, -# 0.13, 0.05, 0.05, 0.04, 1.00),5,5) -# -# -# -# RVM <- vineCopula(5L)@RVM -# str(RVM) -# -# cor2pcor.cvine(corMat) -# -# newRVM <- cor2pcor(corMat, RVM) -# newRVM$family <- matrix(1,5,5) -# -# # classic -# round(cor(rmvnorm(10000,rep(0,5),corMat))-corMat,2) -# # vine -# round(cor(qnorm(rCopula(10000, vineCopula(newRVM))))-corMat,2) -# -# pcor2cor(cor2pcor(corMat, RVM)) -# round(pcor2cor(RVM=newRVM)-corMat,2) -# cor2pcor(corMat, RVM)$par -# - -# library(gstat) -# data(sic2004) -# coordinates(sic.val) <- ~x+y -# hist(variogramLine(vgm(0.8,"Mat",150000,0.2),covariance=T,dist_vector=spDists(sic.val[,]))) -# -# -# tauFromCor <- function(x) { -# tau(normalCopula(x)) -# } -# -# plot(1:200*2500,sapply(variogramLine(vgm(0.8,"Mat",150000,0.2),covariance=T,dist_vector=1:200*2500)[,2], -# tauFromCor),type="l",ylim=c(0,1)) -# -# points(1:200*2500,variogramLine(vgm(0.8,"Mat",150000,0.2),covariance=T,dist_vector=1:200*2500)[,2], -# type="l", col="red") - - - # generate correlation matrix based on partial correlations of R-vine # with vine array A that has 1:d on diagonal; -pcor2cor <- function(RVM) { - d=nrow(RVM$Matrix) +RVinePcor2cor <- function(RVM) { + d <- nrow(RVM$Matrix) - A <- matrix(0,d,d) - # rotate towards notation in Kurowicka and Joe (2011), p. 9 - for (i in 1:d) { - A[i,] <- rev(RVM$Matrix[d-i+1,]) + stopifnot(is(RVM, "RVineMatrix")) + stopifnot(all(RVM$family%in%c(0,1,2))) + + oldRVM <- RVM + oldOrder <- diag(RVM$Matrix) + if(any(oldOrder != length(oldOrder):1)) { + RVM = normalizeRVineMatrix(RVM) } - pc <- matrix(0,d,d) - for (i in 1:d) { - pc[i,] <- rev(RVM$par[d-i+1,]) - } - + # rotate towards notation in Kurowicka and Joe (2011), p. 9 + A <- RVM$Matrix[d:1,d:1] + pc <- RVM$par[d:1,d:1] + if(d<=2) { - corMat <- matrix(c(1,pc[1,2],pc[1,2],1)) + iorder <- diag(RVM$Matrix) + corMat <- matrix(c(1,pc[iorder[1],iorder[2]],pc[iorder[1],iorder[2]],1)) return(corMat) } @@ -171,5 +152,116 @@ corMat[j,anew] <- corMat[anew,j] } } - corMat -} \ No newline at end of file + + corMat <- corMat[rev(oldOrder), rev(oldOrder)] + + nameOrder <- NULL + if(!is.null(oldRVM$names)) { + if(any(!(oldRVM$names %in% paste("V", 1:d, sep="")))) { + warning("RVM$names are not default and cannot be checked. Make sure to + interpret the correlation matrix in the same ordering of variables + as given in the RVineMatrix.") + } else { + nameOrder <- order(oldRVM$names) + if(any(nameOrder != 1:length(oldRVM$names))){ + corMat <- corMat[nameOrder, nameOrder] + } + } + } + + return(corMat) +} + +# ####################################### +# # for immeddeate testing run as well ## +# ####################################### +# +# normalizeRVineMatrix = function(RVM){ +# +# oldOrder = diag(RVM$Matrix) +# Matrix = reorderRVineMatrix(RVM$Matrix) +# +# names <- RVM$names +# if(is.null(names)) +# names <- paste("V",1:nrow(RVM$Matrix),sep="") +# +# return(RVineMatrix(Matrix, RVM$family, RVM$par, RVM$par2, names = rev(names[oldOrder]))) +# } +# +# reorderRVineMatrix = function(Matrix){ +# oldOrder = diag(Matrix) +# +# O = apply(t(1:nrow(Matrix)),2,"==", Matrix) +# +# for(i in 1:nrow(Matrix)){ +# Matrix[O[,oldOrder[i]]] = nrow(Matrix)-i+1 +# } +# +# return(Matrix) +# } +# +# # examples/test cases +# ###################### +# +# corMat <- matrix(c(1.00, 0.17, 0.15, 0.14, 0.13, +# 0.17, 1.00, 0.30, 0.28, 0.05, +# 0.15, 0.30, 1.00, 0.17, 0.05, +# 0.14, 0.28, 0.17, 1.00, 0.04, +# 0.13, 0.05, 0.05, 0.04, 1.00),5,5) +# +# Matrix = matrix(c(5,2,3,1,4, +# 0,2,3,4,1, +# 0,0,3,4,1, +# 0,0,0,4,1, +# 0,0,0,0,1),5,5) +# family = matrix(1,5,5) +# +# par = matrix(c(0,0.2,0.9,0.5,0.8, +# 0, 0,0.1,0.6,0.9, +# 0, 0, 0,0.7,0.5, +# 0, 0, 0, 0,0.8, +# 0, 0, 0, 0, 0),5,5) +# +# # define RVineMatrix object +# RVM = RVineMatrix(Matrix,family,par) +# +# # adjust the un-ordered RVine +# newRVM <- RVineCor2pcor(RVM, corMat) +# round(cor(qnorm(RVineSim(100000, newRVM)))-corMat, 2) +# +# # normalise the RVine +# normRVM <- normalizeRVineMatrix(RVM) +# +# # adjust the normalised RVine +# newNormRVM <- RVineCor2pcor(normRVM, corMat) +# +# # newRVM and newNormRVM are the same vine using only different naming: +# newNormRVM$par - newRVM$par +# +# # the variable now do have a different ordering in the correlation matrix +# newNormCor <- cor(qnorm(RVineSim(100000, newNormRVM))) +# round(newNormCor,2) +# +# # permuted, they meet the initial correlation matrix up to +/- 0.01 +# round(newNormCor[c(1,4,3,2,5),c(1,4,3,2,5)]-corMat, 2) +# +# # re-order names of the normalised RVine generating a new RVine +# normRVM2 <- normRVM +# normRVM2$names <- c("V1", "V2", "V3", "V4", "V5") +# +# # adjust the normalised RVine +# newNormRVM2 <- RVineCor2pcor(normRVM2, corMat) +# # check whether the parameters are different beyond permutation (that's why +# # permutation does not work) +# newNormRVM2$par +# newRVM$par +# +# # adjust the normalised RVine +# newNormRVM2 <- RVineCor2pcor(normRVM2, corMat[c(1,4,3,2,5),c(1,4,3,2,5)]) +# # check whether the parameters are now identical +# round(newNormRVM2$par - newRVM$par,2) +# +# # back and forth +# RVinePcor2cor(RVineCor2pcor(RVM, corMat))-corMat +# RVinePcor2cor(RVineCor2pcor(normRVM, corMat))-corMat +# RVinePcor2cor(RVineCor2pcor(normRVM2, corMat))-corMat Copied: pkg/man/RVineCor2pcor.Rd (from rev 12, pkg/man/cor2pcor.Rd) =================================================================== --- pkg/man/RVineCor2pcor.Rd (rev 0) +++ pkg/man/RVineCor2pcor.Rd 2013-07-10 14:46:48 UTC (rev 13) @@ -0,0 +1,91 @@ +\name{RVineCor2pcor} +\Rdversion{1.1} +\alias{RVinePcor2cor} +\alias{RVineCor2pcor} + +\title{correlations to partial correlations and vice versa for R-vines} +\description{ +correlations to partial correlations and vice versa for R-vines +(C vine, D vine or general R vine) +} + +\usage{ +RVineCor2pcor(RVM, corMat) +RVinePcor2cor(RVM) +} +\arguments{ + \item{RVM}{\code{\link{RVineMatrix}} defining only the R-vine structure for \code{cor2pcor} and providing as well the partial correlations for \code{pcor2cor}.} + \item{corMat}{correlation matrix} +} +\value{ + \item{RVM}{RVineMatrix with transformed partial correlations} + \item{cor}{correlation matrix} +} + +\examples{ +corMat <- matrix(c(1.00, 0.17, 0.15, 0.14, 0.13, + 0.17, 1.00, 0.30, 0.28, 0.05, + 0.15, 0.30, 1.00, 0.17, 0.05, + 0.14, 0.28, 0.17, 1.00, 0.04, + 0.13, 0.05, 0.05, 0.04, 1.00),5,5) + +Matrix = matrix(c(5,2,3,1,4, + 0,2,3,4,1, + 0,0,3,4,1, + 0,0,0,4,1, + 0,0,0,0,1),5,5) +family = matrix(1,5,5) + +par = matrix(c(0,0.2,0.9,0.5,0.8, + 0, 0,0.1,0.6,0.9, + 0, 0, 0,0.7,0.5, + 0, 0, 0, 0,0.8, + 0, 0, 0, 0, 0),5,5) + +# define RVineMatrix object +RVM = RVineMatrix(Matrix,family,par) + +# adjust the un-ordered RVine +newRVM <- RVineCor2pcor(RVM, corMat) +round(cor(qnorm(RVineSim(1000, newRVM)))-corMat, 2) + +# normalise the RVine +normRVM <- RVineMatrixNormalize(RVM) + +# adjust the normalised RVine +newNormRVM <- RVineCor2pcor(normRVM, corMat) + +# newRVM and newNormRVM are the same vine using only different naming: +newNormRVM$par - newRVM$par + +# the variable now do have a different ordering in the correlation matrix +newNormCor <- cor(qnorm(RVineSim(1000, newNormRVM))) +round(newNormCor,2) + +# permuted, they meet the initial correlation matrix up to +/- 0.01 +round(newNormCor[c(1,4,3,2,5),c(1,4,3,2,5)]-corMat, 2) + +# re-order names of the normalised RVine generating a new RVine +normRVM2 <- normRVM +normRVM2$names <- c("V1", "V2", "V3", "V4", "V5") + +# adjust the normalised RVine +newNormRVM2 <- RVineCor2pcor(normRVM2, corMat) +# check whether the parameters are different beyond permutation (that's why +# permutation does not work) +newNormRVM2$par +newRVM$par + +# adjust the normalised RVine +newNormRVM2 <- RVineCor2pcor(normRVM2, corMat[c(1,4,3,2,5),c(1,4,3,2,5)]) +# check whether the parameters are now identical +round(newNormRVM2$par - newRVM$par,2) + +# back and forth +RVinePcor2cor(RVineCor2pcor(RVM, corMat))-corMat +RVinePcor2cor(RVineCor2pcor(normRVM, corMat))-corMat +RVinePcor2cor(RVineCor2pcor(normRVM2, corMat))-corMat +} + +\keyword{vine} +\keyword{partial correlation} Added: pkg/man/RVineMatrixNormalize.Rd =================================================================== --- pkg/man/RVineMatrixNormalize.Rd (rev 0) +++ pkg/man/RVineMatrixNormalize.Rd 2013-07-10 14:46:48 UTC (rev 13) @@ -0,0 +1,48 @@ +\name{RVineMatrixNormalize} +\Rdversion{1.1} +\alias{RVineMatrixNormalize} + +\title{Permute the variables to achieve a natural ordering} +\description{ +A RVineMatrix is permuted to achieve a natural ordering (i.e. \code{diag(RVM$Matrix)==d:1}) +} + +\usage{ +RVineMatrixNormalize(RVM) +} +\arguments{ + \item{RVM}{\code{\link{RVineMatrix}} defining the R-vine structure} + +} +\value{ + \item{RVM}{A RVineMatrix in natural ordering with entries in \code{RVM$names} keeping track of the reordering} +} + +\examples{ +corMat <- matrix(c(1.00, 0.17, 0.15, 0.14, 0.13, + 0.17, 1.00, 0.30, 0.28, 0.05, + 0.15, 0.30, 1.00, 0.17, 0.05, + 0.14, 0.28, 0.17, 1.00, 0.04, + 0.13, 0.05, 0.05, 0.04, 1.00),5,5) + +Matrix = matrix(c(5,2,3,1,4, + 0,2,3,4,1, + 0,0,3,4,1, + 0,0,0,4,1, + 0,0,0,0,1),5,5) +family = matrix(1,5,5) + +par = matrix(c(0,0.2,0.9,0.5,0.8, + 0, 0,0.1,0.6,0.9, + 0, 0, 0,0.7,0.5, + 0, 0, 0, 0,0.8, + 0, 0, 0, 0, 0),5,5) + +# define RVineMatrix object +RVM = RVineMatrix(Matrix,family,par) + +# normalise the RVine +RVineMatrixNormalize(RVM) +} + +\keyword{vine} Deleted: pkg/man/cor2pcor.Rd =================================================================== --- pkg/man/cor2pcor.Rd 2013-07-09 17:04:28 UTC (rev 12) +++ pkg/man/cor2pcor.Rd 2013-07-10 14:46:48 UTC (rev 13) @@ -1,53 +0,0 @@ -\name{cor2pcor} -\Rdversion{1.1} -\alias{pcor2cor} -\alias{cor2pcor} - -\title{correlations to partial correlations and vice versa for R-vines} -\description{ -correlations to partial correlations and vice versa for R-vines -(C vine, D vine or general R vine) -} - -\usage{ -cor2pcor(corMat, RVM) -pcor2cor(RVM) -} -\arguments{ - \item{corMat}{correlation matrix} - \item{RVM}{\code{\link{RVineMatrix}} defining only the R-vine structure for \code{cor2pcor} and providing as well the partial correlations for \code{pcor2cor}.} -} -\value{ - \item{cor}{correlation matrix} - \item{RVM}{RVineMatrix with transformed partial correlations} -} - -\examples{ -corMat <- matrix(c(1.00, 0.17, 0.15, 0.14, 0.13, - 0.17, 1.00, 0.30, 0.28, 0.05, - 0.15, 0.30, 1.00, 0.17, 0.05, - 0.14, 0.28, 0.17, 1.00, 0.04, - 0.13, 0.05, 0.05, 0.04, 1.00),5,5) - -RVM <- list() -RVM$Matrix <- matrix(c(5,4,3,2,1, - 0,4,3,2,1, - 0,0,3,2,1, - 0,0,0,2,1, - 0,0,0,0,1),5,5) -class(RVM) <- "RVineMatrix" -cor2pcor(corMat, RVM) - -newRVM <- cor2pcor(corMat, RVM) -newRVM$family <- matrix(1,5,5) -newRVM$par2 <- matrix(0,5,5) - -# simulate a 5-dim normal from the vine and calculate its correlations -round(cor(qnorm(RVineSim(10000, newRVM))),2) - -pcor2cor(cor2pcor(corMat, RVM)) -pcor2cor(newRVM) -} - -\keyword{vine} -\keyword{partial correlation} Modified: www/index.php =================================================================== --- www/index.php 2013-07-09 17:04:28 UTC (rev 12) +++ www/index.php 2013-07-10 14:46:48 UTC (rev 13) @@ -43,7 +43,7 @@ -

No content added.

+

The research underlying this project can be found at vine-copula.org

The project summary page you can find here.

From noreply at r-forge.r-project.org Thu Jul 11 14:44:21 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 11 Jul 2013 14:44:21 +0200 (CEST) Subject: [Vinecopula-commits] r14 - in pkg: R man Message-ID: <20130711124421.81E171853D9@r-forge.r-project.org> Author: ulf Date: 2013-07-11 14:44:20 +0200 (Thu, 11 Jul 2013) New Revision: 14 Modified: pkg/R/RVineStructureSelect.r pkg/man/RVineMatrixNormalize.Rd Log: In der StructureSelect wird der Devine gesondert abgefangen. Modified: pkg/R/RVineStructureSelect.r =================================================================== --- pkg/R/RVineStructureSelect.r 2013-07-10 14:46:48 UTC (rev 13) +++ pkg/R/RVineStructureSelect.r 2013-07-11 12:44:20 UTC (rev 14) @@ -2,6 +2,7 @@ if(type == 0) type = "RVine" else if(type == 1) type = "CVine" + else if(type == 2 || type == "DVine") stop("Code to determine the order of the nodes in a D-vine using the package TSP is provided as an example in the documentation of this function." ) if(type != "RVine" & type != "CVine") stop("Vine model not implemented.") n = dim(data)[2] Modified: pkg/man/RVineMatrixNormalize.Rd =================================================================== --- pkg/man/RVineMatrixNormalize.Rd 2013-07-10 14:46:48 UTC (rev 13) +++ pkg/man/RVineMatrixNormalize.Rd 2013-07-11 12:44:20 UTC (rev 14) @@ -19,12 +19,6 @@ } \examples{ -corMat <- matrix(c(1.00, 0.17, 0.15, 0.14, 0.13, - 0.17, 1.00, 0.30, 0.28, 0.05, - 0.15, 0.30, 1.00, 0.17, 0.05, - 0.14, 0.28, 0.17, 1.00, 0.04, - 0.13, 0.05, 0.05, 0.04, 1.00),5,5) - Matrix = matrix(c(5,2,3,1,4, 0,2,3,4,1, 0,0,3,4,1, From noreply at r-forge.r-project.org Thu Jul 11 15:00:22 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 11 Jul 2013 15:00:22 +0200 (CEST) Subject: [Vinecopula-commits] r15 - www Message-ID: <20130711130022.A36D61856B9@r-forge.r-project.org> Author: ulf Date: 2013-07-11 15:00:22 +0200 (Thu, 11 Jul 2013) New Revision: 15 Modified: www/index.php Log: Webauftritt verbessert Modified: www/index.php =================================================================== --- www/index.php 2013-07-11 12:44:20 UTC (rev 14) +++ www/index.php 2013-07-11 13:00:22 UTC (rev 15) @@ -43,7 +43,18 @@ -

The research underlying this project can be found at vine-copula.org

+

The research underlying this project can be found at >vine-copula.org
+The page provides an extensive overview of research on vine copula models including +

    +
  • Slides of Introductory talks given at conferences and workshops
  • +
  • Videos of talks given at conferences and workshops
  • +
  • Books and Surveys
  • +
  • Fundamental Papers giving the theoretical basics and fundamental approaches
  • +
  • Workshops and Conferences
  • +
  • Recent Publications - Publications, submissions, recent developments and preprints in the last years
  • +
  • Software R-packages, including this one, and other software
  • +
+

The project summary page you can find here.