space.joint(space)
space.joint()所属R语言包:space
A function to estimate partial correlations using the Joint Sparse Regression Model
使用的联合稀疏回归模型的估计偏相关的功能
译者:生物统计家园网 机器人LoveR
描述----------Description----------
A function to estimate partial correlations using the Joint Sparse Regression Model
使用的联合稀疏回归模型的估计偏相关的功能
用法----------Usage----------
space.joint(Y.m, lam1, lam2=0, sig=NULL, weight=NULL,iter=2)
参数----------Arguments----------
参数:Y.m
numeric matrix. Columns are for variables and rows are for samples. Missing values are not allowed. It's recommended to first standardize each column to have mean 0 and l_2 norm 1.
数字矩阵。列变量和样品的行。遗漏值是不允许的。建议先规范每一列,均值为0,l_2规范1。
参数:lam1
numeric value. This is the l_1 norm penalty parameter. If the columns of Y.m have norm one, then the suggested range of lam1 is: O(n^{3/2}\Phi^{-1}(1-\alpha/(2p^2))) for small \alpha such as 0.1.
数值。这是l_1规范刑罚参数。如果Ym的列范数1,然后是所建议的范围内lam1:O(n^{3/2}\Phi^{-1}(1-\alpha/(2p^2)))小\alpha(如0.1)。
参数:lam2
numeric value. If not specified, lasso regression is used in the Joint Sparse Regression Model (JSRM). Otherwise, elastic net regression is used in JSRM and <VAR>lam2</VAR> serves as the l_2 norm penalty parameter.
数值。如果没有指定,使用套索回归的的联合稀疏回归模型(JSRM)。否则,弹性网回归,使用在JSRM和<VAR> lam2 </ VAR>,作为l_2规范刑罚参数。
参数:sig
numeric vector. Its length should be the same as the number of columns of Y.m. It is the vector of \sigma^{ii} (the diagonal of the inverse covariance matrix). If not specified, \sigma^{ii} will be estimated during the model fitting with initial values <VAR>rep(1,p)</VAR>. The number of the iteration of the model fitting (<VAR>iter</VAR>) will then be at least 2. Note, the scale of <VAR>sig</VAR> does not matter.
数字矢量。其长度应该是相同作为Y.m的列数。它是矢量\sigma^{ii}(逆协方差矩阵的对角线)。如果未指定,\sigma^{ii}会被估计在模型的拟合的初始值<VAR>的代表(1,P)</ VAR>。迭代的数目的模型拟合(<VAR>迭代</ VAR>)然后将至少有2个。请注意,规模<VAR>信号</ VAR>不无关紧要。
参数:weight
numeric value or vector. It specifies the weights or the type of weights used for each regression in JSRM. The default value is NULL, which means all regressions will be weighted equally in the joint model. If <VAR>weight</VAR>=1, residue variances will be used for weights. If <VAR>weight</VAR>=2, the estimated degree of each variable will be used for weights. Otherwise, it should be a positive numeric vector, whose length is equal to the number of columns of <VAR>Y.m</VAR>.
数值或向量。它指定的权重或用于每个在JSRM回归的类型的权重。默认值是NULL,这意味着所有的回归将在联合模型进行加权平均。如果<VAR>重量</ VAR>=1,残留的差异将用于重量。如果<VAR>重量</ VAR>=2,每个变量的估计程度将用于重量。否则,它应该是一个正的数值向量,其长度等于<VAR> Ym的列的数目</ VAR>。
参数:iter
integer. It is the total number of interactions in JSRM for estimating \sigma^{ii} and partial correlations. When <VAR>sig</VAR>=NULL and/or <VAR>weight</VAR>=NULL or 2, <VAR>iter</VAR> should be at least 2.
整数。是总估算\sigma^{ii}和部分相关数相互作用JSRM。当<VAR>信号</ VAR>“=NULL和/或<VAR>重量</ VAR>=NULL或2,<VAR>国际热核实验堆</ VAR>至少应为2。
Details
详细信息----------Details----------
space.joint uses a computationally efficient approach for selecting
space.joint采用了高效的计算方法选择
值----------Value----------
A list with two components <table summary="R valueblock"> <tr valign="top"><td>ParCor</td> <td> the estimated partial correlation matrix.</td></tr> <tr valign="top"><td>sig.fit</td> <td> numeric vector of the estimated diagonal \sigma^{ii}.</td></tr> </table>
两部分组成的列表<table summary="R valueblock"> <tr valign="top"> <TD> ParCor</ TD> <TD>部分相关矩阵的估计。</ TD> </ TR > <tr valign="top"> <TD> sig.fit </ TD> <TD>数字向量估计对角线\sigma^{ii}。</ TD> </ TR> </表>
(作者)----------Author(s)----------
J. Peng, P. Wang, Nengfeng Zhou, Ji Zhu
参考文献----------References----------
J. Peng, P. Wang, N. Zhou, J. Zhu (2007). Partial Correlation Estimation by Joint Sparse Regression Model.
Meinshausen, N., and Buhlmann, P. (2006), High Dimensional Graphs and Variable Selection with the Lasso, Annals of Statistics, 34, 1436-1462.
实例----------Examples----------
#############################################################################################[################################################## ##########################################]
############################ (A) The simulated Hub.net example in Peng et. al. (2007).[###########################(A)的模拟Hub.net Peng等例如在。人。 (2007年)。]
#############################################################################################[################################################## ##########################################]
data(spaceSimu)
n=nrow(spaceSimu$Y.data)
p=ncol(spaceSimu$Y.data)
true.adj=abs(spaceSimu$ParCor.true)>1e-6
#################### view the network corresponding to the parcial correlation matrix in the simulation example[###################查看网络对应的parcial相关矩阵中的仿真例子]
########### the following code can run only if the "igraph" is installed in the system.[##########下面的代码可以仅当“的igraph”被安装在系统中运行。]
#library(igraph)[库(IGRAPH)]
#plot.adj=true.adj[plot.adj = true.adj]
#diag(plot.adj)=0[诊断(plot.adj)= 0]
#temp=graph.adjacency(adjmatrix=plot.adj, mode="undirected")[温度= graph.adjacency(adjmatrix = plot.adj,模式=“无方向”)]
#temp.degree=apply(plot.adj, 2, sum)[temp.degree应用(plot.adj,2,总和)]
#V(temp)$color=(temp.degree>9)+3[V(临时)颜色=(temp.degree 9)+3]
#plot(temp, vertex.size=3, vertex.frame.color="white",layout=layout.fruchterman.reingold, vertex.label=NA, edge.color=grey(0.5))[图(温度,vertex.size 3,vertex.frame.color =“白”,布局= layout.fruchterman.reingold,vertex.label = NA,edge.color =灰色(0.5))]
#################### estimate the parcial correlation matrix with various methods[###################估计的parcial的相关矩阵的各种方法]
alpha=1
l1=1/sqrt(n)*qnorm(1-alpha/(2*p^2))
iter=3
########### the values of lam1 were selected to make the results of different methods comparable. [##########的值lam1被选择到的结果不同的方法可比。]
#### 1. MB method[###1。 MB方法]
result1=space.neighbor(spaceSimu$Y.data, lam1=l1*0.7, lam2=0)
fit.adj=abs(result1$ParCor)>1e-6
sum(fit.adj==1)/2 ##total number of edges detected [#总数检测到的边缘]
sum(fit.adj[true.adj==1]==1)/2 ##total number of true edges detected [#总数真正的边缘检测]
#### 2. Joint method with no weight[###2。没有重量的联合方法]
result2=space.joint(spaceSimu$Y.data, lam1=l1*n*1.56, lam2=0, iter=iter)
fit.adj=abs(result2$ParCor)>1e-6
sum(fit.adj==1)/2 ##total number of edges detected [#总数检测到的边缘]
sum(fit.adj[true.adj==1]==1)/2 ##total number of true edges detected [#总数真正的边缘检测]
#### 3. Joint method with residue variance based weights[###3。联合残留方差方法与基于权重]
result3=space.joint(spaceSimu$Y.data, lam1=l1*n*1.86, lam2=0, weight=1, iter=iter)
fit.adj=abs(result3$ParCor)>1e-6
sum(fit.adj==1)/2 ##total number of edges detected [#总数检测到的边缘]
sum(fit.adj[true.adj==1]==1)/2 ##total number of true edges detected [#总数真正的边缘检测]
#### 4. Joint method with degree based weights[###4。联合程度的权重的方法]
result4=space.joint(spaceSimu$Y.data, lam1=l1*n*1.61, lam2=0, weight=2, iter=iter)
fit.adj=abs(result4$ParCor)>1e-6
sum(fit.adj==1)/2 ##total number of edges detected [#总数检测到的边缘]
sum(fit.adj[true.adj==1]==1)/2 ##total number of true edges detected [#总数真正的边缘检测]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|