Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ストリートスナップデータに
統計的ネットワーク分析の適用を試みた

 ストリートスナップデータに
統計的ネットワーク分析の適用を試みた

TokyoR #78 LT

saltcooky

May 25, 2019
Tweet

More Decks by saltcooky

Other Decks in Science

Transcript

  1. Ϟσϧ࡞੒(ྫ) ࢦ਺ϥϯμϜϞσϧ͸TUBUOFUQBDLBHFͰ࣮૷͕Ͱ͖·͢ɻ # ωοτϫʔΫΦϒδΣΫτͷ࡞੒
 network <- as.network(x = graph_matrix, directed

    = FALSE, loops = FALSE) # ֤Τοδʹઆ໌ม਺(೥ྸ)Λ௥Ճ network %v% "Age" <- Age # ֤Τοδͷ೥ྸͷࠩΛܭࢉ diff.age <- abs(sweep(matrix(snap_info$Age, nrow = 638, ncol = 638), 2, snap_info$Age)) # Ϟσϧ࡞੒
 model <- ergm( network ~ edges + edgecov(diff.age) + nodecov(“Age”) )

  2. Ϟσϧ࡞੒ ࢦ਺ϥϯμϜϞσϧ͸TUBUOFUQBDLBHFͰ࣮૷͕Ͱ͖·͢ɻ # ετϦʔτεφοϓͷp*Ϟσϧੜ੒ snap_net_model <- ergm(snap_net ~ 
 edges

    + # ลͷ਺ nodecov(“Age")+ # ೥ྸࠩ edgecov(diff.age) + # ೥ྸ nodematch(“Occupation”) + # ৬ۀ nodematch("Point") ) # ࡱӨ৔ॴ

  3. ݁ՌΛݟͯΈΔ > summary(snap_net_model) < ུ > Monte Carlo MLE Results:

    Estimate Std. Error MCMC % z value Pr(>|z|) edges -5.2066393 0.2692526 0 -19.337 <1e-04 *** edgecov.diff.age -0.0015763 0.0094767 0 -0.166 0.8679 nodecov.Age -0.0003136 0.0061215 0 -0.051 0.9591 nodematch.Occupation -0.0453192 0.0842853 0 -0.538 0.5908 nodematch.Point 0.1491330 0.0628610 0 2.372 0.0177 * 
 < ུ > AIC: 13485 BIC: 13536 (Smaller is better.)
 ࡱӨ৔ॴ͕ลͷൃੜʹ Өڹ͍ͯͦ͠͏ AIC/BICͰม਺બ୒Մೳ