View source: R/corbit_plot_edit.r
corbit_plot | R Documentation |
Plots the GNAR network autcorrelation funciton for a choice of maximum lag and maximum r-stage depth in the network. Using the nacf
function for network autocorrelation and pnacf
for partial network autocorrelation.
corbit_plot(vts, net, max_lag, max_stage, weight_matrix,
viridis_color_option="viridis", size_option="absolute_val",
partial="no", r_corbit="no", line_segment="no", rectangular_plot="no")
vts |
Vector time series observations for which one wishes to plot the network autocorrelation or partial network autocorrelation. |
net |
GNAR network object linked to the time series under study. |
max_lag |
Maximum lag the Corbit plot produces (i.e., number of time-steps considered for the network autocorrelaiton.) |
max_stage |
Maximum r-stage depth considered for the Corbit plot (i.e., the number of rings in the plot). Corresponds to the length of paths in the underlying network. |
weight_matrix |
A matrix which entries correspond to the weights between nodes. If this term is NULL, then this argument is equal weights between r-stage neighbours. |
viridis_color_option |
Colour scale for the Corbit plot. The default option is |
size_option |
Point size scale for the Corbit plot. The default is the absolute value of the network autocorrelation function (i.e., |
partial |
Option for selecting between computing the network autocorrelation function or the partial network autocorrelation funciton. Default choice is network autocorrelation (i.e., partial="no"), change argument to "yes" for computing the partial network autocorrelation funciton. |
r_corbit |
Choice for distinguishing between Corbit and R-Corbit plots, default is set to Corbit (inner function call). For producing R-Corbit plots one should use |
line_segment |
Default is set to no (i.e., |
rectangular_plot |
Option for producing alternative rectangular plots. Default is set to no (i.e., |
This function computes network autocorrelation or partial network autocorrelation function values for a specific choice of maximum lag and r-stage depth, and produces the corresponing Corbit plot. Each point in a Corbit plot corresponds to the (P)NACF value, i.e., (p)nacf(h, r)
, at a h-lag and r-stage pair. The ring number starting from the inside corresponds to r-stage depth (path length), and the numbers on the outside ring indicate time lag. The colour scale is based on the overall network autocorrelation values (i.e., the colour is set to highlight strong correlations). The dot at the centre has (p)nacf(h, r)=0
and the smallest size for aiding comparison. Please see the RMarkdown document mentioned in GNAR
references for plot examples.
Produces the specified, i.e, NACF or PNACF for a choice of lag and r
-stage depth, (h, r)
, Corbit plot. Does not print (P)NACF values, these are stored as an invisble data frame (matrix), and can be accessed by printing or calling the object produced by the corbit_plot
call.
Daniel Salnikov and Guy Nason.
Nason, G.P., Salnikov, D. and Cortina-Borja, M. (2023) New tools for network time series with an application to COVID-19 hospitalisations. https://arxiv.org/abs/2312.00530
#
# Simulate 100 observations from a stationary GNAR(2, [2, 1]), where
# fiveNet is the underlying network.
#
gnar_simulation <- GNARsim(n = 100, net=fiveNet, alphaParams = list(rep(0.25, 5), rep(0.12, 5)),
betaParams = list(c(0.25, 0.13), c(0.20)), sigma=1)
# We produce the corresponding Corbit plots.
corbit_plot(gnar_simulation, fiveNet, 20, 3)
corbit_plot(gnar_simulation, fiveNet, 20, 3, partial = "yes")
# If the network object comes with its own weights, then these can be added by including
# the option weight_matrix in the corbit call.
# corbit_plot(vts, net, max_lag, max_stage, weight_matrix = object_weights_matrix)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.