anova
This commit is contained in:
parent
b17dec4dbe
commit
dc025066f7
|
@ -0,0 +1,85 @@
|
|||
select distinct experiment.idx_scenario,
|
||||
n_max_trial, prf_size, prf_conn, cap_limit_prob_type, cap_limit_level, diff_new_conn, crit_supplier, proactive_ratio, remove_t, netw_prf_n,
|
||||
mean_count_firm_prod, mean_count_firm, mean_count_prod,
|
||||
mean_max_ts_firm_prod, mean_max_ts_firm, mean_max_ts_prod,
|
||||
mean_n_remove_firm_prod, mean_n_all_prod_remove_firm, mean_end_ts
|
||||
from iiabmdb.with_exp_experiment as experiment
|
||||
left join
|
||||
(
|
||||
select
|
||||
idx_scenario,
|
||||
sum(count_firm_prod) / count(*) as mean_count_firm_prod, # Note to use count(*), to include NULL
|
||||
sum(count_firm) / count(*) as mean_count_firm,
|
||||
sum(count_prod) / count(*) as mean_count_prod,
|
||||
sum(max_ts_firm_prod) / count(*) as mean_max_ts_firm_prod,
|
||||
sum(max_ts_firm) / count(*) as mean_max_ts_firm,
|
||||
sum(max_ts_prod) / count(*) as mean_max_ts_prod,
|
||||
sum(n_remove_firm_prod) / count(*) as mean_n_remove_firm_prod,
|
||||
sum(n_all_prod_remove_firm) / count(*) as mean_n_all_prod_remove_firm,
|
||||
sum(end_ts) / count(*) as mean_end_ts
|
||||
from (
|
||||
select sample.id, idx_scenario,
|
||||
count_firm_prod, count_firm, count_prod,
|
||||
max_ts_firm_prod, max_ts_firm, max_ts_prod,
|
||||
n_remove_firm_prod, n_all_prod_remove_firm, end_ts
|
||||
from iiabmdb.with_exp_sample as sample
|
||||
# 1 2 3 + 9
|
||||
left join iiabmdb.with_exp_experiment as experiment
|
||||
on sample.e_id = experiment.id
|
||||
left join (select s_id,
|
||||
count(distinct id_firm, id_product) as count_firm_prod,
|
||||
count(distinct id_firm) as count_firm,
|
||||
count(distinct id_product) as count_prod,
|
||||
max(ts) as end_ts
|
||||
from iiabmdb.with_exp_result group by s_id) as s_count
|
||||
on sample.id = s_count.s_id
|
||||
# 4
|
||||
left join # firm prod
|
||||
(select s_id, max(ts) as max_ts_firm_prod from
|
||||
(select s_id, id_firm, id_product, min(ts) as ts
|
||||
from iiabmdb.with_exp_result
|
||||
where `status` = "D"
|
||||
group by s_id, id_firm, id_product) as ts
|
||||
group by s_id) as s_max_ts_firm_prod
|
||||
on sample.id = s_max_ts_firm_prod.s_id
|
||||
# 5
|
||||
left join # firm
|
||||
(select s_id, max(ts) as max_ts_firm from
|
||||
(select s_id, id_firm, min(ts) as ts
|
||||
from iiabmdb.with_exp_result
|
||||
where `status` = "D"
|
||||
group by s_id, id_firm) as ts
|
||||
group by s_id) as s_max_ts_firm
|
||||
on sample.id = s_max_ts_firm.s_id
|
||||
# 6
|
||||
left join # prod
|
||||
(select s_id, max(ts) as max_ts_prod from
|
||||
(select s_id, id_product, min(ts) as ts
|
||||
from iiabmdb.with_exp_result
|
||||
where `status` = "D"
|
||||
group by s_id, id_product) as ts
|
||||
group by s_id) as s_max_ts_prod
|
||||
on sample.id = s_max_ts_prod.s_id
|
||||
# 7
|
||||
left join
|
||||
(select s_id, count(distinct id_firm, id_product) as n_remove_firm_prod
|
||||
from iiabmdb.with_exp_result
|
||||
where `status` = "R"
|
||||
group by s_id) as s_n_remove_firm_prod
|
||||
on sample.id = s_n_remove_firm_prod.s_id
|
||||
# 8
|
||||
left join
|
||||
(select s_id, count(distinct id_firm) as n_all_prod_remove_firm from
|
||||
(select s_id, id_firm, count(distinct id_product) as n_remove_prod
|
||||
from iiabmdb.with_exp_result
|
||||
where `status` = "R"
|
||||
group by s_id, id_firm) as s_n_remove_prod
|
||||
left join iiabmdb_basic_info.firm_n_prod as firm_n_prod
|
||||
on s_n_remove_prod.id_firm = firm_n_prod.code
|
||||
where n_remove_prod = n_prod
|
||||
group by s_id) as s_n_all_prod_remove_firm
|
||||
on sample.id = s_n_all_prod_remove_firm.s_id
|
||||
) as secnario_count
|
||||
group by idx_scenario
|
||||
) as secnario_mean
|
||||
on experiment.idx_scenario = secnario_mean.idx_scenario;
|
|
@ -0,0 +1,94 @@
|
|||
select * from iiabmdb.with_exp_result limit 0, 20;
|
||||
select count(distinct s_id) from iiabmdb.with_exp_result;
|
||||
select count(*) from iiabmdb.with_exp_sample;
|
||||
|
||||
select distinct s_id, id_firm, id_product from iiabmdb.with_exp_result order by s_id, id_firm, id_product;
|
||||
|
||||
select distinct s_id, count(distinct id_firm, id_product) as count_firm_prod from iiabmdb.with_exp_result group by s_id;
|
||||
|
||||
select distinct s_id, count(distinct id_firm, id_product) as count_firm_prod
|
||||
from iiabmdb.with_exp_result group by s_id;
|
||||
|
||||
select distinct s_id,
|
||||
count(distinct id_firm, id_product) as count_firm_prod,
|
||||
count(distinct id_firm) as count_firm,
|
||||
count(distinct id_product) as count_prod
|
||||
from iiabmdb.with_exp_result group by s_id;
|
||||
|
||||
# 控制问题需要处理,否则最后 experiment avg出来的东西不对
|
||||
# 1 2 3
|
||||
select
|
||||
idx_scenario,
|
||||
sum(count_firm_prod) / count(*) as mean_count_firm_prod, # Note to use count(*), to include NULL
|
||||
sum(count_firm) / count(*) as mean_count_firm,
|
||||
sum(count_prod) / count(*) as mean_count_prod
|
||||
from (
|
||||
select sample.id, idx_scenario, count_firm_prod, count_firm, count_prod
|
||||
from iiabmdb.with_exp_sample as sample
|
||||
left join iiabmdb.with_exp_experiment as experiment
|
||||
on sample.e_id = experiment.id
|
||||
left join (select s_id,
|
||||
count(distinct id_firm, id_product) as count_firm_prod,
|
||||
count(distinct id_firm) as count_firm,
|
||||
count(distinct id_product) as count_prod
|
||||
from iiabmdb.with_exp_result group by s_id) as s_count
|
||||
on sample.id = s_count.s_id) as secnario_count
|
||||
group by idx_scenario;
|
||||
|
||||
# 4 5 6
|
||||
select sample.id, idx_scenario, max_ts_firm_prod, max_ts_firm, max_ts_prod
|
||||
from iiabmdb.with_exp_sample as sample
|
||||
left join iiabmdb.with_exp_experiment as experiment
|
||||
on sample.e_id = experiment.id
|
||||
left join # firm prod
|
||||
(select s_id, max(ts) as max_ts_firm_prod from
|
||||
(select s_id, id_firm, id_product, min(ts) as ts
|
||||
from iiabmdb.with_exp_result
|
||||
where `status` = "D"
|
||||
group by s_id, id_firm, id_product) as ts
|
||||
group by s_id) as s_max_ts_firm_prod
|
||||
on sample.id = s_max_ts_firm_prod.s_id
|
||||
left join # firm
|
||||
(select s_id, max(ts) as max_ts_firm from
|
||||
(select s_id, id_firm, min(ts) as ts
|
||||
from iiabmdb.with_exp_result
|
||||
where `status` = "D"
|
||||
group by s_id, id_firm) as ts
|
||||
group by s_id) as s_max_ts_firm
|
||||
on sample.id = s_max_ts_firm.s_id
|
||||
left join # prod
|
||||
(select s_id, max(ts) as max_ts_prod from
|
||||
(select s_id, id_product, min(ts) as ts
|
||||
from iiabmdb.with_exp_result
|
||||
where `status` = "D"
|
||||
group by s_id, id_product) as ts
|
||||
group by s_id) as s_max_ts_prod
|
||||
on sample.id = s_max_ts_prod.s_id;
|
||||
|
||||
# 7 8 9
|
||||
select sample.id, idx_scenario, n_remove_firm_prod, n_all_prod_remove_firm, end_ts
|
||||
from iiabmdb.with_exp_sample as sample
|
||||
left join iiabmdb.with_exp_experiment as experiment
|
||||
on sample.e_id = experiment.id
|
||||
left join
|
||||
(select s_id, count(distinct id_firm, id_product) as n_remove_firm_prod
|
||||
from iiabmdb.with_exp_result
|
||||
where `status` = "R"
|
||||
group by s_id) as s_n_remove_firm_prod
|
||||
on sample.id = s_n_remove_firm_prod.s_id
|
||||
left join
|
||||
(select s_id, count(distinct id_firm) as n_all_prod_remove_firm from
|
||||
(select s_id, id_firm, count(distinct id_product) as n_remove_prod
|
||||
from iiabmdb.with_exp_result
|
||||
where `status` = "R"
|
||||
group by s_id, id_firm) as s_n_remove_prod
|
||||
left join iiabmdb_basic_info.firm_n_prod as firm_n_prod
|
||||
on s_n_remove_prod.id_firm = firm_n_prod.code
|
||||
where n_remove_prod = n_prod
|
||||
group by s_id) as s_n_all_prod_remove_firm
|
||||
on sample.id = s_n_all_prod_remove_firm.s_id
|
||||
left join
|
||||
(select s_id, max(ts) as end_ts
|
||||
from iiabmdb.with_exp_result
|
||||
group by s_id) as s_end_ts
|
||||
on sample.id = s_end_ts.s_id;
|
Binary file not shown.
|
@ -0,0 +1,11 @@
|
|||
,mean_count_firm_prod,mean_count_firm,mean_count_prod,mean_max_ts_firm_prod,mean_max_ts_firm,mean_max_ts_prod,mean_n_remove_firm_prod,mean_n_all_prod_remove_firm,mean_end_ts
|
||||
prf_size,0.004,0.004,0.004,0.004,0.004,0.004,0.973,0.953,0.018
|
||||
prf_conn,0.884,0.884,0.841,0.841,0.841,0.841,0.821,0.888,0.63
|
||||
cap_limit_prob_type,0.708,0.723,0.517,0.517,0.517,0.517,0.002,0.001,0.002
|
||||
n_max_trial,0.611,0.613,0.724,0.724,0.724,0.724,0.898,0.869,0.796
|
||||
cap_limit_level,0.243,0.254,0.118,0.118,0.118,0.118,0,0,0
|
||||
diff_new_conn,0.216,0.229,0.058,0.058,0.058,0.058,0.002,0.002,0
|
||||
crit_supplier,0,0,0,0,0,0,0,0,0
|
||||
proactive_ratio,0.66,0.651,0.572,0.572,0.572,0.572,0.258,0.399,0.367
|
||||
remove_t,0.464,0.465,0.546,0.546,0.546,0.546,0.026,0.186,0
|
||||
netw_prf_n,0,0,0,0,0,0,0.019,0.069,0.003
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 64 KiB |
|
@ -0,0 +1,15 @@
|
|||
自变量,level,企业产品中断累计次数,企业产品中断最大传导次数,企业产品退出市场数量,网络恢复用时
|
||||
对规模较大企业的倾向,倾向,2.168,0.8939,0.7698,2.214
|
||||
对规模较大企业的倾向,不倾向,2.393,1.0197,0.7709,2.334
|
||||
额外产能,高,2.197,0.8991,0.6667,2.05
|
||||
额外产能,中,2.323,0.9772,0.7891,2.33
|
||||
额外产能,低,2.322,0.9941,0.8553,2.442
|
||||
可重构性,低,2.367,1.0258,0.8611,2.515
|
||||
可重构性,中,2.228,0.9255,0.7274,2.195
|
||||
可重构性,高,2.247,0.9191,0.7226,2.111
|
||||
单一供应商重要性,低,1.915,0.7324,0.6919,2.111
|
||||
单一供应商重要性,中,2.219,0.9477,0.7478,2.242
|
||||
单一供应商重要性,高,2.708,1.1902,0.8713,2.469
|
||||
多供应商策略,三供应商,2.066,0.8281,0.7193,2.189
|
||||
多供应商策略,双供应商,2.253,0.9342,0.7568,2.23
|
||||
多供应商策略,单供应商,2.523,1.1081,0.8349,2.402
|
|
|
@ -0,0 +1,28 @@
|
|||
,n_max_trial,crit_supplier,firm_pref_request,firm_pref_accept,netw_pref_cust_n,netw_pref_cust_size,cap_limit,diff_new_conn,diff_remove,X10,X11,X12,X13,n_disrupt_s,n_disrupt_t
|
||||
0,15,2.0,2.0,2.0,0.5,2.0,4,0.5,0.5,0,0,0,0,888.0,2114.0
|
||||
1,15,2.0,2.0,2.0,1.0,1.0,2,1.0,1.0,1,1,1,1,1297.0,2810.0
|
||||
2,15,2.0,2.0,2.0,2.0,0.5,1,2.0,2.0,2,2,2,2,1826.0,3809.0
|
||||
3,15,1.0,1.0,1.0,0.5,2.0,4,1.0,1.0,1,2,2,2,1372.0,3055.0
|
||||
4,15,1.0,1.0,1.0,1.0,1.0,2,2.0,2.0,2,0,0,0,2118.0,4519.0
|
||||
5,15,1.0,1.0,1.0,2.0,0.5,1,0.5,0.5,0,1,1,1,815.0,2073.0
|
||||
6,15,0.5,0.5,0.5,0.5,2.0,4,2.0,2.0,2,1,1,1,2378.0,5528.0
|
||||
7,15,0.5,0.5,0.5,1.0,1.0,2,0.5,0.5,0,2,2,2,968.0,2300.0
|
||||
8,15,0.5,0.5,0.5,2.0,0.5,1,1.0,1.0,1,0,0,0,1531.0,3317.0
|
||||
9,10,2.0,1.0,0.5,0.5,1.0,1,0.5,1.0,2,0,1,2,881.0,1972.0
|
||||
10,10,2.0,1.0,0.5,1.0,0.5,4,1.0,2.0,0,1,2,0,1298.0,2763.0
|
||||
11,10,2.0,1.0,0.5,2.0,2.0,2,2.0,0.5,1,2,0,1,1717.0,3837.0
|
||||
12,10,1.0,0.5,2.0,0.5,1.0,1,1.0,2.0,0,2,0,1,1327.0,2855.0
|
||||
13,10,1.0,0.5,2.0,1.0,0.5,4,2.0,0.5,1,0,1,2,2126.0,4788.0
|
||||
14,10,1.0,0.5,2.0,2.0,2.0,2,0.5,1.0,2,1,2,0,801.0,1814.0
|
||||
15,10,0.5,2.0,1.0,0.5,1.0,1,2.0,0.5,1,1,2,0,2442.0,5980.0
|
||||
16,10,0.5,2.0,1.0,1.0,0.5,4,0.5,1.0,2,2,0,1,991.0,2186.0
|
||||
17,10,0.5,2.0,1.0,2.0,2.0,2,1.0,2.0,0,0,1,2,1311.0,2776.0
|
||||
18,5,2.0,0.5,1.0,0.5,0.5,2,0.5,2.0,1,0,2,1,879.0,1909.0
|
||||
19,5,2.0,0.5,1.0,1.0,2.0,1,1.0,0.5,2,1,0,2,1354.0,3132.0
|
||||
20,5,2.0,0.5,1.0,2.0,1.0,4,2.0,1.0,0,2,1,0,1727.0,3673.0
|
||||
21,5,1.0,2.0,0.5,0.5,0.5,2,1.0,0.5,2,2,1,0,1379.0,3184.0
|
||||
22,5,1.0,2.0,0.5,1.0,2.0,1,2.0,1.0,0,0,2,1,2145.0,4658.0
|
||||
23,5,1.0,2.0,0.5,2.0,1.0,4,0.5,2.0,1,1,0,2,810.0,1764.0
|
||||
24,5,0.5,1.0,2.0,0.5,0.5,2,2.0,1.0,0,1,0,2,2412.0,5783.0
|
||||
25,5,0.5,1.0,2.0,1.0,2.0,1,0.5,2.0,1,2,1,0,915.0,1973.0
|
||||
26,5,0.5,1.0,2.0,2.0,1.0,4,1.0,0.5,2,0,2,1,1336.0,3087.0
|
|
|
@ -1,28 +1,37 @@
|
|||
,n_max_trial,crit_supplier,firm_pref_request,firm_pref_accept,netw_pref_cust_n,netw_pref_cust_size,cap_limit,diff_new_conn,diff_remove,X10,X11,X12,X13,n_disrupt_s,n_disrupt_t
|
||||
0,15,2.0,2.0,2.0,0.5,2.0,4,0.5,0.5,0,0,0,0,888.0,2114.0
|
||||
1,15,2.0,2.0,2.0,1.0,1.0,2,1.0,1.0,1,1,1,1,1297.0,2810.0
|
||||
2,15,2.0,2.0,2.0,2.0,0.5,1,2.0,2.0,2,2,2,2,1826.0,3809.0
|
||||
3,15,1.0,1.0,1.0,0.5,2.0,4,1.0,1.0,1,2,2,2,1372.0,3055.0
|
||||
4,15,1.0,1.0,1.0,1.0,1.0,2,2.0,2.0,2,0,0,0,2118.0,4519.0
|
||||
5,15,1.0,1.0,1.0,2.0,0.5,1,0.5,0.5,0,1,1,1,815.0,2073.0
|
||||
6,15,0.5,0.5,0.5,0.5,2.0,4,2.0,2.0,2,1,1,1,2378.0,5528.0
|
||||
7,15,0.5,0.5,0.5,1.0,1.0,2,0.5,0.5,0,2,2,2,968.0,2300.0
|
||||
8,15,0.5,0.5,0.5,2.0,0.5,1,1.0,1.0,1,0,0,0,1531.0,3317.0
|
||||
9,10,2.0,1.0,0.5,0.5,1.0,1,0.5,1.0,2,0,1,2,881.0,1972.0
|
||||
10,10,2.0,1.0,0.5,1.0,0.5,4,1.0,2.0,0,1,2,0,1298.0,2763.0
|
||||
11,10,2.0,1.0,0.5,2.0,2.0,2,2.0,0.5,1,2,0,1,1717.0,3837.0
|
||||
12,10,1.0,0.5,2.0,0.5,1.0,1,1.0,2.0,0,2,0,1,1327.0,2855.0
|
||||
13,10,1.0,0.5,2.0,1.0,0.5,4,2.0,0.5,1,0,1,2,2126.0,4788.0
|
||||
14,10,1.0,0.5,2.0,2.0,2.0,2,0.5,1.0,2,1,2,0,801.0,1814.0
|
||||
15,10,0.5,2.0,1.0,0.5,1.0,1,2.0,0.5,1,1,2,0,2442.0,5980.0
|
||||
16,10,0.5,2.0,1.0,1.0,0.5,4,0.5,1.0,2,2,0,1,991.0,2186.0
|
||||
17,10,0.5,2.0,1.0,2.0,2.0,2,1.0,2.0,0,0,1,2,1311.0,2776.0
|
||||
18,5,2.0,0.5,1.0,0.5,0.5,2,0.5,2.0,1,0,2,1,879.0,1909.0
|
||||
19,5,2.0,0.5,1.0,1.0,2.0,1,1.0,0.5,2,1,0,2,1354.0,3132.0
|
||||
20,5,2.0,0.5,1.0,2.0,1.0,4,2.0,1.0,0,2,1,0,1727.0,3673.0
|
||||
21,5,1.0,2.0,0.5,0.5,0.5,2,1.0,0.5,2,2,1,0,1379.0,3184.0
|
||||
22,5,1.0,2.0,0.5,1.0,2.0,1,2.0,1.0,0,0,2,1,2145.0,4658.0
|
||||
23,5,1.0,2.0,0.5,2.0,1.0,4,0.5,2.0,1,1,0,2,810.0,1764.0
|
||||
24,5,0.5,1.0,2.0,0.5,0.5,2,2.0,1.0,0,1,0,2,2412.0,5783.0
|
||||
25,5,0.5,1.0,2.0,1.0,2.0,1,0.5,2.0,1,2,1,0,915.0,1973.0
|
||||
26,5,0.5,1.0,2.0,2.0,1.0,4,1.0,0.5,2,0,2,1,1336.0,3087.0
|
||||
idx_scenario,n_max_trial,prf_size,prf_conn,cap_limit_prob_type,cap_limit_level,diff_new_conn,crit_supplier,proactive_ratio,remove_t,netw_prf_n,mean_count_firm_prod,mean_count_firm,mean_count_prod,mean_max_ts_firm_prod,mean_max_ts_firm,mean_max_ts_prod,mean_n_remove_firm_prod,mean_n_all_prod_remove_firm,mean_end_ts
|
||||
0,15,1,1,uniform,5.0000,0.3000,2.0000,0.3000,3,3,1.5512,1.5509,1.4943,0.4943,0.4943,0.4943,0.6731,0.2280,1.6345
|
||||
1,10,1,1,uniform,10.0000,0.5000,1.0000,0.5000,5,2,2.2707,2.2663,1.9623,0.9623,0.9623,0.9623,0.7522,0.2531,2.2764
|
||||
2,5,1,1,uniform,15.0000,0.7000,0.5000,0.7000,7,1,2.5655,2.5608,2.1337,1.1337,1.1337,1.1337,0.9021,0.2926,2.9874
|
||||
3,15,1,1,uniform,5.0000,0.3000,2.0000,0.5000,5,2,1.7114,1.7105,1.6135,0.6135,0.6135,0.6135,0.6200,0.2120,1.9855
|
||||
4,10,1,1,uniform,10.0000,0.5000,1.0000,0.7000,7,1,2.5322,2.5274,2.1114,1.1114,1.1114,1.1114,0.7952,0.2648,2.8876
|
||||
5,5,1,1,uniform,15.0000,0.7000,0.5000,0.3000,3,3,2.6476,2.6406,2.1886,1.1886,1.1886,1.1886,1.0303,0.3255,1.9575
|
||||
6,15,1,1,normal,5.0000,0.5000,0.5000,0.3000,5,1,2.5272,2.5240,2.1017,1.1017,1.1017,1.1017,0.6444,0.2194,2.1438
|
||||
7,10,1,1,normal,10.0000,0.7000,2.0000,0.5000,7,3,1.5282,1.5282,1.4699,0.4699,0.4699,0.4699,0.6044,0.2116,2.2133
|
||||
8,5,1,1,normal,15.0000,0.3000,1.0000,0.7000,3,2,2.2128,2.2109,1.9781,0.9781,0.9781,0.9781,0.9743,0.3023,1.9869
|
||||
9,15,1,0,uniform,5.0000,0.7000,1.0000,0.3000,7,2,2.1539,2.1537,1.8821,0.8821,0.8821,0.8821,0.6004,0.2105,2.2248
|
||||
10,10,1,0,uniform,10.0000,0.3000,0.5000,0.5000,3,1,2.6907,2.6804,2.2434,1.2434,1.2434,1.2434,1.2832,0.4072,2.3133
|
||||
11,5,1,0,uniform,15.0000,0.5000,2.0000,0.7000,5,3,1.5537,1.5537,1.4971,0.4971,0.4971,0.4971,0.6411,0.2211,1.9853
|
||||
12,15,1,0,normal,10.0000,0.7000,2.0000,0.7000,5,3,1.5175,1.5175,1.4638,0.4638,0.4638,0.4638,0.6046,0.2114,1.8941
|
||||
13,10,1,0,normal,15.0000,0.3000,1.0000,0.3000,7,2,2.1682,2.1651,1.9512,0.9512,0.9512,0.9512,0.6973,0.2375,2.7838
|
||||
14,5,1,0,normal,5.0000,0.5000,0.5000,0.5000,3,1,2.5267,2.5240,2.1029,1.1029,1.1029,1.1029,0.7956,0.2457,1.7884
|
||||
15,15,1,0,normal,10.0000,0.7000,1.0000,0.3000,3,1,2.4596,2.4587,2.0507,1.0507,1.0507,1.0507,0.6937,0.2295,1.6522
|
||||
16,10,1,0,normal,15.0000,0.3000,0.5000,0.5000,5,3,2.7004,2.6901,2.2154,1.2154,1.2154,1.2154,0.9398,0.3189,2.8446
|
||||
17,5,1,0,normal,5.0000,0.5000,2.0000,0.7000,7,2,1.7141,1.7141,1.6295,0.6295,0.6295,0.6295,0.6053,0.2114,2.2872
|
||||
18,15,0,1,normal,10.0000,0.3000,0.5000,0.7000,7,3,2.8486,2.8417,2.2505,1.2505,1.2505,1.2505,0.7427,0.2592,3.1507
|
||||
19,10,0,1,normal,15.0000,0.5000,2.0000,0.3000,3,2,1.7124,1.7124,1.6343,0.6343,0.6343,0.6343,0.6604,0.2232,1.6145
|
||||
20,5,0,1,normal,5.0000,0.7000,1.0000,0.5000,5,1,2.4396,2.4394,2.0387,1.0387,1.0387,1.0387,0.6063,0.2114,1.9457
|
||||
21,15,0,1,normal,10.0000,0.5000,0.5000,0.7000,3,2,2.8352,2.8280,2.2059,1.2059,1.2059,1.2059,0.8535,0.2636,1.8619
|
||||
22,10,0,1,normal,15.0000,0.7000,2.0000,0.3000,5,1,2.4427,2.4400,2.0472,1.0472,1.0472,1.0472,0.7229,0.2371,2.1480
|
||||
23,5,0,1,normal,5.0000,0.3000,1.0000,0.5000,7,3,1.9760,1.9726,1.8200,0.8200,0.8200,0.8200,0.6333,0.2156,2.5817
|
||||
24,15,0,1,uniform,15.0000,0.5000,2.0000,0.5000,7,1,2.4941,2.4874,2.0964,1.0964,1.0964,1.0964,0.8709,0.2819,3.1027
|
||||
25,10,0,1,uniform,5.0000,0.7000,1.0000,0.7000,3,3,1.8998,1.8989,1.7728,0.7728,0.7728,0.7728,0.6528,0.2213,1.6143
|
||||
26,5,0,1,uniform,10.0000,0.3000,0.5000,0.3000,5,2,2.9478,2.9360,2.3718,1.3718,1.3718,1.3718,1.0644,0.3634,3.0396
|
||||
27,15,0,0,normal,15.0000,0.5000,1.0000,0.5000,3,3,1.9505,1.9486,1.7987,0.7987,0.7987,0.7987,0.7731,0.2469,1.7459
|
||||
28,10,0,0,normal,5.0000,0.7000,0.5000,0.7000,5,2,2.7389,2.7375,2.1211,1.1211,1.1211,1.1211,0.6069,0.2114,1.9503
|
||||
29,5,0,0,normal,10.0000,0.3000,2.0000,0.3000,7,1,2.5236,2.5166,2.1179,1.1179,1.1179,1.1179,0.6844,0.2288,2.8678
|
||||
30,15,0,0,uniform,15.0000,0.7000,0.5000,0.5000,7,2,2.8101,2.8011,2.2076,1.2076,1.2076,1.2076,0.9796,0.3160,3.1324
|
||||
31,10,0,0,uniform,5.0000,0.3000,2.0000,0.7000,3,1,2.4699,2.4632,2.0718,1.0718,1.0718,1.0718,0.9488,0.2821,1.9815
|
||||
32,5,0,0,uniform,10.0000,0.5000,1.0000,0.3000,5,3,1.9579,1.9571,1.8257,0.8257,0.8257,0.8257,0.7234,0.2457,2.1928
|
||||
33,15,0,0,uniform,15.0000,0.3000,1.0000,0.7000,5,1,2.6051,2.5958,2.1811,1.1811,1.1811,1.1811,1.0716,0.3459,3.0091
|
||||
34,10,0,0,uniform,5.0000,0.5000,0.5000,0.3000,7,3,2.6592,2.6562,2.1402,1.1402,1.1402,1.1402,0.6135,0.2147,2.4573
|
||||
35,5,0,0,uniform,10.0000,0.7000,2.0000,0.5000,3,2,1.7640,1.7640,1.6526,0.6526,0.6526,0.6526,0.6672,0.2246,1.6143
|
||||
|
|
|
41
anova.py
41
anova.py
|
@ -110,49 +110,16 @@ def anova(lst_col_seg, n_level, oa_file, result_file, alpha=0.1):
|
|||
|
||||
if __name__ == '__main__':
|
||||
# prep data
|
||||
str_sql = """
|
||||
select * from
|
||||
(select distinct idx_scenario, n_max_trial, crit_supplier,
|
||||
firm_pref_request, firm_pref_accept, netw_pref_cust_n,
|
||||
netw_pref_cust_size, cap_limit, diff_new_conn, diff_remove
|
||||
from iiabmdb.with_exp_experiment) as a
|
||||
inner join
|
||||
(
|
||||
select idx_scenario,
|
||||
sum(n_disrupt_s) as n_disrupt_s, sum(n_disrupt_t) as n_disrupt_t from
|
||||
iiabmdb.with_exp_experiment as a
|
||||
inner join
|
||||
(
|
||||
select e_id, count(n_s_disrupt_t) as n_disrupt_s,
|
||||
sum(n_s_disrupt_t) as n_disrupt_t from
|
||||
iiabmdb.with_exp_sample as a
|
||||
inner join
|
||||
(select a.s_id as s_id, count(id) as n_s_disrupt_t from
|
||||
iiabmdb.with_exp_result as a
|
||||
inner join
|
||||
(select distinct s_id from iiabmdb.with_exp_result where ts > 0) as b
|
||||
on a.s_id = b.s_id
|
||||
group by s_id
|
||||
) as b
|
||||
on a.id = b.s_id
|
||||
group by e_id
|
||||
) as b
|
||||
on a.id = b.e_id
|
||||
group by idx_scenario) as b
|
||||
on a.idx_scenario = b.idx_scenario;
|
||||
|
||||
"""
|
||||
result = pd.read_sql(sql=str_sql,
|
||||
con=engine)
|
||||
result = pd.read_csv("experiment_result.csv", index_col=None)
|
||||
result.drop('idx_scenario', 1, inplace=True)
|
||||
df_oa = pd.read_csv("oa_with_exp.csv", index_col=None)
|
||||
result = pd.concat(
|
||||
scenario_result = pd.concat(
|
||||
[result.iloc[:, 0:10],
|
||||
df_oa.iloc[:, -4:],
|
||||
result.iloc[:, -2:]], axis=1)
|
||||
result.to_csv('analysis\\experiment_result.csv')
|
||||
|
||||
# 9 factors (X), 4 for error (E), and 2 indicators (Y)
|
||||
the_lst_col_seg = [10, 3, 2]
|
||||
# 10 factors (X), 13 for error (E), and 9 indicators (Y)
|
||||
the_lst_col_seg = [10, 13, 9]
|
||||
the_n_level = 3
|
||||
anova(the_lst_col_seg, the_n_level, "oa25.txt", result, 0.1)
|
||||
|
|
BIN
anova.xlsx
BIN
anova.xlsx
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,14 @@
|
|||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
import seaborn as sns
|
||||
|
||||
df_anova = pd.read_csv('analysis/anova.csv', index_col=0)
|
||||
df_anova = df_anova.stack().reset_index()
|
||||
df_anova.rename(columns={'level_0': 'x',
|
||||
'level_1': 'y type',
|
||||
0: 'p value'}, inplace=True)
|
||||
print(df_anova)
|
||||
sns.set_theme(style="whitegrid")
|
||||
g = sns.catplot(data=df_anova, kind="bar", x="x", y="p value", hue="y type")
|
||||
g.set_xticklabels(rotation=30)
|
||||
plt.show()
|
Binary file not shown.
|
@ -0,0 +1,172 @@
|
|||
code,n_prod
|
||||
0,1
|
||||
1,1
|
||||
2,1
|
||||
3,4
|
||||
4,1
|
||||
5,4
|
||||
6,5
|
||||
7,1
|
||||
8,1
|
||||
9,2
|
||||
10,1
|
||||
11,1
|
||||
12,1
|
||||
13,17
|
||||
14,2
|
||||
15,1
|
||||
16,4
|
||||
17,1
|
||||
18,1
|
||||
19,1
|
||||
20,1
|
||||
21,1
|
||||
22,24
|
||||
23,10
|
||||
24,1
|
||||
25,1
|
||||
26,7
|
||||
27,1
|
||||
28,1
|
||||
29,1
|
||||
30,1
|
||||
31,7
|
||||
32,1
|
||||
33,4
|
||||
34,1
|
||||
35,1
|
||||
36,1
|
||||
37,6
|
||||
38,5
|
||||
39,1
|
||||
40,4
|
||||
41,7
|
||||
42,3
|
||||
43,2
|
||||
44,1
|
||||
45,9
|
||||
46,1
|
||||
47,9
|
||||
48,1
|
||||
49,8
|
||||
50,1
|
||||
51,1
|
||||
52,1
|
||||
53,15
|
||||
54,3
|
||||
55,6
|
||||
56,2
|
||||
57,4
|
||||
58,7
|
||||
59,1
|
||||
60,5
|
||||
61,1
|
||||
62,5
|
||||
63,3
|
||||
64,1
|
||||
65,1
|
||||
66,1
|
||||
67,1
|
||||
68,3
|
||||
69,1
|
||||
70,2
|
||||
71,1
|
||||
72,1
|
||||
73,1
|
||||
74,2
|
||||
75,1
|
||||
76,1
|
||||
77,2
|
||||
78,5
|
||||
79,16
|
||||
80,2
|
||||
81,4
|
||||
82,4
|
||||
83,1
|
||||
84,3
|
||||
85,2
|
||||
86,1
|
||||
87,1
|
||||
88,1
|
||||
89,3
|
||||
90,1
|
||||
91,1
|
||||
92,1
|
||||
93,1
|
||||
94,1
|
||||
95,2
|
||||
96,2
|
||||
97,3
|
||||
98,1
|
||||
99,6
|
||||
100,1
|
||||
101,1
|
||||
102,2
|
||||
103,1
|
||||
104,1
|
||||
105,1
|
||||
106,6
|
||||
107,1
|
||||
108,2
|
||||
109,1
|
||||
110,1
|
||||
111,3
|
||||
112,1
|
||||
113,1
|
||||
114,1
|
||||
115,2
|
||||
116,1
|
||||
117,11
|
||||
118,1
|
||||
119,1
|
||||
120,1
|
||||
121,1
|
||||
122,1
|
||||
123,1
|
||||
124,2
|
||||
125,1
|
||||
126,7
|
||||
127,2
|
||||
128,1
|
||||
129,2
|
||||
130,5
|
||||
131,5
|
||||
132,1
|
||||
133,2
|
||||
134,1
|
||||
135,11
|
||||
136,1
|
||||
137,6
|
||||
138,1
|
||||
139,1
|
||||
140,7
|
||||
141,1
|
||||
142,3
|
||||
143,5
|
||||
144,4
|
||||
145,1
|
||||
146,1
|
||||
147,1
|
||||
148,3
|
||||
149,4
|
||||
150,1
|
||||
151,1
|
||||
152,1
|
||||
153,2
|
||||
154,6
|
||||
155,1
|
||||
156,1
|
||||
157,1
|
||||
158,1
|
||||
159,1
|
||||
160,1
|
||||
161,3
|
||||
162,2
|
||||
163,6
|
||||
164,1
|
||||
165,4
|
||||
166,1
|
||||
167,1
|
||||
168,7
|
||||
169,1
|
||||
170,1
|
|
BIN
oa_with_exp.xlsx
BIN
oa_with_exp.xlsx
Binary file not shown.
Loading…
Reference in New Issue