Last chance! 50% off unlimited learning
Sale ends in
nacf
computes the sample network covariance/correlation function for a specified variable on a given input network. Moran's
nacf(net, y, lag.max = NULL, type = c("correlation", "covariance",
"moran", "geary"), neighborhood.type = c("in", "out", "total"),
partial.neighborhood = TRUE, mode = "digraph", diag = FALSE,
thresh = 0, demean = TRUE)
A vector containing the dependence statistics (ascending from order 0).
one or more graphs.
a numerical vector, of length equal to the order of net
.
optionally, the maximum geodesic lag at which to compute dependence (defaults to order net
-1).
the type of dependence statistic to be computed.
the type of neighborhood to be employed when assessing dependence (as per neighborhood
).
logical; should partial (rather than cumulative) neighborhoods be employed at higher orders?
"digraph"
for directed graphs, or "graph"
if net
is undirected.
logical; does the diagonal of net
contain valid data?
threshold at which to dichotomize net
.
logical; demean y
prior to analysis?
Carter T. Butts buttsc@uci.edu
nacf
computes dependence statistics for the vector y
on network net
, for neighborhoods of various orders. Specifically, let net
. The sample network autocovariance of
The adjacency matrix associated with the nacf
, these neighborhoods are calculated using neighborhood
, with the specified parameters (including dichotomization at thresh
).
The return value for nacf
is the selected dependence statistic, calculated for each neighborhood structure from order 0 (the identity) through order lag.max
(or lag.max==NULL
). This vector can be used much like the conventional autocorrelation function, to identify dependencies at various lags. This may, in turn, suggest a starting point for modeling via routines such as lnam
.
Geary, R.C. (1954). “The Contiguity Ratio and Statistical Mapping.” The Incorporated Statistician, 5: 115-145.
Moran, P.A.P. (1950). “Notes on Continuous Stochastic Phenomena.” Biometrika, 37: 17-23.
geodist
, gapply
, neighborhood
, lnam
, acf
#Create a random graph, and an autocorrelated variable
g<-rgraph(50,tp=4/49)
y<-qr.solve(diag(50)-0.8*g,rnorm(50,0,0.05))
#Examine the network autocorrelation function
nacf(g,y) #Partial neighborhoods
nacf(g,y,partial.neighborhood=FALSE) #Cumulative neighborhoods
#Repeat, using Moran's I on the underlying graph
nacf(g,y,type="moran")
nacf(g,y,partial.neighborhood=FALSE,type="moran")
Run the code above in your browser using DataLab