gpv: Generalized Path Value

Description Usage Arguments Details See Also Examples

View source: R/gpv.R

Description

Calculates the generalized path value of a user-specified path through sociomatrix. Parameter p sets the p-norm used in calculation.

Usage

1
gpv(sociomatrix, path, p = Inf, node_costs = NULL)

Arguments

sociomatrix

a nonnegative, real valued sociomatrix.

path

an integer vector of node indices from sociomatrix.

p

a nonnegative real number that sets the 'p-norm' parameter for generalized path value calculation.

node_costs

a list of costs, in order, of all nodes represented in the sociomatrix, all are assumed 0 if unspecified

Details

As a rule of thumb, p close to 0 will downweight the impact of particular tie strengths and upweight the impact of binary path length. p equal to infinity will recapitulate the traditional path value measure of Peay (1980) and is therefore the default. In other words, the value of a path under p = Inf will be the value of the weakest tie. The value of the same path under p = 0 will be the inverse of its binary length.

See Also

opt_gpv to identify the path of optimal 'gpv' between two nodes and all_opt_gpv to identify the optimal paths between all pairs of nodes. Calling generate_proximities with mode = 'gpv' returns a matrix 'gpv' values for the optimal paths between all pairs of nodes.

Examples

1
2
3
4
5
6
7
8
## Calculate gpv along a path in a sociomatrix
gpv(YangKnoke01, path = c(1,2,5), p = 1)

## The same calculation, with nonzero node costs
gpv(YangKnoke01, path = c(1,2,5), p = 1, node_costs = c(1,3,3,2,1))

## This path doesn't exist
gpv(YangKnoke01, path = c(1,2,4,5), p = 0)

gretel documentation built on Aug. 22, 2019, 5:10 p.m.