Commit 20ba57e5 authored by Armin Rauschenberger's avatar Armin Rauschenberger

competing models

parent 476709d4
This diff is collapsed.
......@@ -158,95 +158,13 @@
<div class="sourceCode" id="cb11"><html><body><pre class="r"><span class="fu"><a href="../reference/cv.joinet.html">cv.joinet</a></span>(<span class="kw">Y</span><span class="kw">=</span><span class="no">Y</span>,<span class="kw">X</span><span class="kw">=</span><span class="no">X</span>,<span class="kw">family</span><span class="kw">=</span><span class="no">family</span>)</pre></body></html></div>
<pre><code>## [,1] [,2]
## base 1.204741 1.523550
## meta 1.161487 1.283678
## meta 1.185200 1.278125
## none 3.206394 3.495571</code></pre>
</div>
<div id="reference" class="section level2">
<h2 class="hasAnchor">
<a href="#reference" class="anchor"></a>Reference</h2>
<p>Armin Rauschenberger and Enrico Glaab (2020). “joinet: predicting correlated outcomes jointly to improve clinical prognosis”. <em>Manuscript in preparation.</em></p>
<!--
```r
#install.packages("MTPS")
data("HIV",package="MTPS")
loss1 <- cv.joinet(Y=YY,X=XX,mnorm=TRUE,spls=TRUE,mtps=TRUE)
#install.packages("spls")
data(yeast,package="spls")
loss2 <- cv.joinet(Y=yeast$y,X=yeast$x,mnorm=TRUE,spls=TRUE,mtps=TRUE)
data(mice,package="spls")
loss3 <- cv.joinet(Y=mice$y,X=mice$x,mnorm=TRUE,spls=TRUE,mtps=TRUE)
# install.packages("MRCE")
data(stock04,package="MRCE",verbose=TRUE)
# otherwise simulated
#install.packages("SiER")
# simulated!
library(MASS)
total.noise <- 0.1
rho <- 0.3
rho.e <- 0.2
nvar=500
nvarq <- 3
sigma2 <- total.noise/nvarq
sigmaX=0.1
nvar.eff=150
Sigma=matrix(0,nvar.eff,nvar.eff)
for(i in 1:nvar.eff){
for(j in 1:nvar.eff){
Sigma[i,j]=rho^(abs(i-j))
}
}
Sigma2.y <- matrix(sigma2*rho.e,nvarq, nvarq)
diag(Sigma2.y) <- sigma2
betas.true <- matrix(0, nvar, 3)
betas.true[1:15,1]=rep(1,15)/sqrt(15)
betas.true[16:45,2]=rep(0.5,30)/sqrt(30)
betas.true[46:105,3]=rep(0.25,60)/sqrt(60)
ntest <- 500
ntrain <- 90
ntot <- ntest+ntrain
X <- matrix(0,ntot,nvar)
X[,1:nvar.eff] <- mvrnorm(n=ntot, rep(0, nvar.eff), Sigma)
X[,-(1:nvar.eff)] <- matrix(sigmaX*rnorm((nvar-nvar.eff)*dim(X)[1]),
dim(X)[1],(nvar-nvar.eff))
Y <- X%*%betas.true
Y <- Y+mvrnorm(n=ntot, rep(0,nvarq), Sigma2.y)
fold <- rep(c(0,1),times=c(ntrain,ntest))
loss4 <- cv.joinet(Y=Y,X=X,foldid.ext=fold,mnorm=TRUE,spls=TRUE,mtps=TRUE)
#install.pacakges("GPM")
# simulated!
#install.packages("RMTL")
# simulated!
data <- RMTL::Create_simulated_data(Regularization="L21", #type="Regression")
#Y <- (do.call(what="cbind",args=data$Y)+1)/2
#X <- data$X[[1]] # example
#loss2 <- cv.joinet(Y=Y,X=X,mnorm=TRUE,spls=TRUE,mtps=TRUE)
```
-->
<!--
```r
#install.packages("plsgenomics")
data(Ecoli,package="plsgenomics")
X <- Ecoli$CONNECdata
Y <- Ecoli$GEdata
loss2 <- cv.joinet(Y=Y,X=X,mnorm=TRUE,mtps=TRUE)
#install.packages("BiocManager")
#BiocManager::install("mixOmics")
data(liver.toxicity,package="mixOmics")
X <- as.matrix(liver.toxicity$gene)
Y <- as.matrix(liver.toxicity$clinic)
Y[,"Cholesterol.mg.dL."] <- -Y[,"Cholesterol.mg.dL."]
loss3 <- cv.joinet(Y=Y,X=X,mnorm=TRUE,mtps=TRUE)
```
-->
</div>
</div>
......
......@@ -4,5 +4,5 @@ pkgdown_sha: ~
articles:
article: article.html
joinet: joinet.html
last_built: 2020-06-08T15:55Z
last_built: 2020-06-29T15:24Z
......@@ -140,6 +140,7 @@
<span class='kw'>compare</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>mice</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>cvpred</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>times</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='no'>...</span>
)</pre>
......
......@@ -134,7 +134,7 @@
<span class='kw'>foldid</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>type.measure</span> <span class='kw'>=</span> <span class='st'>"deviance"</span>,
<span class='kw'>alpha.base</span> <span class='kw'>=</span> <span class='fl'>1</span>,
<span class='kw'>alpha.meta</span> <span class='kw'>=</span> <span class='fl'>0</span>,
<span class='kw'>alpha.meta</span> <span class='kw'>=</span> <span class='fl'>1</span>,
<span class='no'>...</span>
)</pre>
......
......@@ -219,56 +219,56 @@ with \(n\) rows (samples) and \(q\) columns (variables).</p>
#&gt;
#&gt; $meta
#&gt; [,1] [,2] [,3]
#&gt; [1,] 0.120026857 -2.63552370 -2.58637745
#&gt; [2,] 0.311517089 -1.57742790 -1.80530334
#&gt; [3,] 0.970038575 2.83530787 2.50770389
#&gt; [4,] 0.988790465 3.94203727 3.41749124
#&gt; [5,] 0.702397389 0.20191699 -0.07301232
#&gt; [6,] 0.069874337 -3.01383050 -2.75113316
#&gt; [7,] 0.178293600 -1.79055373 -1.33607264
#&gt; [8,] 0.994417547 4.65204823 4.42063500
#&gt; [9,] 0.825454272 0.92712611 0.33068070
#&gt; [10,] 0.122295626 -2.58218395 -2.83894610
#&gt; [11,] 0.992972765 4.45732386 4.34260769
#&gt; [12,] 0.315048704 -0.99259865 -0.55695917
#&gt; [13,] 0.006376865 -5.52584767 -5.43421552
#&gt; [14,] 0.604946394 0.15758601 0.59296195
#&gt; [15,] 0.356113893 -0.95306415 -0.75195663
#&gt; [16,] 0.496057561 -0.75220207 -1.26978360
#&gt; [17,] 0.320794509 -1.10958000 -1.05497247
#&gt; [18,] 0.804808814 0.64766735 0.02552338
#&gt; [19,] 0.834600977 1.22772641 1.64662367
#&gt; [20,] 0.062637571 -3.37591257 -3.52530885
#&gt; [21,] 0.271715919 -1.32688363 -0.85251362
#&gt; [22,] 0.507637975 -0.60258988 -0.83624877
#&gt; [23,] 0.694579538 0.19562106 -0.51989858
#&gt; [24,] 0.406609311 -0.57645076 -0.18326513
#&gt; [25,] 0.012589218 -4.82289140 -4.55079851
#&gt; [26,] 0.935270035 2.28086412 2.23449684
#&gt; [27,] 0.143615352 -2.33101536 -2.18288391
#&gt; [28,] 0.971697981 2.86526752 2.61585773
#&gt; [29,] 0.013944811 -4.69966856 -4.55513448
#&gt; [30,] 0.015768781 -4.71928228 -4.44410746
#&gt; [31,] 0.891631228 1.50966480 1.39712353
#&gt; [32,] 0.853434630 1.11696980 0.44705866
#&gt; [33,] 0.772218415 0.74754148 0.52945800
#&gt; [34,] 0.480168883 -0.47818857 -0.27919160
#&gt; [35,] 0.030260125 -4.02999089 -3.72147791
#&gt; [36,] 0.946608961 2.36236767 2.06071075
#&gt; [37,] 0.131953701 -2.45489591 -2.16067825
#&gt; [38,] 0.142539577 -2.28403264 -1.85682897
#&gt; [39,] 0.985751175 3.60577123 2.96090103
#&gt; [40,] 0.863879903 1.29591149 0.94749069
#&gt; [41,] 0.204237405 -1.70922989 -1.59867884
#&gt; [42,] 0.852342486 1.15387209 0.99870566
#&gt; [43,] 0.559959816 -0.35427152 -0.43712903
#&gt; [44,] 0.170830538 -2.18882713 -1.81502079
#&gt; [45,] 0.639682562 -0.00439300 -0.15009278
#&gt; [46,] 0.934408843 2.02660474 1.83111336
#&gt; [47,] 0.358655524 -1.10381588 -0.90429501
#&gt; [48,] 0.070055480 -3.13250260 -3.05061558
#&gt; [49,] 0.681260321 0.05548031 -0.11998977
#&gt; [50,] 0.317122867 -1.19819266 -1.48472862
#&gt; [1,] 0.10220137 -2.8366810 -2.58549073
#&gt; [2,] 0.22806673 -1.8261107 -1.76560859
#&gt; [3,] 0.95484141 2.8130533 2.62981542
#&gt; [4,] 0.98730517 4.1550932 3.46554651
#&gt; [5,] 0.64845882 0.1406465 -0.04254334
#&gt; [6,] 0.08701080 -3.0352129 -2.82347419
#&gt; [7,] 0.24075871 -1.6987418 -1.38562725
#&gt; [8,] 0.99171832 4.7229217 4.59039026
#&gt; [9,] 0.82540857 1.0679076 0.27264687
#&gt; [10,] 0.13617019 -2.5849863 -2.95244727
#&gt; [11,] 0.98981676 4.5178102 4.52008410
#&gt; [12,] 0.41469313 -0.8318596 -0.60385413
#&gt; [13,] 0.01027685 -5.5214546 -5.64340291
#&gt; [14,] 0.64930175 0.2459392 0.62723142
#&gt; [15,] 0.41386111 -0.8637077 -0.78947614
#&gt; [16,] 0.45380923 -0.7919286 -1.31410010
#&gt; [17,] 0.40677141 -0.9432038 -1.14733110
#&gt; [18,] 0.75190956 0.6145579 0.02843515
#&gt; [19,] 0.80419429 1.1601342 1.79330367
#&gt; [20,] 0.06109382 -3.5090532 -3.60577442
#&gt; [21,] 0.29707148 -1.3498797 -0.83013621
#&gt; [22,] 0.47255039 -0.6514714 -0.84183516
#&gt; [23,] 0.72776624 0.4000683 -0.64909323
#&gt; [24,] 0.52225525 -0.3720559 -0.23537421
#&gt; [25,] 0.01722845 -4.8908178 -4.68018275
#&gt; [26,] 0.93788800 2.4494650 2.27769155
#&gt; [27,] 0.13861339 -2.4543910 -2.19278248
#&gt; [28,] 0.95152342 2.7650921 2.78092452
#&gt; [29,] 0.02171825 -4.6769505 -4.73129956
#&gt; [30,] 0.01570247 -4.9537324 -4.49632044
#&gt; [31,] 0.85305109 1.4396438 1.50410997
#&gt; [32,] 0.85232458 1.2707274 0.38427369
#&gt; [33,] 0.79166183 0.8978043 0.49722869
#&gt; [34,] 0.50644688 -0.4392424 -0.27447864
#&gt; [35,] 0.02911065 -4.2534806 -3.74533419
#&gt; [36,] 0.94251258 2.4986830 2.09603282
#&gt; [37,] 0.11040807 -2.6864056 -2.11437644
#&gt; [38,] 0.12885189 -2.4765109 -1.80685937
#&gt; [39,] 0.98204701 3.7581482 3.00880873
#&gt; [40,] 0.85949146 1.4074652 0.94281190
#&gt; [41,] 0.27978357 -1.5562501 -1.70556618
#&gt; [42,] 0.81267168 1.1047951 1.07696011
#&gt; [43,] 0.51433013 -0.4308933 -0.40489984
#&gt; [44,] 0.12318913 -2.5118215 -1.70952119
#&gt; [45,] 0.60957965 -0.0276023 -0.13221472
#&gt; [46,] 0.90379982 1.9552732 1.95275535
#&gt; [47,] 0.32662397 -1.2267246 -0.85622205
#&gt; [48,] 0.07567690 -3.2214496 -3.11672913
#&gt; [49,] 0.58299820 -0.1185430 -0.03693255
#&gt; [50,] 0.42367190 -0.9519434 -1.64962005
#&gt; </div><div class='input'>
</div></pre>
</div>
......
......@@ -159,10 +159,10 @@ in the row on the outcomes in the column.</p>
<span class='no'>Y</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>replicate</a></span>(<span class='kw'>n</span><span class='kw'>=</span><span class='no'>q</span>,<span class='kw'>expr</span><span class='kw'>=</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span>(<span class='kw'>n</span><span class='kw'>=</span><span class='no'>n</span>,<span class='kw'>mean</span><span class='kw'>=</span><span class='fu'><a href='https://rdrr.io/r/base/colSums.html'>rowSums</a></span>(<span class='no'>X</span>[,<span class='fl'>1</span>:<span class='fl'>5</span>])))
<span class='no'>object</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='joinet.html'>joinet</a></span>(<span class='kw'>Y</span><span class='kw'>=</span><span class='no'>Y</span>,<span class='kw'>X</span><span class='kw'>=</span><span class='no'>X</span>)
<span class='fu'><a href='https://rdrr.io/r/stats/weights.html'>weights</a></span>(<span class='no'>object</span>)</div><div class='output co'>#&gt; y1 y2 y3
#&gt; (Intercept) -0.02352901 -0.1279338 0.1990621
#&gt; V1 0.10704102 0.2456441 0.4650750
#&gt; V2 0.48427425 0.5331528 0.3894352
#&gt; V3 0.52435963 0.4199606 0.2731577</div><div class='input'>
#&gt; (Intercept) -0.04720442 -0.15165929 0.26901703
#&gt; V1 0.00000000 0.01158793 0.65726908
#&gt; V2 0.55230103 0.71134918 0.45932382
#&gt; V3 0.60228936 0.49505561 0.01764908</div><div class='input'>
</div></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
......
......@@ -18,6 +18,7 @@ cv.joinet(
compare = NULL,
mice = FALSE,
cvpred = FALSE,
times = FALSE,
...
)
}
......
......@@ -12,7 +12,7 @@ joinet(
foldid = NULL,
type.measure = "deviance",
alpha.base = 1,
alpha.meta = 0,
alpha.meta = 1,
...
)
}
......
......@@ -124,87 +124,3 @@ cv.joinet(Y=Y,X=X,family=family)
## Reference
Armin Rauschenberger and Enrico Glaab (2020). "joinet: predicting correlated outcomes jointly to improve clinical prognosis". *Manuscript in preparation.*
<!--
```{r,eval=FALSE}
#install.packages("MTPS")
data("HIV",package="MTPS")
loss1 <- cv.joinet(Y=YY,X=XX,mnorm=TRUE,spls=TRUE,mtps=TRUE)
#install.packages("spls")
data(yeast,package="spls")
loss2 <- cv.joinet(Y=yeast$y,X=yeast$x,mnorm=TRUE,spls=TRUE,mtps=TRUE)
data(mice,package="spls")
loss3 <- cv.joinet(Y=mice$y,X=mice$x,mnorm=TRUE,spls=TRUE,mtps=TRUE)
# install.packages("MRCE")
data(stock04,package="MRCE",verbose=TRUE)
# otherwise simulated
#install.packages("SiER")
# simulated!
library(MASS)
total.noise <- 0.1
rho <- 0.3
rho.e <- 0.2
nvar=500
nvarq <- 3
sigma2 <- total.noise/nvarq
sigmaX=0.1
nvar.eff=150
Sigma=matrix(0,nvar.eff,nvar.eff)
for(i in 1:nvar.eff){
for(j in 1:nvar.eff){
Sigma[i,j]=rho^(abs(i-j))
}
}
Sigma2.y <- matrix(sigma2*rho.e,nvarq, nvarq)
diag(Sigma2.y) <- sigma2
betas.true <- matrix(0, nvar, 3)
betas.true[1:15,1]=rep(1,15)/sqrt(15)
betas.true[16:45,2]=rep(0.5,30)/sqrt(30)
betas.true[46:105,3]=rep(0.25,60)/sqrt(60)
ntest <- 500
ntrain <- 90
ntot <- ntest+ntrain
X <- matrix(0,ntot,nvar)
X[,1:nvar.eff] <- mvrnorm(n=ntot, rep(0, nvar.eff), Sigma)
X[,-(1:nvar.eff)] <- matrix(sigmaX*rnorm((nvar-nvar.eff)*dim(X)[1]),
dim(X)[1],(nvar-nvar.eff))
Y <- X%*%betas.true
Y <- Y+mvrnorm(n=ntot, rep(0,nvarq), Sigma2.y)
fold <- rep(c(0,1),times=c(ntrain,ntest))
loss4 <- cv.joinet(Y=Y,X=X,foldid.ext=fold,mnorm=TRUE,spls=TRUE,mtps=TRUE)
#install.pacakges("GPM")
# simulated!
#install.packages("RMTL")
# simulated!
data <- RMTL::Create_simulated_data(Regularization="L21", #type="Regression")
#Y <- (do.call(what="cbind",args=data$Y)+1)/2
#X <- data$X[[1]] # example
#loss2 <- cv.joinet(Y=Y,X=X,mnorm=TRUE,spls=TRUE,mtps=TRUE)
```
-->
<!--
```{r,eval=FALSE}
#install.packages("plsgenomics")
data(Ecoli,package="plsgenomics")
X <- Ecoli$CONNECdata
Y <- Ecoli$GEdata
loss2 <- cv.joinet(Y=Y,X=X,mnorm=TRUE,mtps=TRUE)
#install.packages("BiocManager")
#BiocManager::install("mixOmics")
data(liver.toxicity,package="mixOmics")
X <- as.matrix(liver.toxicity$gene)
Y <- as.matrix(liver.toxicity$clinic)
Y[,"Cholesterol.mg.dL."] <- -Y[,"Cholesterol.mg.dL."]
loss3 <- cv.joinet(Y=Y,X=X,mnorm=TRUE,mtps=TRUE)
```
-->
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment