Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tEdgeFormation and tEdgeDissolution fractions are not correct #4

Open
martinamorris opened this issue Jun 27, 2021 · 0 comments
Open

Comments

@martinamorris
Copy link
Member

I'm pretty sure the hand calc below is right, but it doesn't match the tsna calc

library(tergm) 
#> Loading required package: network
#> 
#> 'network' 1.17.1 (2021-06-12), part of the Statnet Project
#> * 'news(package="network")' for changes since last version
#> * 'citation("network")' for citation information
#> * 'https://statnet.org' for help, support, and other information
#> 
#> 'ergm' 4.0.1 (2021-06-20), part of the Statnet Project
#> * 'news(package="ergm")' for changes since last version
#> * 'citation("ergm")' for citation information
#> * 'https://statnet.org' for help, support, and other information
#> 'ergm' 4 is a major update that introduces some backwards-incompatible
#> changes. Please type 'news(package="ergm")' for a list of major
#> changes.
library(tsna)
#> Loading required package: networkDynamic
#> 
#> 'networkDynamic' 0.11.0 (2021-06-12), part of the Statnet Project
#> * 'news(package="networkDynamic")' for changes since last version
#> * 'citation("networkDynamic")' for citation information
#> * 'https://statnet.org' for help, support, and other information
data(samplk)
samp.dyn <- networkDynamic(network.list = list(samplk1,samplk2), start=1)
#> Onsets and termini not specified, assuming each network in network.list should have a discrete spell of length 1
#> Argument base.net not specified, using first element of network.list instead
#> Created net.obs.period to describe network
#>  Network observation period info:
#>   Number of observation spells: 1 
#>   Maximal time range observed: 1 until 3 
#>   Temporal mode: discrete 
#>   Time unit: step 
#>   Suggested time increment: 1
dyads = network.dyadcount(samplk1)
edges1 = network.edgecount(samplk1)
form = tEdgeFormation(samp.dyn, start=2, end=2)
diss = tEdgeDissolution(samp.dyn, start=2, end=2)

# formation prob?
form/(dyads - edges1)
#> Time Series:
#> Start = 2 
#> End = 2 
#> Frequency = 1 
#> [1] 0.0876494
tEdgeFormation(samp.dyn, start=2, end=2, result.type="fraction")
#> Time Series:
#> Start = 2 
#> End = 2 
#> Frequency = 1 
#> [1] 0.08118081

# dissolution prob?
diss/(edges1)
#> Time Series:
#> Start = 2 
#> End = 2 
#> Frequency = 1 
#> [1] 0.3636364
tEdgeDissolution(samp.dyn, start=2, end=2, result.type="fraction")
#> Time Series:
#> Start = 2 
#> End = 2 
#> Frequency = 1 
#> [1] 0.2597403

Created on 2021-06-26 by the reprex package (v2.0.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant