This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import networkx as nx | |
G = nx.Graph() | |
G.add_node(1) | |
nx.draw(G, with_labels=True, font_weight='bold', font_color='white', node_color='black', node_size=500) | |
G.add_nodes_from([2, 3]) | |
nx.draw(G, with_labels=True, font_weight='bold', font_color='white', node_color='black', node_size=500) | |
H = nx.path_graph(10) | |
G.add_nodes_from(H) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
G = nx.Graph() | |
G.add_edge(1, 7) | |
e = (2, 3) | |
G.add_edge(*e) | |
nx.draw(G, with_labels=True, font_weight='bold', font_color='white', node_color='black', node_size=500, alpha=0.8, edge_color='orange') | |
G.add_edges_from([(1, 2), (1, 3)]) | |
nx.draw(G, with_labels=True, font_weight='bold', font_color='white', node_color='black', node_size=500, alpha=0.8, edge_color='orange') | |
H = nx.path_graph(10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
K_5 = nx.complete_graph(5) | |
nx.draw(K_5, with_labels=True, font_weight='bold', font_color='white', node_color='black', node_size=500, alpha=0.8, edge_color='orange') | |
K_3_5 = nx.complete_bipartite_graph(3, 5) | |
nx.draw(K_3_5, with_labels=True, font_weight='bold', font_color='white', node_color='black', node_size=500, alpha=0.8, edge_color='orange') | |
barbell = nx.barbell_graph(10, 10) | |
nx.draw(barbell , with_labels=True, font_weight='bold', font_color='white', node_color='black', node_size=500, alpha=0.8, edge_color='orange') | |
lollipop = nx.lollipop_graph(10, 20) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Visualization | |
import networkx as nx | |
import matplotlib.pyplot as plt | |
import warnings | |
warnings.filterwarnings("ignore") | |
%matplotlib inline | |
# Network topology | |
g = nx.random_geometric_graph(1000, 0.1, seed=896803) # Random Clustered graph 1000 nodes - distance =0.05, no self loops |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import networkx as nx | |
import ndlib.models.ModelConfig as mc | |
import ndlib.models.epidemics as ep | |
from ndlib.viz.mpl.DiffusionTrend import DiffusionTrend | |
# Network topology | |
g = nx.erdos_renyi_graph(1000, 0.1) # 1000 nodes with 10% probability of edge creation | |
# Model selection | |
model = ep.SEIRModel(g) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import networkx as nx | |
import matplotlib.pyplot as plt | |
import dynetx as dn | |
import ndlib.models.ModelConfig as mc | |
import ndlib.models.dynamic as dm | |
from past.builtins import xrange | |
import ndlib.models.epidemics as ep | |
from ndlib.utils import multi_runs | |
from ndlib.viz.mpl.DiffusionTrend import DiffusionTrend | |
from ndlib.viz.mpl.TrendComparison import DiffusionTrendComparison |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%let ErrorVariance=1000; | |
%let BlockVariance=3000; | |
%let block=18; | |
%let nsim=1; | |
data factor; | |
length Treatment $30; | |
call streaminit(123); | |
do isim = 1 to ≁ | |
do block=1 to █ | |
rndBlock=rand("Normal",0,sqrt(&BlockVariance)); /* create block specific deviates */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Rsquared; | |
do i=1 to 1000 by 1; | |
x=rand("Normal"); | |
y=1-2*x + 1*x*x + rand("Normal"); | |
output; | |
end; | |
proc sgplot data=Rsquared; | |
scatter x=x y=y; | |
run; | |
proc reg data=Rsquared plots=fitplot; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%let ErrorVariance=2720; | |
%let BlockVariance=4851; | |
%let block=20; | |
%let nsim=1; | |
DATA RCBD; | |
call streaminit(123); | |
do isim = 1 to ≁ | |
do block=1 to █ | |
rndBlock=rand("Normal",0,sqrt(&BlockVariance)); /* create block specific deviates */ | |
do trt=1 to 2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data normal; | |
call streaminit(123); | |
length simulation 4 i 3; | |
do simulation = 1 to 1000; | |
do i = 1 to 100; | |
group='A'; | |
x = rand('normal'); | |
output; | |
group='B'; | |
x = rand('normal'); |
OlderNewer