lnam(sna)
lnam()所属R语言包:sna
Fit a Linear Network Autocorrelation Model
装一个线性网络自相关模型
译者:生物统计家园网 机器人LoveR
描述----------Description----------
lnam is used to fit linear network autocorrelation models. These include standard OLS as a special case, although lm is to be preferred for such analyses.
lnam线性网络自相关模型来拟合。这些措施包括标准的OLS作为一个特殊的情况下,虽然lm这样的分析是首选。
用法----------Usage----------
lnam(y, x = NULL, W1 = NULL, W2 = NULL, theta.seed = NULL,
null.model = c("meanstd", "mean", "std", "none"), method = "BFGS",
control = list(), tol=1e-10)
参数----------Arguments----------
参数:y
a vector of responses.
一个向量的响应。
参数:x
a vector or matrix of covariates; if the latter, each column should contain a single covariate.
一个向量或矩阵的协变量,如果是后者,每列包含一个单一的协变量。
参数:W1
one or more (possibly valued) graphs on the elements of y.
一个或多个(可能值)图表元素y。
参数:W2
one or more (possibly valued) graphs on the elements of y.
一个或多个(可能值)图表元素y。
参数:theta.seed
an optional seed value for the parameter vector estimation process.
一个可选的种子值的参数向量的估计处理。
参数:null.model
the null model to be fit; must be one of "meanstd", "mean", "std", or "none".
必须是一个空模型是合适的;的"meanstd","mean","std"或"none"。
参数:method
method to be used with optim.
的方法,可以使用与optim。
参数:control
optional control parameters for optim.
可选的控制参数为optim。
参数:tol
convergence tolerance for the MLE (expressed as change in deviance).
收敛误差极大似然估计的(表示变化偏差)。
Details
详细信息----------Details----------
lnam fits the linear network autocorrelation model given by
lnam符合线性网络自相关模型
y = W1 %*% y + X %*% beta + e, e = W2 %*% e + nu</i>
Y = W1%*%Y + X%*%β+ E,E = W2%*%E + NU </ I>
where y is a vector of responses, X is a covariate matrix, nu ~ Norm(0,sigma^2),
y是一个向量的反应,X是协变量矩阵,nu ~ Norm(0,sigma^2),
W1 = sum( rho1_i W1_i, i=1..p), W2 = sum( rho2_i W2_i, i=1..q),</i>
W1 =的的总和(rho1_i W1_i,i = 1 .. P),W2 = SUM(rho2_i W2_i,i = 1 .. Q)</ I>
and W1_i, W2_i are (possibly valued) adjacency matrices.
和W1_i,W2_i(可能值)邻接矩阵。
Intuitively, rho1 is a vector of “AR”-like parameters (parameterizing the autoregression of each y value on its neighbors in the graphs of W1) while rho2 is a vector of “MA”-like parameters (parameterizing the autocorrelation of each disturbance in y on its neighbors in the graphs of W2). In general, the two models are distinct, and either or both effects may be selected by including the appropriate matrix arguments.
直观地说,rho1是一个向量,“AR”般的参数(参数自回归的每一个y对邻国的图形W1值),而rho2是一个向量的“MA”般的参数(每个干扰参数的自相关yW2)在图中的邻居。在一般情况下,这两个模型是不同的,并包括适当的矩阵参数的选择可以通过任一或两者的效果。
Model parameters are estimated by maximum likelihood, and asymptotic standard errors are provided as well; all of the above (and more) can be obtained by means of the appropriate print and summary methods. A plotting method is also provided, which supplies fit basic diagnostics for the estimated model. For purposes of comparison, fits may be evaluated against one of four null models:
通过最大似然估计模型参数,渐近标准误差以及上述所有(及以上)可以通过适当的print和summary方法。还提供了绘图方法的估计模型,它提供合适的基本诊断。为了比较的目的,配合可以评价对四个零模型之一:
<ol> meanstd: mean and standard deviation estimated (default).
<OL>meanstd:均值和标准差估计(默认)。
mean: mean estimated; standard deviation assumed equal to 1.
“mean:假设估计,标准差等于1。
std: standard deviation estimated; mean assumed equal to 0.
std:标准偏差估计;,意味着假设等于0。
none: no parameters estimated; data assumed to be drawn from a standard normal density. </ol>
none:没有参数估计,假设得出的数据,从一个标准的正常密度。 </ OL>
The default setting should be appropriate for the vast majority of cases, although the others may have use when fitting “pure” autoregressive models (e.g., without covariates). Although a major use of the lnam is in controlling for network autocorrelation within a regression context, the model is subtle and has a variety of uses. (See the references below for suggestions.)
默认设置应适用于绝大多数情况下,虽然其他人可能已经装修时使用的“纯”自回归模型(例如,没有协变量)。虽然使用的lnam的主要是在控制网络在回归中的自相关,该模型是微妙的,具有多种用途。 (请参阅下面的参考资料的建议。)
值----------Value----------
An object of class "lnam" containing the following elements:
对象的类"lnam"包含以下元素:
<table summary="R valueblock"> <tr valign="top"><td>y</td> <td> the response vector used.</td></tr> <tr valign="top"><td>x</td> <td> if supplied, the coefficient matrix.</td></tr> <tr valign="top"><td>W1</td> <td> if supplied, the W1 array.</td></tr> <tr valign="top"><td>W2</td> <td> if supplied, the W2 array.</td></tr> <tr valign="top"><td>model</td> <td> a code indicating the model terms fit.</td></tr> <tr valign="top"><td>infomat</td> <td> the estimated Fisher information matrix for the fitted model.</td></tr> <tr valign="top"><td>acvm</td> <td> the estimated asymptotic covariance matrix for the model parameters.</td></tr> <tr valign="top"><td>null.model</td> <td> a string indicating the null model fit.</td></tr> <tr valign="top"><td>lnlik.null</td> <td> the log-likelihood of y under the null model.</td></tr> <tr valign="top"><td>df.null.resid</td> <td> the residual degrees of freedom under the null model.</td></tr> <tr valign="top"><td>df.null</td> <td> the model degrees of freedom under the null model.</td></tr> <tr valign="top"><td>null.param</td> <td> parameter estimates for the null model.</td></tr> <tr valign="top"><td>lnlik.model</td> <td> the log-likelihood of y under the fitted model.</td></tr> <tr valign="top"><td>df.model</td> <td> the model degrees of freedom.</td></tr> <tr valign="top"><td>df.residual</td> <td> the residual degrees of freedom.</td></tr> <tr valign="top"><td>df.total</td> <td> the total degrees of freedom.</td></tr> <tr valign="top"><td>rho1</td> <td> if applicable, the MLE for rho1.</td></tr> <tr valign="top"><td>rho1.se</td> <td> if applicable, the asymptotic standard error for rho1.</td></tr> <tr valign="top"><td>rho2</td> <td> if applicable, the MLE for rho2.</td></tr> <tr valign="top"><td>rho2.se</td> <td> if applicable, the asymptotic standard error for rho2.</td></tr> <tr valign="top"><td>sigma</td> <td> the MLE for sigma.</td></tr> <tr valign="top"><td>sigma.se</td> <td> the standard error for sigma</td></tr> <tr valign="top"><td>beta</td> <td> if applicable, the MLE for beta.</td></tr> <tr valign="top"><td>beta.se</td> <td> if applicable, the asymptotic standard errors for beta.</td></tr> <tr valign="top"><td>fitted.values</td> <td> the fitted mean values.</td></tr> <tr valign="top"><td>residuals</td> <td> the residuals (response minus fitted); note that these correspond to e-hat in the model equation, not nu-hat.</td></tr> <tr valign="top"><td>disturbances</td> <td> the estimated disturbances, i.e., nu-hat.</td></tr> <tr valign="top"><td>call</td> <td> the matched call.</td></tr> </table>
<table summary="R valueblock"> <tr valign="top"> <TD> y</ TD> <TD>的响应向量使用。</ TD> </ TR> <TR VALIGN =“顶“<TD> x </ TD> <TD>如果提供的系数矩阵。</ TD> </ TR> <tr valign="top"> <TD>W1 / TD> <TD>如果提供的话,的W1阵列。</ TD> </ TR> <tr valign="top"> <TD>W2 </ TD> <TD>如果提供的话,W2阵列</ TD> </ TR> <tr valign="top"> <TD>model </ TD> <td>一个代码,以显示模型项符合。</ TD> </ TR> <TR VALIGN =“”> <TD>infomat </ TD> <TD>估计的拟合模型的Fisher信息矩阵。</ TD> </ TR> <tr valign="top"> <TD> acvm</ TD> <TD>的模型参数估计的渐近协方差矩阵。</ TD> </ TR> <tr valign="top"> <TD> null.model</ TD> <td>一个字符串,表示空模型拟合。</ TD> </ TR> <tr valign="top"> <TD>lnlik.null </ TD> <TD>的log - y的可能性下空模型。</ TD> </ TR> <tr valign="top"> <TD>df.null.resid </ TD> <TD>的剩余自由度下的空模型。</ TD> </ TR> <tr valign="top"> <TD> df.null</ TD> <TD>模型空模式下的自由程度。</ TD> </ TR> <TR VALIGN =“顶” > <TD> null.param </ TD> <TD>空模型的参数估计值。</ TD> </ TR> <tr valign="top"> <TD>lnlik.model</ TD > <TD> y的拟合模型下的对数似然。</ TD> </ TR> <tr valign="top"> <TD>df.model </ TD> <TD>模型的度自由。</ TD> </ TR> <tr valign="top"> <TD>df.residual </ TD> <TD>的剩余自由度。</ TD> </ TR> <TR VALIGN =“”> <TD>df.total </ TD> <TD>的总自由度。</ TD> </ TR> <tr valign="top"> <TD>rho1 </ TD> <TD>如果适用的话,最大似然估计的RHO1。</ TD> </ TR> <tr valign="top"> <TD>rho1.se</ TD> <TD>(如适用), </ TD>渐近标准误差RHO1。</ TR> <tr valign="top"> <TD> rho2</ TD> <TD>(如果适用)的MLE为RHO2。</ TD> < / TR> <tr valign="top"> <TD> rho2.se </ TD> <TD>(如适用)的渐近标准误差为RHO2。</ TD> </ TR> <TR VALIGN =“顶部“> <TD> sigma </ TD> <TD>的MLE为Sigma。</ TD> </ TR> <tr valign="top"> <TD> sigma.se </ TD>的标准误差为<TD> SIGMA </ TD> </ TR> <tr valign="top"> <TD> beta </ TD> <TD>(如适用)的极大似然估计的β</ TD > </ TR> <tr valign="top"> <TD> beta.se </ TD> <TD>(如适用)的渐近标准误差测试。</ TD> </ TR> <TR VALIGN = “顶”> <TD> fitted.values </ TD> <TD>装的平均值。</ TD> </ TR> <tr valign="top"> <TD>residuals</ TD> <TD>的残差(响应减的话);注意,这些对应于e-hat的模型方程,而不是nu-hat。</ TD> </ TR> <TR VALIGN =“顶” > <TD> disturbances </ TD> <TD>估计的干扰,即nu-hat。</ TD> </ TR> <tr valign="top"> <TD><X > </ TD> <TD>匹配的呼叫。</ TD> </ TR> </ TABLE>
注意----------Note----------
Actual optimization is performed by calls to optim. Information on algorithms and control parameters can be found via the appropriate man pages.
实际的优化是通过调用optim。算法和控制参数的信息可以通过相应的手册页。
(作者)----------Author(s)----------
Carter T. Butts <a href="mailto:buttsc@uci.edu">buttsc@uci.edu</a>
参考文献----------References----------
Leenders, T.Th.A.J. (2002) “Modeling Social Influence Through Network Autocorrelation: Constructing the Weight Matrix” Social Networks, 24(1), 21-47.
Anselin, L. (1988) Spatial Econometrics: Methods and Models. Norwell, MA: Kluwer.
参见----------See Also----------
lm, optim
lm,optim
实例----------Examples----------
## Not run: [#不运行:]
#Construct a simple, random example:[构造一个简单的,随便举个例子:]
w1<-rgraph(100) #Draw the AR matrix[绘制AR矩阵]
w2<-rgraph(100) #Draw the MA matrix[绘制MA矩阵]
x<-matrix(rnorm(100*5),100,5) #Draw some covariates[绘制一些协变量]
r1<-0.2 #Set the model parameters[设置的模型参数]
r2<-0.1
sigma<-0.1
beta<-rnorm(5)
#Assemble y from its components:[组装y从它的成分:]
nu<-rnorm(100,0,sigma) #Draw the disturbances[绘制的骚乱]
e<-qr.solve(diag(100)-r2*w2,nu) #Draw the effective errors[绘制有效的错误]
y<-qr.solve(diag(100)-r1*w1,x%*%beta+e) #Compute y[计算y]
#Now, fit the autocorrelation model:[现在,适合自相关模型:]
fit<-lnam(y,x,w1,w2)
summary(fit)
plot(fit)
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|