Skip to content

Commit 7c75532

Browse files
committed
updated notebook, improved model code
1 parent 451b9bb commit 7c75532

File tree

6 files changed

+141
-65
lines changed

6 files changed

+141
-65
lines changed

knitr/car-iar-poisson/update_2021_02/BYM2 islands.ipynb

Lines changed: 64 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,22 @@
108108
"- I: `int<lower = 0> I; // number of nodes`\n",
109109
"- J: `int<lower = 0> J; // number of edges`\n",
110110
"- edges: `int<lower = 1, upper = I> edges[2, J]; // node[1, j] adjacent to node[2, j]`\n",
111-
"- tau: `real tau; // scaling factor`"
111+
"- tau: `real tau; // scaling factor`\n",
112+
"\n",
113+
"The helper function `nb_to_edge_array` takes the `nb` object and returns the 2 $\\times$ J edge array; the helper function `scaling_factor` uses the edge array to compute the geometric mean of the corresponding adjacency matrix.\n",
114+
"For the fully connected Scotland graph, the spatial data inputs are:\n",
115+
"\n",
116+
"```\n",
117+
" \"I\": 56,\n",
118+
" \"J\": 132,\n",
119+
"\n",
120+
" \"edges\": [\n",
121+
" [ 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 7, 7, 7, 7, 9, 9, 9, 9, 9, 10, 10, 11, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 17, 17, 18, 18, 18, 18, 18, 20, 21, 21, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 32, 33, 33, 34, 34, 34, 34, 34, 34, 34, 35, 35, 36, 36, 36, 37, 37, 38, 38, 38, 38, 38, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 44, 44, 45, 46, 46, 47, 47, 47, 48, 49, 49, 49, 51, 52, 55 ],\n",
122+
" [ 5, 9, 11, 19, 7, 10, 6, 12, 18, 20, 28, 11, 12, 13, 19, 8, 10, 13, 16, 17, 11, 17, 19, 23, 29, 16, 22, 12, 17, 19, 31, 32, 35, 25, 29, 50, 17, 21, 22, 29, 19, 29, 20, 28, 33, 55, 56, 55, 29, 50, 29, 34, 36, 37, 39, 27, 30, 31, 44, 47, 48, 55, 56, 26, 29, 29, 42, 43, 31, 32, 55, 33, 45, 34, 43, 50, 38, 42, 44, 45, 56, 32, 35, 46, 47, 35, 45, 56, 39, 40, 42, 43, 51, 52, 54, 37, 46, 37, 39, 41, 41, 46, 42, 44, 49, 51, 54, 40, 41, 41, 49, 52, 46, 49, 53, 43, 51, 48, 49, 56, 47, 53, 48, 49, 53, 49, 52, 53, 54, 54, 54, 56 ]\n",
123+
" ],\n",
124+
"\n",
125+
" \"tau\": 0.4853,\n",
126+
"```"
112127
]
113128
},
114129
{
@@ -131,22 +146,62 @@
131146
"bym2_fit.summary()"
132147
]
133148
},
149+
{
150+
"cell_type": "code",
151+
"execution_count": null,
152+
"metadata": {},
153+
"outputs": [],
154+
"source": [
155+
"bym2_fit.diagnose()"
156+
]
157+
},
134158
{
135159
"cell_type": "markdown",
136160
"metadata": {},
137161
"source": [
138162
"## Fit disconnected graphs on Scotland Lip cancer dataset with BYM2 model implemented in Stan, following Freni-Sterrantino\n"
139163
]
140164
},
165+
{
166+
"cell_type": "markdown",
167+
"metadata": {},
168+
"source": [
169+
"All components of the BYM2 model remain the same. The same 2 $\\times$ J edges array encodes the spatial structure of the graph, and as before, the spatial prior `phi` is a vector, one element per node (areal unit). In order to compute the elements of `phi` on a per-component basis, we use Stan's multi-indexing operators. For each component, we provide a vector of indices into `phi` and into the edges_array. Because Stan doesn't have ragged arrays (yet), we construct two square matrices, where the number of rows in each are the number of components (including singletons) in the graph, and the number of columns are the number of nodes and edges, respectively. In addition we compute the per-component scaling factor.\n",
170+
"\n",
171+
"The helper function `index_components` takes an `nb` object as input and returns the list of data structures needed by the `BYM2_islands.stan` model. We use the R package `jsonlite` to save this in JSON format. For the Scotland map with 3 components, in file `scotland_3_comps_nbs.data.R`, function `index_components` and `write_json` produce the following input data, used in addition to the number of nodes, edges, and edge array:\n",
172+
"\n",
173+
"```\n",
174+
" \"K\":3,\n",
175+
" \"K_node_cts\":[53,2,1],\n",
176+
" \"K_edge_cts\":[126,1,0],\n",
177+
" \"K_node_idxs\":[[1,2,3,4,5,7,9,10,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,0,0,0],\n",
178+
"\t\t [6,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\n",
179+
"\t\t [11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],\n",
180+
" \"K_edge_idxs\":[[1,2,3,4,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,0],\n",
181+
"\t\t [13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\n",
182+
"\t\t [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],\n",
183+
"\n",
184+
" \"tau\": [0.4504, 0.25, 1],\n",
185+
"```"
186+
]
187+
},
141188
{
142189
"cell_type": "code",
143190
"execution_count": null,
144191
"metadata": {},
145192
"outputs": [],
146193
"source": [
147194
"from cmdstanpy import cmdstan_path, CmdStanModel\n",
148-
"bym2_model = CmdStanModel(stan_file='bym2_islands.stan')\n",
149-
"print(bym2_model.code())"
195+
"bym2_islands_model = CmdStanModel(stan_file='bym2_islands.stan')"
196+
]
197+
},
198+
{
199+
"cell_type": "code",
200+
"execution_count": null,
201+
"metadata": {},
202+
"outputs": [],
203+
"source": [
204+
"print(bym2_islands_model.code())"
150205
]
151206
},
152207
{
@@ -158,7 +213,7 @@
158213
"import json\n",
159214
"with open('scot_3_comp.data.json') as fd:\n",
160215
" scot_data = json.load(fd)\n",
161-
"print(scot_data)"
216+
"# print(scot_data)"
162217
]
163218
},
164219
{
@@ -167,16 +222,18 @@
167222
"metadata": {},
168223
"outputs": [],
169224
"source": [
170-
"bym2_fit = bym2_model.sample(data=scot_data)\n",
171-
"bym2_fit.summary()"
225+
"bym2_islands_fit = bym2_islands_model.sample(data=scot_data, max_treedepth=11)\n",
226+
"bym2_islands_fit.summary()"
172227
]
173228
},
174229
{
175230
"cell_type": "code",
176231
"execution_count": null,
177232
"metadata": {},
178233
"outputs": [],
179-
"source": []
234+
"source": [
235+
"bym2_islands_fit.diagnose()"
236+
]
180237
},
181238
{
182239
"cell_type": "code",

knitr/car-iar-poisson/update_2021_02/bym2.stan

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,12 @@ parameters {
6060
real beta; // covariate
6161

6262
// spatial effects
63-
real logit_rho; // proportion of spatial effect that's spatially smoothed
63+
real<lower=0, upper=1> rho; // proportion of spatial effect that's spatially smoothed
6464
real<lower = 0> sigma; // scale of spatial effects
6565
vector[I] theta; // standardized heterogeneous spatial effects
6666
vector[I] phi; // standardized spatially smoothed spatial effects
6767
}
6868
transformed parameters {
69-
real<lower=0, upper=1> rho = inv_logit(logit_rho);
7069
// spatial effects (combine heterogeneous and spatially smoothed)
7170
vector[I] gamma = (sqrt(1 - rho) * theta + sqrt(rho) * sqrt(1 / tau) * phi) * sigma;
7271
}
@@ -78,11 +77,12 @@ model {
7877

7978
// spatial hyperpriors and priors
8079
sigma ~ normal(0, 1);
81-
logit_rho ~ normal(0, 1);
80+
rho ~ beta(0.5, 0.5);
8281
theta ~ normal(0, 1);
8382
phi ~ standard_icar(edges);
8483
}
8584
generated quantities {
85+
// posterior predictive checks
8686
vector[I] eta = log_E + alpha + x * beta + gamma * sigma;
8787
vector[I] y_prime = exp(eta);
8888
int y_rep[I,10];
@@ -97,4 +97,5 @@ generated quantities {
9797
y_rep[i,j] = poisson_log_rng(eta[i]);
9898
}
9999
}
100+
real logit_rho = log(rho / (1.0 - rho));
100101
}

knitr/car-iar-poisson/update_2021_02/bym2_helpers.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ index_components <- function(nb_obj) {
9696
}
9797

9898
return(list("K"=num_comps,
99-
"K_num_nodes"=as.vector(table(comp_idxs)),
100-
"K_num_edges"=edges_per_comp,
99+
"K_node_cts"=as.vector(table(comp_idxs)),
100+
"K_edge_cts"=edges_per_comp,
101101
"K_node_idxs"=comp_node_idxs,
102102
"K_edge_idxs"=comp_edge_idxs,
103-
"K_scaling_factors"=scaling_factors))
103+
"tau"=scaling_factors))
104104
}
105105

knitr/car-iar-poisson/update_2021_02/bym2_islands.stan

Lines changed: 54 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,62 +4,59 @@ functions {
44
* coefficients under the ICAR model with unit variance, where
55
* adjacency is determined by the adjacency array and the spatial
66
* structure is a disconnected graph which has at least one
7-
* connected component. The spatial structure is described by
8-
* a 2-D adjacency array over the all edges in the areal map
9-
* and a series of arrays of per-component indexes.
10-
* The node arrays provide per-component masks into phi, the
11-
* per-node ICAR component, and corresponding masks into the
12-
* edge array. Because the Stan language lacks ragged arrays,
13-
* these are all zero-padded square matrices, and additional vectors
14-
* record the number of nodes and edges in each component.
15-
*
16-
*
17-
* Each connected component has a soft sum-to-zero constraint.
18-
* Singleton components don't contribute to the ICAR model.
7+
* connected component. Each connected component has a
8+
* soft sum-to-zero constraint.
9+
10+
* The spatial structure is described by a 2-D adjacency array
11+
* over the all edges in the areal map and a arrays of the
12+
* indices of per-component nodes and edges which are used as
13+
* masks into phi and the adjacency matrix. Because the Stan
14+
* language lacks ragged arrays, these are all square matrices,
15+
* padded out with zeros; additional vectors record the number
16+
* of nodes and edges in each component.
1917
*
2018
* @param phi vector of varying effects
2119
* @param adjacency parallel arrays of indexes of adjacent elements of phi
22-
* @param num_nodes array of sizes of per-component nodes
23-
* @param num_edges array of sizes of per-component edges
20+
* @param node_cts array of sizes of per-component nodes
21+
* @param edge_cts array of sizes of per-component edges
2422
* @param node_idxs array of arrays of per_component node indexes.
2523
* @param edge_idxs array of arrays of per_component edge indexes.
2624
*
2725
* @return ICAR log probability density
2826
*
2927
* @reject if the the adjacency matrix does not have two rows
3028
* @reject if size mismatch between indexing arrays
31-
* @reject if size mismatch between phi and dimension 2 of comp_members
29+
* @reject if size mismatch between phi and node indexes columns.
3230
*/
3331
real standard_icar_disconnected_lpdf(vector phi,
3432
int[ , ] adjacency,
35-
int[ ] num_nodes,
36-
int[ ] num_edges,
33+
int[ ] node_cts,
34+
int[ ] edge_cts,
3735
int[ , ] node_idxs,
3836
int[ , ] edge_idxs) {
3937
if (size(adjacency) != 2)
4038
reject("require 2 rows for adjacency array;",
4139
" found rows = ", size(adjacency));
4240

43-
if (!(size(num_nodes) == size(num_edges)
44-
&& size(num_nodes) == size(node_idxs)
45-
&& size(num_edges) == size(edge_idxs)))
41+
if (!(size(phi) == dims(node_idxs)[2]
42+
&& size(node_cts) == size(edge_cts)
43+
&& size(node_cts) == size(node_idxs)
44+
&& size(edge_cts) == size(edge_idxs)))
4645
reject("bad graph indexes, expecting ",
47-
size(num_nodes),
46+
size(node_cts),
4847
" rows for node and edge index matrices;",
4948
" inputs have ",
50-
size(num_nodes),
49+
size(node_cts),
5150
" and ",
52-
size(num_edges),
51+
size(edge_cts),
5352
" respectively.");
5453

5554
real total = 0;
56-
for (n in 1:size(num_nodes)) {
57-
if (num_nodes[n] > 1)
58-
total += -0.5 * dot_self(phi[adjacency[1, edge_idxs[n, 1:num_edges[n]]]] -
59-
phi[adjacency[2, edge_idxs[n, 1:num_edges[n]]]])
60-
+ normal_lpdf(sum(phi[node_idxs[n, 1:num_nodes[n]]]) | 0, 0.001 * num_nodes[n]);
61-
else
62-
total += normal_lpdf(phi[node_idxs[n, 1]] | 0, inv_sqrt(1.0 * size(num_nodes)));
55+
for (n in 1:size(node_cts)) {
56+
if (node_cts[n] > 1)
57+
total += -0.5 * dot_self(phi[adjacency[1, edge_idxs[n, 1:edge_cts[n]]]] -
58+
phi[adjacency[2, edge_idxs[n, 1:edge_cts[n]]]])
59+
+ normal_lpdf(sum(phi[node_idxs[n, 1:node_cts[n]]]) | 0, 0.001 * node_cts[n]);
6360
}
6461
return total;
6562
}
@@ -71,8 +68,8 @@ data {
7168
int<lower = 1, upper = I> edges[2, J]; // node[1, j] adjacent to node[2, j]
7269

7370
int<lower=0, upper=I> K; // number of components in spatial graph
74-
int<lower=0, upper=I> K_num_nodes[K]; // per-component nodes
75-
int<lower=0, upper=J> K_num_edges[K]; // per-component edges
71+
int<lower=0, upper=I> K_node_cts[K]; // per-component nodes
72+
int<lower=0, upper=J> K_edge_cts[K]; // per-component edges
7673
int<lower=0, upper=I> K_node_idxs[K, I]; // rows contain per-component node indexes
7774
int<lower=0, upper=J> K_edge_idxs[K, J]; // rows contain per-component edge indexes
7875

@@ -90,23 +87,24 @@ parameters {
9087
real beta; // covariates
9188

9289
// spatial effects
90+
real<lower=0, upper=1> rho; // proportion unstructured vs. spatially structured variance
9391
real<lower = 0> sigma; // scale of spatial effects
94-
real<lower = 0, upper = 1> rho; // proportion of spatial effect that's spatially smoothed
9592
vector[I] theta; // standardized heterogeneous spatial effects
9693
vector[I] phi; // standardized spatially smoothed spatial effects
9794
}
9895
transformed parameters {
9996
vector[I] gamma;
10097
// each component has its own spatial smoothing
98+
// singleton nodes have distribution normal(0, 1/sqrt(K))
10199
for (k in 1:K) {
102-
if (K_num_nodes[k] == 1) {
100+
if (K_node_cts[k] == 1) {
103101
gamma[K_node_idxs[k,1]] =
104102
theta[K_node_idxs[k,1]] + normal_lpdf(phi[K_node_idxs[k,1]] | 0, inv_sqrt(K));
105103
} else {
106-
gamma[K_node_idxs[k, 1:K_num_nodes[k]]] =
107-
(sqrt(1 - rho) * theta[K_node_idxs[k, 1:K_num_nodes[k]]]
104+
gamma[K_node_idxs[k, 1:K_node_cts[k]]] =
105+
(sqrt(1 - rho) * theta[K_node_idxs[k, 1:K_node_cts[k]]]
108106
+ (sqrt(rho) * sqrt(1 / tau[k])
109-
* phi[K_node_idxs[k, 1:K_num_nodes[k]]]) * sigma);
107+
* phi[K_node_idxs[k, 1:K_node_cts[k]]]) * sigma);
110108
}
111109
}
112110
}
@@ -120,5 +118,23 @@ model {
120118
sigma ~ normal(0, 1);
121119
rho ~ beta(0.5, 0.5);
122120
theta ~ normal(0, 1);
123-
phi ~ standard_icar_disconnected(edges, K_num_nodes, K_num_edges, K_node_idxs, K_edge_idxs);
121+
phi ~ standard_icar_disconnected(edges, K_node_cts, K_edge_cts, K_node_idxs, K_edge_idxs);
122+
}
123+
generated quantities {
124+
// posterior predictive checks
125+
vector[I] eta = log_E + alpha + x * beta + gamma * sigma;
126+
vector[I] y_prime = exp(eta);
127+
int y_rep[I,10];
128+
for (j in 1:10) {
129+
if (max(eta) > 20) {
130+
// avoid overflow in poisson_log_rng
131+
print("max eta too big: ", max(eta));
132+
for (i in 1:I)
133+
y_rep[i,j] = -1;
134+
} else {
135+
for (i in 1:I)
136+
y_rep[i,j] = poisson_log_rng(eta[i]);
137+
}
138+
}
139+
real logit_rho = log(rho / (1.0 - rho));
124140
}

knitr/car-iar-poisson/update_2021_02/scot_3_comp.data.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"edges":[[1,1,1,2,2,3,4,4,4,5,5,5,6,7,7,7,7,9,9,9,9,10,10,13,13,14,14,14,15,15,15,16,16,16,16,17,17,18,18,18,18,18,20,21,21,23,23,23,23,23,24,24,24,24,24,24,24,24,25,25,26,26,26,27,27,27,28,28,29,29,29,30,30,30,30,30,31,31,31,31,32,33,33,34,34,34,34,34,34,34,35,35,36,36,36,37,37,38,38,38,38,38,39,39,40,40,40,41,41,41,42,42,44,44,45,46,46,47,47,47,48,49,49,49,51,52,55],
55
[5,9,19,7,10,12,18,20,28,12,13,19,8,10,13,16,17,17,19,23,29,16,22,17,19,31,32,35,25,29,50,17,21,22,29,19,29,20,28,33,55,56,55,29,50,29,34,36,37,39,27,30,31,44,47,48,55,56,26,29,29,42,43,31,32,55,33,45,34,43,50,38,42,44,45,56,32,35,46,47,35,45,56,39,40,42,43,51,52,54,37,46,37,39,41,41,46,42,44,49,51,54,40,41,41,49,52,46,49,53,43,51,48,49,56,47,53,48,49,53,49,52,53,54,54,54,56]],
66
"K":3,
7-
"K_num_nodes":[53,2,1],
8-
"K_num_edges":[126,1,0],
7+
"K_node_cts":[53,2,1],
8+
"K_edge_cts":[126,1,0],
99
"K_node_idxs":[[1,2,3,4,5,7,9,10,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,0,0,0],
1010
[6,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
1111
[11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],

knitr/car-iar-poisson/update_2021_02/scot_islands.data.json

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{
2-
"I": 56,
3-
"J": 126,
2+
"I": 56,
3+
"J": 126,
44

5-
"edges" :[[1,1,1,2,2,3,4,4,4,5,5,5,6,6,6,6,7,7,7,7,8,8,10,10,11,11,11,12,12,12,13,13,13,13,14,14,15,15,15,15,15,17,18,18,20,20,20,20,20,21,21,21,21,21,21,21,21,22,22,23,23,23,24,24,24,25,25,26,26,26,27,27,27,27,27,28,28,28,28,29,30,30,31,31,31,31,31,31,31,32,32,33,33,33,34,34,35,35,35,35,35,36,36,37,37,37,38,38,38,39,39,41,41,42,43,43,44,44,44,45,46,46,46,48,49,52],[5,7,16,6,8,9,15,17,25,9,10,16,8,10,13,14,14,16,20,26,13,19,14,16,28,29,32,22,26,47,14,18,19,26,16,26,17,25,30,52,53,52,26,47,26,31,33,34,36,24,27,28,41,44,45,52,53,23,26,26,39,40,28,29,52,30,42,31,40,47,35,39,41,42,53,29,32,43,44,32,42,53,36,37,39,40,48,49,51,34,43,34,36,38,38,43,39,41,46,48,51,37,38,38,46,49,43,46,50,40,48,45,46,53,44,50,45,46,50,46,49,50,51,51,51,53]],
5+
"edges" :[[1,1,1,2,2,3,4,4,4,5,5,5,6,6,6,6,7,7,7,7,8,8,10,10,11,11,11,12,12,12,13,13,13,13,14,14,15,15,15,15,15,17,18,18,20,20,20,20,20,21,21,21,21,21,21,21,21,22,22,23,23,23,24,24,24,25,25,26,26,26,27,27,27,27,27,28,28,28,28,29,30,30,31,31,31,31,31,31,31,32,32,33,33,33,34,34,35,35,35,35,35,36,36,37,37,37,38,38,38,39,39,41,41,42,43,43,44,44,44,45,46,46,46,48,49,52],[5,7,16,6,8,9,15,17,25,9,10,16,8,10,13,14,14,16,20,26,13,19,14,16,28,29,32,22,26,47,14,18,19,26,16,26,17,25,30,52,53,52,26,47,26,31,33,34,36,24,27,28,41,44,45,52,53,23,26,26,39,40,28,29,52,30,42,31,40,47,35,39,41,42,53,29,32,43,44,32,42,53,36,37,39,40,48,49,51,34,43,34,36,38,38,43,39,41,46,48,51,37,38,38,46,49,43,46,50,40,48,45,46,53,44,50,45,46,50,46,49,50,51,51,51,53]],
66

77
"K": 4,
8-
"K_size" : [53, 1, 1, 1 ],
9-
"K_members" : [
10-
[1,2,3,4,5,7,9,10,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,0,0,0],
11-
[6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
12-
[8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
13-
[11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
14-
],
15-
16-
"tau": [0.4504, 0.25, 1],
8+
"K_node_cts":[53,1,1,1],
9+
"K_edge_cts":[126,0,0,0],
10+
"K_node_idxs":[[1,2,3,4,5,7,9,10,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,0,0,0],
11+
[6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
12+
[8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
13+
[11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],
14+
"K_edge_idxs":[[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126],
15+
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
16+
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
17+
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],
18+
"tau":[0.4504,1,1,1],
1719

1820
"y": [ 9, 39, 11, 9, 15, 8, 26, 7, 6, 20, 13, 5, 3, 8, 17, 9, 2, 7, 9, 7, 16, 31, 11, 7, 19, 15, 7, 10, 16, 11, 5, 3, 7, 8, 11, 9, 11, 8, 6, 4, 10, 8, 2, 6, 19, 3, 2, 3, 28, 6, 1, 1, 1, 1, 0, 0 ],
1921

0 commit comments

Comments
 (0)