OpenBI Docs Buy

NETWORK.SENSITIVITY OpenBI

The links each node's standing depends on: how fast each node's PageRank, eigenvector centrality, strength, closeness, harmonic centrality or betweenness moves as each link's weight changes.

Group: Networks. OpenBI’s own: DAX has no function of this name.

Syntax

NETWORK.SENSITIVITY ( <links>, <from>, <to>, <weight>, <measure> [, <node>] [, <directed>] )
ParameterTypeDescription
linksTableThe rows that make the network, one link a row: a table of the model or a table expression, as the filters leave it.
fromExpression
evaluated for each row
One end of each row's link, such as a payer, a customer or a place.
toExpression
evaluated for each row
The other end of each row's link.
weightExpression
evaluated for each row
Each row's weight, the one the derivatives are taken by; never negative. BLANK () counts every row as 1. For closeness, harmonic and betweenness it is the link's length, such as minutes.
measureText"pagerank", "eigenvector", "strength" (or "weight"), "closeness", "harmonic" or "betweenness", in capitals or not.
nodeValue
optional
Only this node's rows: how its measure moves with each link. Left out, every node's.
directedBoolean
optional
TRUE when each link runs one way, from its first end to its second. FALSE or left out, a link works both ways.

Returns

Table. A row for each link and each node, a link's rows together; with a node, a row a link. Its columns: From, To and Weight, the link; Node and Value, the node's measure; Derivative; Column sum; and Note.

Remarks

  • Derivative is how fast the node's measure moves as the link's weight grows, at the weights as they are: the change in the measure for each unit of weight added, as long as the change stays small. Above 0, a heavier link lifts the node; below 0, it pulls it down; 0, the link makes no difference to it.
  • PageRank (with a damping of 0.85, and directed when the network is), eigenvector centrality (the largest 1) and strength (the weights of the node's links added up) move smoothly with the weights: their derivatives are slopes.
  • For closeness, harmonic and betweenness the weight is a length, such as minutes or kilometres, and a shortest path is the one of least length. Closeness is 1 over the mean length to the nodes the node reaches; harmonic is the mean of 1 over the length to each other node, 0 for one it can't reach.
  • Closeness and harmonic move in straight pieces as a length changes, and betweenness in jumps: their derivatives hold only close to the weights as they are. Between jumps betweenness is flat, so its derivative is 0, or a very large number where two shortest paths are equally long: a sign of that tie, not a slope. The Note column says so on every row of these three measures.
  • Column sum adds up a link's derivatives over every node: 0 for PageRank, whose values always add up to 1, and 2 for strength, as a link's weight counts at both its ends.
  • Value is the node's measure, the same on each of its rows.
  • Every link by every node can be many rows: past 500,000 the call is an error, and so is one that would take too long (it says about how long). Give a node, or keep only the links that matter in the table. A node that is not in the network is an error too.
  • To make the network directed for every node, leave the node empty: ( Roads, [From], [To], [Crates], "pagerank", , TRUE ).
  • Several rows between the same two nodes make one link, and their weights add up. Without a weight each row adds 1, so a pair that appears three times weighs 3.
  • Rows where an end is blank, or where both ends are the same node, add no link; the end that is there still counts as a node.

Compared with DAX

An OpenBI function: DAX has none like it, so a measure or query that uses it works in OpenBI only, not in Power BI or Analysis Services.

Examples

Which payments C's PageRank hangs on

Directed and weighted by the amounts. One more paid from E to C lifts C's PageRank by about 0.0009, and one more from E to F pulls it down by 0.0013, as more of E's money goes elsewhere. A, B and D each pay one account only, so their amounts make no difference.

EVALUATE
VAR Payments =
    DATATABLE (
        "Payer", STRING, "Payee", STRING, "Amount", INTEGER,
        {
            { "A", "B", 100 }, { "B", "C", 80 }, { "C", "A", 60 }, { "C", "D", 50 },
            { "D", "E", 40 }, { "E", "C", 30 }, { "E", "F", 20 }
        }
    )
RETURN
    SELECTCOLUMNS (
        NETWORK.SENSITIVITY ( Payments, [Payer], [Payee], [Amount], "pagerank", "C", TRUE ),
        "From", [From],
        "To", [To],
        "Amount", [Weight],
        "PageRank", ROUND ( [Value], 4 ),
        "Derivative", ROUND ( [Derivative], 6 )
    )
FromToAmountPageRankDerivative
AB1000.26870
BC800.26870
CA600.26870.000226
CD500.2687-0.000271
DE400.26870
EC300.26870.000894
EF200.2687-0.001341

One road, every node

One more crate a day on the road from Depot N to the shop lifts the PageRank of its two ends and pulls down the other two's: the four derivatives add up to 0.

EVALUATE
VAR Roads =
    DATATABLE (
        "From", STRING, "To", STRING, "Crates", INTEGER,
        {
            { "Brewery", "Depot N", 8 }, { "Brewery", "Depot S", 7 }, { "Depot N", "Depot S", 3 },
            { "Depot N", "Shop", 4 }, { "Depot S", "Shop", 9 }
        }
    )
RETURN
    SELECTCOLUMNS (
        FILTER (
            NETWORK.SENSITIVITY ( Roads, [From], [To], [Crates], "pagerank" ),
            [From] = "Depot N" && [To] = "Shop"
        ),
        "Node", [Node],
        "PageRank", ROUND ( [Value], 4 ),
        "Derivative", ROUND ( [Derivative], 6 ),
        "Column sum", ROUND ( [Column sum], 9 )
    )
NodePageRankDerivativeColumn sum
Brewery0.242-0.0067550
Depot N0.24350.0075520
Depot S0.3007-0.0090030
Shop0.21380.0082050

Which drives the shop's closeness hangs on

Minutes are lengths here. The drive from Depot N to the shop is on its shortest ways to Depot N and to the brewery, so each extra minute on it costs twice what a minute on the drive from Depot S does. The drive between the depots is on none of them: 0.

EVALUATE
VAR Drive =
    DATATABLE (
        "From", STRING, "To", STRING, "Minutes", INTEGER,
        {
            { "Brewery", "Depot N", 12 }, { "Brewery", "Depot S", 9 }, { "Depot N", "Depot S", 5 },
            { "Depot N", "Shop", 7 }, { "Depot S", "Shop", 11 }
        }
    )
RETURN
    SELECTCOLUMNS (
        NETWORK.SENSITIVITY ( Drive, [From], [To], [Minutes], "closeness", "Shop" ),
        "From", [From],
        "To", [To],
        "Minutes", [Weight],
        "Closeness", [Value],
        "Derivative", [Derivative]
    )
FromToMinutesClosenessDerivative
BreweryDepot N120.0810810810810811-0.00219138056975895
BreweryDepot S90.08108108108108110
Depot NDepot S50.08108108108108110
Depot NShop70.0810810810810811-0.0043827611395179
Depot SShop110.0810810810810811-0.00219138056975895

NETWORK.NODES, NETWORK.CENTRALITY, NETWORK.LINKS, NETWORK.PROPAGATE.

Open Graph, OpenBI's graph library, does the work: jacobian_full, jacobian_column, pagerank, eigenvector_centrality, strength, closeness, harmonic_centrality, betweenness. See the OAX network functions and Open Graph.

Last updated · OpenBI Studio 0.3.78