lnam: Fit a Linear Network Autocorrelation Model

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/models.R

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.

Usage

1
2
3
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.

W2

one or more (possibly valued) graphs on the elements of 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".

method

method to be used with optim.

control

optional control parameters for optim.

tol

convergence tolerance for the MLE (expressed as change in deviance).

Details

lnam fits the linear network autocorrelation model given by

y = W1 %*% y + X %*% beta + e, e = W2 %*% e + nu

where y is a vector of responses, X is a covariate matrix, nu ~ Norm(0,sigma^2),

W1 = sum( rho1_i W1_i, i=1..p), W2 = sum( rho2_i W2_i, i=1..q),

and W1_i, W2_i are (possibly valued) adjacency matrices.

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.

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:

  1. meanstd: mean and standard deviation estimated (default).

  2. mean: mean estimated; standard deviation assumed equal to 1.

  3. std: standard deviation estimated; mean assumed equal to 0.

  4. none: no parameters estimated; data assumed to be drawn from a standard normal density.

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.)

Value

An object of class "lnam" containing the following elements:

y

the response vector used.

x

if supplied, the coefficient matrix.

W1

if supplied, the W1 array.

W2

if supplied, the W2 array.

model

a code indicating the model terms fit.

infomat

the estimated Fisher information matrix for the fitted model.

acvm

the estimated asymptotic covariance matrix for the model parameters.

null.model

a string indicating the null model fit.

lnlik.null

the log-likelihood of y under the null model.

df.null.resid

the residual degrees of freedom under the null model.

df.null

the model degrees of freedom under the null model.

null.param

parameter estimates for the null model.

lnlik.model

the log-likelihood of y under the fitted model.

df.model

the model degrees of freedom.

df.residual

the residual degrees of freedom.

df.total

the total degrees of freedom.

rho1

if applicable, the MLE for rho1.

rho1.se

if applicable, the asymptotic standard error for rho1.

rho2

if applicable, the MLE for rho2.

rho2.se

if applicable, the asymptotic standard error for rho2.

sigma

the MLE for sigma.

sigma.se

the standard error for sigma

beta

if applicable, the MLE for beta.

beta.se

if applicable, the asymptotic standard errors for beta.

fitted.values

the fitted mean values.

residuals

the residuals (response minus fitted); note that these correspond to e-hat in the model equation, not nu-hat.

disturbances

the estimated disturbances, i.e., nu-hat.

call

the matched call.

Note

Actual optimization is performed by calls to optim. Information on algorithms and control parameters can be found via the appropriate man pages.

Author(s)

Carter T. Butts [email protected]

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
#Construct a simple, random example:
w1<-rgraph(100)               #Draw the AR matrix
w2<-rgraph(100)               #Draw the MA matrix
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:
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

#Now, fit the autocorrelation model:
fit<-lnam(y,x,w1,w2)
summary(fit)
plot(fit)

## End(Not run)

Example output

Loading required package: statnet.common
Loading required package: network
network: Classes for Relational Data
Version 1.13.0 created on 2015-08-31.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
                    Mark S. Handcock, University of California -- Los Angeles
                    David R. Hunter, Penn State University
                    Martina Morris, University of Washington
                    Skye Bender-deMoll, University of Washington
 For citation information, type citation("network").
 Type help("network-package") to get started.

sna: Tools for Social Network Analysis
Version 2.4 created on 2016-07-23.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
 For citation information, type citation("sna").
 Type help(package="sna") to get started.

Loading required namespace: numDeriv

Call:
lnam(y = y, x = x, W1 = w1, W2 = w2)

Residuals:
     Min       1Q   Median       3Q      Max 
-0.74745 -0.21060  0.01533  0.17953  0.70902 

Coefficients:
         Estimate Std. Error  Z value Pr(>|z|)    
X1     -0.3404143  0.0079307  -42.924  < 2e-16 ***
X2     -0.6081271  0.0087983  -69.118  < 2e-16 ***
X3     -1.8080255  0.0094922 -190.476  < 2e-16 ***
X4      0.0552872  0.0076382    7.238 4.55e-13 ***
X5     -0.5242264  0.0104786  -50.028  < 2e-16 ***
rho1.1  0.2003312  0.0008426  237.754  < 2e-16 ***
rho2.1  0.0972474  0.0194177    5.008 5.49e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

      Estimate Std. Error
Sigma   0.1024          0

Goodness-of-Fit:
	Residual standard error: 0.2933 on 93 degrees of freedom (w/o Sigma)
	Multiple R-Squared: 0.9897, Adjusted R-Squared: 0.989
	Model log likelihood: 104.4 on 92 degrees of freedom (w/Sigma)
	AIC: -192.8 BIC: -172 

	Null model: meanstd 
	Null log likelihood: -240.6 on 98 degrees of freedom
	AIC: 485.2 BIC: 490.4 
	AIC difference (model versus null): 678 
	Heuristic Log Bayes Factor (model versus null):  662.4 

sna documentation built on May 30, 2017, 12:18 a.m.

Related to lnam in sna...