% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/measure_diffusion.R
\name{measure_diffusion_node}
\alias{measure_diffusion_node}
\alias{node_by_adopt_time}
\alias{node_by_adopt_threshold}
\alias{node_by_adopt_recovery}
\alias{node_by_adopt_exposure}
\title{Measures of nodes in a diffusion}
\usage{
node_by_adopt_time(.data)

node_by_adopt_threshold(.data, normalized = TRUE, lag = 1)

node_by_adopt_recovery(.data)

node_by_adopt_exposure(.data, mark, time = 0)
}
\arguments{
\item{.data}{A network object of class \code{mnet}, \code{igraph}, \code{tbl_graph}, \code{network}, or similar.
For more information on the standard coercion possible,
see \code{\link[manynet:as_tidygraph]{manynet::as_tidygraph()}}.}

\item{normalized}{Logical scalar, whether scores are normalized.
Different denominators may be used depending on the measure,
whether the object is one-mode or two-mode, and other arguments.
By default TRUE.}

\item{lag}{The number of time steps back upon which the thresholds are
inferred.}

\item{mark}{A valid 'node_mark' object or
logical vector (TRUE/FALSE) of length equal to
the number of nodes in the network.}

\item{time}{A time point until which infections/adoptions should be
identified. By default \code{time = 0}.}
}
\value{
A \code{node_measure} numeric vector the length of the nodes in the network,
providing the scores for each node.
If the network is labelled,
then the scores will be labelled with the nodes' names.
}
\description{
These functions allow measurement of various features of
a diffusion process:
\itemize{
\item \code{node_by_adopt_time()}: Measures the number of time steps until
nodes adopt/become infected
\item \code{node_by_adopt_threshold()}: Measures nodes' thresholds from the amount
of exposure they had when they became infected
\item \code{node_by_adopt_recovery()}: Measures the average length nodes that become
infected remain infected in a compartmental model with recovery
\item \code{node_by_adopt_exposure()}: Measures how many exposures nodes have to
a given mark
}
}
\section{Adoption time}{

\code{node_by_adopt_time()} measures the time units it took
until each node became infected.
Note that an adoption time of 0 indicates that this was a seed node.
}

\section{Thresholds}{

\code{node_by_adopt_threshold()} infers nodes' thresholds based on how much
exposure they had when they were infected.
This inference is of course imperfect,
especially where there is a sudden increase in exposure,
but it can be used heuristically.
In a threshold model,
nodes activate when \eqn{\sum_{j:\text{active}} w_{ji} \geq \theta_i},
where \eqn{w} is some (potentially weighted) matrix,
\eqn{j} are some already activated nodes,
and \eqn{theta} is some pre-defined threshold value.
Where a fractional threshold is used, the equation is
\eqn{\frac{\sum_{j:\text{active}} w_{ji}}{\sum_{j} w_{ji}} \geq \theta_i}.
That is, \eqn{theta} is now a proportion,
and works regardless of whether \eqn{w} is weighted or not.
}

\section{Recovery}{

\code{node_by_adopt_recovery()} measures the average length of time that nodes
that become infected remain infected in a compartmental model with recovery.
Infections that are not concluded by the end of the study period are
calculated as infinite.
}

\section{Exposure}{

\code{node_exposure()} calculates the number of infected/adopting nodes
to which each susceptible node is exposed.
It usually expects network data and
an index or mark (TRUE/FALSE) vector of those nodes which are currently infected,
but if a diff_model is supplied instead it will return
nodes exposure at \eqn{t = 0}.
}

\examples{
  smeg <- generate_smallworld(15, 0.025)
  smeg_diff <- play_diffusion(smeg, recovery = 0.2)
  plot(smeg_diff)
  # To measure when nodes adopted a diffusion/were infected
  (times <- node_by_adopt_time(smeg_diff))
  # To infer nodes' thresholds
  node_by_adopt_threshold(smeg_diff)
  # To measure how long each node remains infected for
  node_by_adopt_recovery(smeg_diff)
  # To measure how much exposure nodes have to a given mark
  node_by_adopt_exposure(smeg, mark = c(1,3))
  node_by_adopt_exposure(smeg_diff)
}
\references{
\subsection{On diffusion measures}{

Valente, Tom W. 1995. \emph{Network models of the diffusion of innovations}
(2nd ed.). Cresskill N.J.: Hampton Press.
}
}
\seealso{
Other diffusion:
\code{\link{mark_diff}},
\code{\link{measure_diffusion_infection}},
\code{\link{measure_diffusion_net}},
\code{\link{member_diffusion}},
\code{\link{motif_exposure}},
\code{\link{motif_hazard}}

Other measures:
\code{\link{measure_assort_net}},
\code{\link{measure_assort_node}},
\code{\link{measure_breadth}},
\code{\link{measure_broker_node}},
\code{\link{measure_broker_tie}},
\code{\link{measure_brokerage}},
\code{\link{measure_central_between}},
\code{\link{measure_central_close}},
\code{\link{measure_central_degree}},
\code{\link{measure_central_eigen}},
\code{\link{measure_centralities_between}},
\code{\link{measure_centralities_close}},
\code{\link{measure_centralities_degree}},
\code{\link{measure_centralities_eigen}},
\code{\link{measure_closure}},
\code{\link{measure_closure_node}},
\code{\link{measure_cohesion}},
\code{\link{measure_core}},
\code{\link{measure_diffusion_infection}},
\code{\link{measure_diffusion_net}},
\code{\link{measure_diverse_net}},
\code{\link{measure_diverse_node}},
\code{\link{measure_features}},
\code{\link{measure_fragmentation}},
\code{\link{measure_hierarchy}},
\code{\link{measure_periods}}

Other nodal:
\code{\link{mark_core}},
\code{\link{mark_degree}},
\code{\link{mark_diff}},
\code{\link{mark_nodes}},
\code{\link{mark_select_node}},
\code{\link{measure_assort_node}},
\code{\link{measure_broker_node}},
\code{\link{measure_brokerage}},
\code{\link{measure_central_between}},
\code{\link{measure_central_close}},
\code{\link{measure_central_degree}},
\code{\link{measure_central_eigen}},
\code{\link{measure_closure_node}},
\code{\link{measure_core}},
\code{\link{measure_diverse_node}},
\code{\link{member_brokerage}},
\code{\link{member_cliques}},
\code{\link{member_community}},
\code{\link{member_community_hier}},
\code{\link{member_community_non}},
\code{\link{member_components}},
\code{\link{member_core}},
\code{\link{member_diffusion}},
\code{\link{member_equivalence}},
\code{\link{motif_brokerage_node}},
\code{\link{motif_exposure}},
\code{\link{motif_node}},
\code{\link{motif_path}}
}
\concept{diffusion}
\concept{measures}
\concept{nodal}
