Usage: scenario analysis¶
This is a quick tour of CovsirPhy. Details scenario analysis will be explained. “Scenario analysis” means that we calculate the number of cases in the future phases with some sets of ODE parameter values. With this analysis, we can estimate the impact of our activities against the outbreak on the number of cases.
Preparation¶
Prepare the packages.
[1]:
# !pip install covsirphy --upgrade
from pprint import pprint
import covsirphy as cs
cs.__version__
[1]:
'2.20.3-eta-fu1'
Dataset preparation¶
[2]:
loader = cs.DataLoader("../input")
# The number of cases and population values
jhu_data = loader.jhu()
# Government Response Tracker (OxCGRT)
oxcgrt_data = loader.oxcgrt()
# The number of tests
pcr_data = loader.pcr()
# The number of vaccinations
vaccine_data = loader.vaccine()
Start scenario analysis¶
As an example, we will analysis the number of cases in Japan. covsirphy.Scenario
is the interface for analysis. Please specify the area (country: required, province: optional) when creating the instance and register the datasets with Scenario.register()
. As the extra datasets, we can select OxCGRTData
, PCRData
, VaccineData
and CountryData
.
[3]:
# Specify country and province (optinal) names
snl = cs.Scenario(country="Japan", province=None)
# Register datasets
snl.register(jhu_data, extras=[oxcgrt_data, pcr_data, vaccine_data])
JHUData
as “the main datasets” because they are required to calculate the number of susceptible/infected/recovered/fatal cases. These variables are used in SIR-F model.PopulationData
is required because JHUData
does not include population values.population_data = data_loader.population()
snl.register(jhu_data, population_data)
Additional information:
Details of the datasets: Usage: datasets
Details of SIR-F model: Usage: SIR-derived models
Display/save figures¶
We have intactive mode and script mode to display/save figures.
When use use interactive shells, including Jupyter Notebook, we can choose either “interactive shell mode” or “script mode” as follows.
[4]:
# Choose interactive mode (default is True when we use interactive shells)
snl.interactive = True
When you want to turn-off interactive mode temporarlly, set False
as Scenario.interactive
or apply show_figure=False
as an argument of methods, including Scenario.records()
. Methods with figures will be shown later in this tutorial.
[5]:
# apply "show_figures=False" to turn-off intaractive mode temporally
# snl.records(show_figure=False)
filename
argument, figures will be saved in your local environment.[6]:
# Stop displaying figures
# snl.interactive = False
# With this mode we can save figures, specifying "filename" argument
# snl.records(filename="records.jpg")
When we run codes as a script (eg. python scenario_analysis.py
), only “script mode” is selectable and Scenario.interactive
is always False
. Figures will be saved when filenames are specified with filename
argument.
Because some methods, including Scenario.summary()
, return dataframes (pandas.DataFrame
), we can save them as CSV files etc. using .to_csv(filename, index=True)
.
We can produce filenames more easily with Filer
class. Please refer to the scripts in example directory of the repository.
[7]:
filer = cs.Filer(directory="output", prefix="jpn", suffix=None, numbering="01")
# filer.png("records")
# -> {"filename": "<absolute path>/output/jpn_01_records.png"}
# filer.jpg("records")
# -> {"filename": "<absolute path>/output/jpn_01_records.jpg"}
# filer.csv("records", index=True)
# -> {"path_or_buf": "<absolute path>/output/jpn_01_records.csv", index: True}
We can save files more easily with Filer
as follows.
[8]:
# record_df = snl.records(**filer.png("records"))
# record_df.to_csv(**filer.csv("records", index=False))
Backup/restore scenario¶
From development version 2.19.1-kappa, we have Scenario.backup(filename)
and Scenario.restore(filename)
to backup/restore timepoints and phase information. This will be helpful when we perform parameter estimation using a server and simulate with the estimated parameter values using local machines.
Note that we need to execute Scenario.register()
in advance to set timepoints with Scenario.restore()
.
Backup information:
[9]:
# backupfile_dict = cs.Filer(directory="output")
# snl.backup(**backupfile_dict)
Restore information:
[10]:
# backupfile_dict = cs.Filer(directory="output")
# snl = cs.Scenario(country="Japan")
# snl.register(jhu_data)
# snl.restore(**backupfile_dict).summary()
After restoring information, we can skip Scenario.trend()
and Scenario.estiate()
(their functionarities will be explaiend later).
Check records¶
Let’s see the records at first. Scenario.records()
method return the records as a pandas dataframe and show a line plot. Some kind of complement will be done for analysis, if necessary.
Scenario.records()
shows the number of infected/recovered/fatal cases as default. Using variables
argument, we can set the variables to show. Here, we chack the number of confirmed/fatal/recovered cases. They are cumurative values.
[11]:
snl.records(variables="CFR").tail()
# This is the same as
# snl.records(variables=["Confirmed", "Fatal", "Recovered"])
[11]:
| Date | Confirmed | Fatal | Recovered | |
|---|---|---|---|---|
| 492 | 2021-06-12 | 771840 | 13977 | 724804 |
| 493 | 2021-06-13 | 773822 | 14033 | 727730 |
| 494 | 2021-06-14 | 775231 | 14071 | 730446 |
| 495 | 2021-06-15 | 776307 | 14126 | 733316 |
| 496 | 2021-06-16 | 777643 | 14187 | 736941 |
The number of infected cases on date:
[12]:
_ = snl.records(variables="I")
# This is the same as
# snl.records(variables=["Infected"])
All available variables can be retrieved with variables="all"
.
[13]:
df = snl.records(variables="all", show_figure=False)
pprint(df.set_index("Date").columns.tolist(), compact=True)
['Confirmed', 'Infected', 'Fatal', 'Recovered', 'Susceptible', 'School_closing',
'Workplace_closing', 'Cancel_events', 'Gatherings_restrictions',
'Transport_closing', 'Stay_home_restrictions',
'Internal_movement_restrictions', 'International_movement_restrictions',
'Information_campaigns', 'Testing_policy', 'Contact_tracing',
'Stringency_index', 'Tests', 'Tests_diff', 'Vaccinations', 'Vaccinated_once',
'Vaccinated_full']
We can specify the variables to show.
[14]:
snl.records(variables=["Vaccinated_once"]).tail()
[14]:
| Date | Vaccinated_once | |
|---|---|---|
| 492 | 2021-06-12 | 15942264 |
| 493 | 2021-06-13 | 17580587 |
| 494 | 2021-06-14 | 18436101 |
| 495 | 2021-06-15 | 19262621 |
| 496 | 2021-06-16 | 19262621 |
We can calculate the number of daily new cases with Scenario.record_diff()
method.
[15]:
# Acceptable variables are the same as Scenario.records()
_ = snl.records_diff(variables="C", window=7)
Scenario.show_complement()
method is useful to show the kinds of complement. The details of complement are explained in Usage: datasets section.
[16]:
# Show the details of complement
snl.show_complement()
[16]:
| Country | Province | Monotonic_confirmed | Monotonic_fatal | Monotonic_recovered | Full_recovered | Partial_recovered | |
|---|---|---|---|---|---|---|---|
| 0 | Japan | - | False | True | True | False | True |
S-R trend analysis¶
S-R trend analysis finds the change points of SIR-derived ODE parameters. Details will be explained in Usage (details: phases). Phases will be separated with dotted lines. i.e. Dot lines indicate the start dates of phases.
[17]:
snl.trend().summary()
[17]:
| Type | Start | End | Population | |
|---|---|---|---|---|
| 0th | Past | 06Feb2020 | 18Feb2020 | 126529100 |
| 1st | Past | 19Feb2020 | 05Mar2020 | 126529100 |
| 2nd | Past | 06Mar2020 | 13Mar2020 | 126529100 |
| 3rd | Past | 14Mar2020 | 24Mar2020 | 126529100 |
| 4th | Past | 25Mar2020 | 02Apr2020 | 126529100 |
| 5th | Past | 03Apr2020 | 10Apr2020 | 126529100 |
| 6th | Past | 11Apr2020 | 23Apr2020 | 126529100 |
| 7th | Past | 24Apr2020 | 02May2020 | 126529100 |
| 8th | Past | 03May2020 | 13May2020 | 126529100 |
| 9th | Past | 14May2020 | 28May2020 | 126529100 |
| 10th | Past | 29May2020 | 10Jun2020 | 126529100 |
| 11th | Past | 11Jun2020 | 23Jun2020 | 126529100 |
| 12th | Past | 24Jun2020 | 03Jul2020 | 126529100 |
| 13th | Past | 04Jul2020 | 16Jul2020 | 126529100 |
| 14th | Past | 17Jul2020 | 30Jul2020 | 126529100 |
| 15th | Past | 31Jul2020 | 13Aug2020 | 126529100 |
| 16th | Past | 14Aug2020 | 26Aug2020 | 126529100 |
| 17th | Past | 27Aug2020 | 10Sep2020 | 126529100 |
| 18th | Past | 11Sep2020 | 25Sep2020 | 126529100 |
| 19th | Past | 26Sep2020 | 09Oct2020 | 126529100 |
| 20th | Past | 10Oct2020 | 17Oct2020 | 126529100 |
| 21st | Past | 18Oct2020 | 26Oct2020 | 126529100 |
| 22nd | Past | 27Oct2020 | 09Nov2020 | 126529100 |
| 23rd | Past | 10Nov2020 | 21Nov2020 | 126529100 |
| 24th | Past | 22Nov2020 | 03Dec2020 | 126529100 |
| 25th | Past | 04Dec2020 | 16Dec2020 | 126529100 |
| 26th | Past | 17Dec2020 | 29Dec2020 | 126529100 |
| 27th | Past | 30Dec2020 | 12Jan2021 | 126529100 |
| 28th | Past | 13Jan2021 | 20Jan2021 | 126529100 |
| 29th | Past | 21Jan2021 | 29Jan2021 | 126529100 |
| 30th | Past | 30Jan2021 | 08Feb2021 | 126529100 |
| 31st | Past | 09Feb2021 | 18Feb2021 | 126529100 |
| 32nd | Past | 19Feb2021 | 27Feb2021 | 126529100 |
| 33rd | Past | 28Feb2021 | 09Mar2021 | 126529100 |
| 34th | Past | 10Mar2021 | 24Mar2021 | 126529100 |
| 35th | Past | 25Mar2021 | 07Apr2021 | 126529100 |
| 36th | Past | 08Apr2021 | 19Apr2021 | 126529100 |
| 37th | Past | 20Apr2021 | 28Apr2021 | 126529100 |
| 38th | Past | 29Apr2021 | 06May2021 | 126529100 |
| 39th | Past | 07May2021 | 19May2021 | 126529100 |
| 40th | Past | 20May2021 | 02Jun2021 | 126529100 |
| 41st | Past | 03Jun2021 | 16Jun2021 | 126529100 |
Parameter estimation of ODE models¶
Here, we will estimate the tau value [min] (using grid search) and parameter values of SIR-derived models using Optuna package (automated hyperparameter optimization framework). As an example, we use SIR-F model. Details of models will be explained in Usage (details: theoritical datasets).
We can select the model from SIR, SIRD and SIR-F model for parameter estimation. SIR-FV model (completely deprecated) and SEWIR-F model cannot be used.
[18]:
# Estimate the tau value and parameter values of SIR-F model
# Default value of timeout in each phase is 180 sec
snl.estimate(cs.SIRF, timeout=180)
<SIR-F model: parameter estimation>
Running optimization with 4 CPUs...
3rd phase (14Mar2020 - 24Mar2020): finished 754 trials in 0 min 25 sec
0th phase (06Feb2020 - 18Feb2020): finished 1013 trials in 0 min 30 sec
6th phase (11Apr2020 - 23Apr2020): finished 1109 trials in 0 min 40 sec
9th phase (14May2020 - 28May2020): finished 1176 trials in 0 min 45 sec
10th phase (29May2020 - 10Jun2020): finished 176 trials in 0 min 5 sec
1st phase (19Feb2020 - 05Mar2020): finished 746 trials in 0 min 25 sec
7th phase (24Apr2020 - 02May2020): finished 657 trials in 0 min 25 sec
4th phase (25Mar2020 - 02Apr2020): finished 1012 trials in 0 min 40 sec
11th phase (11Jun2020 - 23Jun2020): finished 440 trials in 0 min 15 sec
2nd phase (06Mar2020 - 13Mar2020): finished 683 trials in 0 min 25 sec
5th phase (03Apr2020 - 10Apr2020): finished 706 trials in 0 min 25 sec
8th phase (03May2020 - 13May2020): finished 1030 trials in 0 min 45 sec
15th phase (31Jul2020 - 13Aug2020): finished 734 trials in 0 min 30 sec
12th phase (24Jun2020 - 03Jul2020): finished 1042 trials in 0 min 45 sec
16th phase (14Aug2020 - 26Aug2020): finished 328 trials in 0 min 10 sec
18th phase (11Sep2020 - 25Sep2020): finished 1048 trials in 0 min 45 sec
17th phase (27Aug2020 - 10Sep2020): finished 581 trials in 0 min 20 sec
21st phase (18Oct2020 - 26Oct2020): finished 900 trials in 0 min 35 sec
19th phase (26Sep2020 - 09Oct2020): finished 881 trials in 0 min 35 sec
13th phase (04Jul2020 - 16Jul2020): finished 1335 trials in 1 min 0 sec
24th phase (22Nov2020 - 03Dec2020): finished 1074 trials in 0 min 45 sec
25th phase (04Dec2020 - 16Dec2020): finished 198 trials in 0 min 5 sec
22nd phase (27Oct2020 - 09Nov2020): finished 1493 trials in 1 min 10 sec
23rd phase (10Nov2020 - 21Nov2020): finished 166 trials in 0 min 5 sec
14th phase (17Jul2020 - 30Jul2020): finished 1265 trials in 0 min 55 sec
30th phase (30Jan2021 - 08Feb2021): finished 171 trials in 0 min 5 sec
31st phase (09Feb2021 - 18Feb2021): finished 179 trials in 0 min 5 sec
32nd phase (19Feb2021 - 27Feb2021): finished 166 trials in 0 min 5 sec
26th phase (17Dec2020 - 29Dec2020): finished 1248 trials in 0 min 55 sec
20th phase (10Oct2020 - 17Oct2020): finished 1566 trials in 1 min 15 sec
33rd phase (28Feb2021 - 09Mar2021): finished 164 trials in 0 min 5 sec
34th phase (10Mar2021 - 24Mar2021): finished 163 trials in 0 min 5 sec
27th phase (30Dec2020 - 12Jan2021): finished 1132 trials in 0 min 50 sec
28th phase (13Jan2021 - 20Jan2021): finished 168 trials in 0 min 5 sec
36th phase (08Apr2021 - 19Apr2021): finished 959 trials in 0 min 40 sec
29th phase (21Jan2021 - 29Jan2021): finished 279 trials in 0 min 10 sec
39th phase (07May2021 - 19May2021): finished 1043 trials in 0 min 45 sec
40th phase (20May2021 - 02Jun2021): finished 193 trials in 0 min 5 sec
41st phase (03Jun2021 - 16Jun2021): finished 171 trials in 0 min 5 sec
35th phase (25Mar2021 - 07Apr2021): finished 1248 trials in 0 min 55 sec
37th phase (20Apr2021 - 28Apr2021): finished 858 trials in 0 min 30 sec
38th phase (29Apr2021 - 06May2021): finished 962 trials in 0 min 30 sec
Completed optimization. Total: 5 min 49 sec
[19]:
# Show the summary of parameter estimation
snl.summary()
[19]:
| Type | Start | End | Population | ODE | Rt | theta | kappa | rho | sigma | tau | alpha1 [-] | 1/alpha2 [day] | 1/beta [day] | 1/gamma [day] | RMSLE | Trials | Runtime | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0th | Past | 06Feb2020 | 18Feb2020 | 126529100 | SIR-F | 2.32 | 0.027273 | 0.000000 | 0.066019 | 0.027718 | 1440 | - | - | - | - | 0.142890 | 1013.0 | 0 min 30 sec |
| 1st | Past | 19Feb2020 | 05Mar2020 | 126529100 | SIR-F | 4.93 | 0.007714 | 0.001322 | 0.136657 | 0.026198 | 1440 | 0.008 | 756.0 | 7.0 | 38.0 | 0.170717 | 746.0 | 0 min 25 sec |
| 2nd | Past | 06Mar2020 | 13Mar2020 | 126529100 | SIR-F | 5.06 | 0.022125 | 0.000656 | 0.126654 | 0.023830 | 1440 | 0.022 | 1524.0 | 7.0 | 41.0 | 0.093897 | 683.0 | 0 min 25 sec |
| 3rd | Past | 14Mar2020 | 24Mar2020 | 126529100 | SIR-F | 2.57 | 0.000096 | 0.002956 | 0.063547 | 0.021736 | 1440 | 0.0 | 338.0 | 15.0 | 46.0 | 0.029797 | 754.0 | 0 min 25 sec |
| 4th | Past | 25Mar2020 | 02Apr2020 | 126529100 | SIR-F | 5.10 | 0.008478 | 0.000606 | 0.117177 | 0.022166 | 1440 | 0.008 | 1650.0 | 8.0 | 45.0 | 0.036258 | 1012.0 | 0 min 40 sec |
| 5th | Past | 03Apr2020 | 10Apr2020 | 126529100 | SIR-F | 10.91 | 0.000194 | 0.001188 | 0.124449 | 0.010214 | 1440 | 0.0 | 841.0 | 8.0 | 97.0 | 0.026021 | 706.0 | 0 min 25 sec |
| 6th | Past | 11Apr2020 | 23Apr2020 | 126529100 | SIR-F | 6.81 | 0.000500 | 0.001369 | 0.076414 | 0.009854 | 1440 | 0.0 | 730.0 | 13.0 | 101.0 | 0.116075 | 1109.0 | 0 min 40 sec |
| 7th | Past | 24Apr2020 | 02May2020 | 126529100 | SIR-F | 1.44 | 0.001306 | 0.001491 | 0.028691 | 0.018346 | 1440 | 0.001 | 670.0 | 34.0 | 54.0 | 0.026841 | 657.0 | 0 min 25 sec |
| 8th | Past | 03May2020 | 13May2020 | 126529100 | SIR-F | 0.16 | 0.048667 | 0.001391 | 0.009444 | 0.054692 | 1440 | 0.049 | 718.0 | 105.0 | 18.0 | 0.093612 | 1030.0 | 0 min 45 sec |
| 9th | Past | 14May2020 | 28May2020 | 126529100 | SIR-F | 0.13 | 0.114805 | 0.002110 | 0.012507 | 0.085305 | 1440 | 0.115 | 473.0 | 79.0 | 11.0 | 0.022470 | 1176.0 | 0 min 45 sec |
| 10th | Past | 29May2020 | 10Jun2020 | 126529100 | SIR-F | 0.46 | 0.033851 | 0.001717 | 0.032575 | 0.066187 | 1440 | 0.034 | 582.0 | 30.0 | 15.0 | 0.016150 | 176.0 | 0 min 5 sec |
| 11th | Past | 11Jun2020 | 23Jun2020 | 126529100 | SIR-F | 0.75 | 0.007468 | 0.001961 | 0.063449 | 0.081788 | 1440 | 0.007 | 509.0 | 15.0 | 12.0 | 0.030209 | 440.0 | 0 min 15 sec |
| 12th | Past | 24Jun2020 | 03Jul2020 | 126529100 | SIR-F | 1.52 | 0.000097 | 0.001568 | 0.109865 | 0.070674 | 1440 | 0.0 | 637.0 | 9.0 | 14.0 | 0.018046 | 1042.0 | 0 min 45 sec |
| 13th | Past | 04Jul2020 | 16Jul2020 | 126529100 | SIR-F | 2.10 | 0.000240 | 0.000338 | 0.138912 | 0.065806 | 1440 | 0.0 | 2958.0 | 7.0 | 15.0 | 0.022398 | 1335.0 | 1 min 0 sec |
| 14th | Past | 17Jul2020 | 30Jul2020 | 126529100 | SIR-F | 2.00 | 0.000271 | 0.000185 | 0.135558 | 0.067589 | 1440 | 0.0 | 5400.0 | 7.0 | 14.0 | 0.021450 | 1265.0 | 0 min 55 sec |
| 15th | Past | 31Jul2020 | 13Aug2020 | 126529100 | SIR-F | 1.67 | 0.000463 | 0.000276 | 0.122543 | 0.072908 | 1440 | 0.0 | 3620.0 | 8.0 | 13.0 | 0.046264 | 734.0 | 0 min 30 sec |
| 16th | Past | 14Aug2020 | 26Aug2020 | 126529100 | SIR-F | 0.84 | 0.000833 | 0.000733 | 0.079265 | 0.094039 | 1440 | 0.001 | 1364.0 | 12.0 | 10.0 | 0.012431 | 328.0 | 0 min 10 sec |
| 17th | Past | 27Aug2020 | 10Sep2020 | 126529100 | SIR-F | 0.72 | 0.000429 | 0.001279 | 0.071445 | 0.097862 | 1440 | 0.0 | 781.0 | 13.0 | 10.0 | 0.010068 | 581.0 | 0 min 20 sec |
| 18th | Past | 11Sep2020 | 25Sep2020 | 126529100 | SIR-F | 0.87 | 0.008171 | 0.000631 | 0.078709 | 0.089175 | 1440 | 0.008 | 1585.0 | 12.0 | 11.0 | 0.017674 | 1048.0 | 0 min 45 sec |
| 19th | Past | 26Sep2020 | 09Oct2020 | 126529100 | SIR-F | 1.00 | 0.000173 | 0.001029 | 0.088567 | 0.087578 | 1440 | 0.0 | 972.0 | 11.0 | 11.0 | 0.012229 | 881.0 | 0 min 35 sec |
| 20th | Past | 10Oct2020 | 17Oct2020 | 126529100 | SIR-F | 1.04 | 0.000024 | 0.000780 | 0.092602 | 0.087889 | 1440 | 0.0 | 1281.0 | 10.0 | 11.0 | 0.014964 | 1566.0 | 1 min 15 sec |
| 21st | Past | 18Oct2020 | 26Oct2020 | 126529100 | SIR-F | 0.97 | 0.000175 | 0.000894 | 0.100391 | 0.102726 | 1440 | 0.0 | 1118.0 | 9.0 | 9.0 | 0.020754 | 900.0 | 0 min 35 sec |
| 22nd | Past | 27Oct2020 | 09Nov2020 | 126529100 | SIR-F | 1.32 | 0.000480 | 0.001075 | 0.113700 | 0.085210 | 1440 | 0.0 | 929.0 | 8.0 | 11.0 | 0.016758 | 1493.0 | 1 min 10 sec |
| 23rd | Past | 10Nov2020 | 21Nov2020 | 126529100 | SIR-F | 1.58 | 0.001401 | 0.000735 | 0.142531 | 0.089508 | 1440 | 0.001 | 1360.0 | 7.0 | 11.0 | 0.010060 | 166.0 | 0 min 5 sec |
| 24th | Past | 22Nov2020 | 03Dec2020 | 126529100 | SIR-F | 1.29 | 0.000446 | 0.000861 | 0.105665 | 0.081151 | 1440 | 0.0 | 1161.0 | 9.0 | 12.0 | 0.014784 | 1074.0 | 0 min 45 sec |
| 25th | Past | 04Dec2020 | 16Dec2020 | 126529100 | SIR-F | 1.18 | 0.000290 | 0.001435 | 0.096849 | 0.080680 | 1440 | 0.0 | 696.0 | 10.0 | 12.0 | 0.011146 | 198.0 | 0 min 5 sec |
| 26th | Past | 17Dec2020 | 29Dec2020 | 126529100 | SIR-F | 1.20 | 0.000062 | 0.001494 | 0.102799 | 0.083850 | 1440 | 0.0 | 669.0 | 9.0 | 11.0 | 0.011793 | 1248.0 | 0 min 55 sec |
| 27th | Past | 30Dec2020 | 12Jan2021 | 126529100 | SIR-F | 1.66 | 0.000393 | 0.001196 | 0.106133 | 0.062667 | 1440 | 0.0 | 836.0 | 9.0 | 15.0 | 0.027947 | 1132.0 | 0 min 50 sec |
| 28th | Past | 13Jan2021 | 20Jan2021 | 126529100 | SIR-F | 1.24 | 0.000501 | 0.000917 | 0.088961 | 0.070697 | 1440 | 0.001 | 1090.0 | 11.0 | 14.0 | 0.008692 | 168.0 | 0 min 5 sec |
| 29th | Past | 21Jan2021 | 29Jan2021 | 126529100 | SIR-F | 0.76 | 0.000132 | 0.001287 | 0.073934 | 0.095529 | 1440 | 0.0 | 776.0 | 13.0 | 10.0 | 0.016333 | 279.0 | 0 min 10 sec |
| 30th | Past | 30Jan2021 | 08Feb2021 | 126529100 | SIR-F | 0.54 | 0.000433 | 0.001993 | 0.056144 | 0.101890 | 1440 | 0.0 | 501.0 | 17.0 | 9.0 | 0.014056 | 171.0 | 0 min 5 sec |
| 31st | Past | 09Feb2021 | 18Feb2021 | 126529100 | SIR-F | 0.57 | 0.000133 | 0.002773 | 0.064011 | 0.110230 | 1440 | 0.0 | 360.0 | 15.0 | 9.0 | 0.011131 | 179.0 | 0 min 5 sec |
| 32nd | Past | 19Feb2021 | 27Feb2021 | 126529100 | SIR-F | 0.68 | 0.007868 | 0.003017 | 0.066623 | 0.093852 | 1440 | 0.008 | 331.0 | 15.0 | 10.0 | 0.006976 | 166.0 | 0 min 5 sec |
| 33rd | Past | 28Feb2021 | 09Mar2021 | 126529100 | SIR-F | 0.77 | 0.000200 | 0.003360 | 0.074506 | 0.093186 | 1440 | 0.0 | 297.0 | 13.0 | 10.0 | 0.015427 | 164.0 | 0 min 5 sec |
| 34th | Past | 10Mar2021 | 24Mar2021 | 126529100 | SIR-F | 1.13 | 0.004917 | 0.002711 | 0.087412 | 0.074421 | 1440 | 0.005 | 368.0 | 11.0 | 13.0 | 0.009754 | 163.0 | 0 min 5 sec |
| 35th | Past | 25Mar2021 | 07Apr2021 | 126529100 | SIR-F | 1.63 | 0.007889 | 0.000461 | 0.114787 | 0.069472 | 1440 | 0.008 | 2170.0 | 8.0 | 14.0 | 0.011145 | 1248.0 | 0 min 55 sec |
| 36th | Past | 08Apr2021 | 19Apr2021 | 126529100 | SIR-F | 1.50 | 0.000284 | 0.000849 | 0.111479 | 0.073609 | 1440 | 0.0 | 1177.0 | 8.0 | 13.0 | 0.015699 | 959.0 | 0 min 40 sec |
| 37th | Past | 20Apr2021 | 28Apr2021 | 126529100 | SIR-F | 1.54 | 0.000993 | 0.000835 | 0.101052 | 0.064704 | 1440 | 0.001 | 1198.0 | 9.0 | 15.0 | 0.009950 | 858.0 | 0 min 30 sec |
| 38th | Past | 29Apr2021 | 06May2021 | 126529100 | SIR-F | 1.34 | 0.000425 | 0.000927 | 0.087654 | 0.064523 | 1440 | 0.0 | 1078.0 | 11.0 | 15.0 | 0.007535 | 962.0 | 0 min 30 sec |
| 39th | Past | 07May2021 | 19May2021 | 126529100 | SIR-F | 1.23 | 0.000439 | 0.001254 | 0.088453 | 0.070583 | 1440 | 0.0 | 797.0 | 11.0 | 14.0 | 0.020495 | 1043.0 | 0 min 45 sec |
| 40th | Past | 20May2021 | 02Jun2021 | 126529100 | SIR-F | 0.76 | 0.000228 | 0.001419 | 0.067653 | 0.087795 | 1440 | 0.0 | 704.0 | 14.0 | 11.0 | 0.012374 | 193.0 | 0 min 5 sec |
| 41st | Past | 03Jun2021 | 16Jun2021 | 126529100 | SIR-F | 0.57 | 0.024646 | 0.002231 | 0.058471 | 0.098220 | 1440 | 0.025 | 448.0 | 17.0 | 10.0 | 0.018226 | 171.0 | 0 min 5 sec |
Evaluation of estimation accuracy¶
Accuracy of parameter estimation can be evaluated with RMSLE (Root Mean Squared Log Error) score.
Where \(A\) is the observed (actual) values, \(P\) is estimated (predicted) values. Variables are \(S (i=1), I (i=2), R (i=3)\ \mathrm{and}\ F (i=n=4)\) for SIR-F model. When RMSLE score is low, hyperparameter estimation is highly accurate. Please refer to external sites, including Medium: What’s the Difference Between RMSE and RMSLE?
[20]:
# Show RMSLE scores with the number of optimization trials and runtime for phases
snl.summary(columns=["Start", "End", "RMSLE", "Trials", "Runtime"])
[20]:
| Start | End | RMSLE | Trials | Runtime | |
|---|---|---|---|---|---|
| 0th | 06Feb2020 | 18Feb2020 | 0.142890 | 1013.0 | 0 min 30 sec |
| 1st | 19Feb2020 | 05Mar2020 | 0.170717 | 746.0 | 0 min 25 sec |
| 2nd | 06Mar2020 | 13Mar2020 | 0.093897 | 683.0 | 0 min 25 sec |
| 3rd | 14Mar2020 | 24Mar2020 | 0.029797 | 754.0 | 0 min 25 sec |
| 4th | 25Mar2020 | 02Apr2020 | 0.036258 | 1012.0 | 0 min 40 sec |
| 5th | 03Apr2020 | 10Apr2020 | 0.026021 | 706.0 | 0 min 25 sec |
| 6th | 11Apr2020 | 23Apr2020 | 0.116075 | 1109.0 | 0 min 40 sec |
| 7th | 24Apr2020 | 02May2020 | 0.026841 | 657.0 | 0 min 25 sec |
| 8th | 03May2020 | 13May2020 | 0.093612 | 1030.0 | 0 min 45 sec |
| 9th | 14May2020 | 28May2020 | 0.022470 | 1176.0 | 0 min 45 sec |
| 10th | 29May2020 | 10Jun2020 | 0.016150 | 176.0 | 0 min 5 sec |
| 11th | 11Jun2020 | 23Jun2020 | 0.030209 | 440.0 | 0 min 15 sec |
| 12th | 24Jun2020 | 03Jul2020 | 0.018046 | 1042.0 | 0 min 45 sec |
| 13th | 04Jul2020 | 16Jul2020 | 0.022398 | 1335.0 | 1 min 0 sec |
| 14th | 17Jul2020 | 30Jul2020 | 0.021450 | 1265.0 | 0 min 55 sec |
| 15th | 31Jul2020 | 13Aug2020 | 0.046264 | 734.0 | 0 min 30 sec |
| 16th | 14Aug2020 | 26Aug2020 | 0.012431 | 328.0 | 0 min 10 sec |
| 17th | 27Aug2020 | 10Sep2020 | 0.010068 | 581.0 | 0 min 20 sec |
| 18th | 11Sep2020 | 25Sep2020 | 0.017674 | 1048.0 | 0 min 45 sec |
| 19th | 26Sep2020 | 09Oct2020 | 0.012229 | 881.0 | 0 min 35 sec |
| 20th | 10Oct2020 | 17Oct2020 | 0.014964 | 1566.0 | 1 min 15 sec |
| 21st | 18Oct2020 | 26Oct2020 | 0.020754 | 900.0 | 0 min 35 sec |
| 22nd | 27Oct2020 | 09Nov2020 | 0.016758 | 1493.0 | 1 min 10 sec |
| 23rd | 10Nov2020 | 21Nov2020 | 0.010060 | 166.0 | 0 min 5 sec |
| 24th | 22Nov2020 | 03Dec2020 | 0.014784 | 1074.0 | 0 min 45 sec |
| 25th | 04Dec2020 | 16Dec2020 | 0.011146 | 198.0 | 0 min 5 sec |
| 26th | 17Dec2020 | 29Dec2020 | 0.011793 | 1248.0 | 0 min 55 sec |
| 27th | 30Dec2020 | 12Jan2021 | 0.027947 | 1132.0 | 0 min 50 sec |
| 28th | 13Jan2021 | 20Jan2021 | 0.008692 | 168.0 | 0 min 5 sec |
| 29th | 21Jan2021 | 29Jan2021 | 0.016333 | 279.0 | 0 min 10 sec |
| 30th | 30Jan2021 | 08Feb2021 | 0.014056 | 171.0 | 0 min 5 sec |
| 31st | 09Feb2021 | 18Feb2021 | 0.011131 | 179.0 | 0 min 5 sec |
| 32nd | 19Feb2021 | 27Feb2021 | 0.006976 | 166.0 | 0 min 5 sec |
| 33rd | 28Feb2021 | 09Mar2021 | 0.015427 | 164.0 | 0 min 5 sec |
| 34th | 10Mar2021 | 24Mar2021 | 0.009754 | 163.0 | 0 min 5 sec |
| 35th | 25Mar2021 | 07Apr2021 | 0.011145 | 1248.0 | 0 min 55 sec |
| 36th | 08Apr2021 | 19Apr2021 | 0.015699 | 959.0 | 0 min 40 sec |
| 37th | 20Apr2021 | 28Apr2021 | 0.009950 | 858.0 | 0 min 30 sec |
| 38th | 29Apr2021 | 06May2021 | 0.007535 | 962.0 | 0 min 30 sec |
| 39th | 07May2021 | 19May2021 | 0.020495 | 1043.0 | 0 min 45 sec |
| 40th | 20May2021 | 02Jun2021 | 0.012374 | 193.0 | 0 min 5 sec |
| 41st | 03Jun2021 | 16Jun2021 | 0.018226 | 171.0 | 0 min 5 sec |
Additionally, we can visualize the accuracy with Scenario.estimate_accuracy()
, specifing phase name.
[21]:
# Visualize the accuracy for the 2nd phase
snl.estimate_accuracy(phase="2nd")
# phase="last" means the last phases
# snl.estimate_accuracy(phase="last")
We can calculate total score for all phases using Scenario.score()
method. Metrics can be selected from MAE, MSE, MSLE, RMSE and RMSLE.
[22]:
# Get total score: metrics="MAE", "MSE", "MSLE", "RMSE" or "RMSLE"
# snl.score(metrics="RMSLE")
metrics_list = ["MAE", "MSE", "MSLE", "RMSE", "RMSLE"]
for metrics in metrics_list:
metrics_name = metrics.rjust(len(max(metrics_list, key=len)))
print(f"{metrics_name}: {snl.score(metrics=metrics):.3f}")
MAE: 768.054
MSE: 2435669.297
MSLE: 0.003
RMSE: 1232.320
RMSLE: 0.058
Get parameter value¶
We can get the parameter values of a phase using Scenario.get()
method.
[23]:
# Get parameter values
snl.get("Rt", phase="4th")
[23]:
5.1
[24]:
# phase="last" means the last phases
snl.get("Rt", phase="last")
[24]:
0.57
Show parameter history¶
We can get the history of parameter values with a dataframe and a figure.
[25]:
# Get the parameter values as a dataframe
snl.summary(columns=[*cs.SIRF.PARAMETERS, "Rt"])
[25]:
| theta | kappa | rho | sigma | Rt | |
|---|---|---|---|---|---|
| 0th | 0.027273 | 0.000000 | 0.066019 | 0.027718 | 2.32 |
| 1st | 0.007714 | 0.001322 | 0.136657 | 0.026198 | 4.93 |
| 2nd | 0.022125 | 0.000656 | 0.126654 | 0.023830 | 5.06 |
| 3rd | 0.000096 | 0.002956 | 0.063547 | 0.021736 | 2.57 |
| 4th | 0.008478 | 0.000606 | 0.117177 | 0.022166 | 5.10 |
| 5th | 0.000194 | 0.001188 | 0.124449 | 0.010214 | 10.91 |
| 6th | 0.000500 | 0.001369 | 0.076414 | 0.009854 | 6.81 |
| 7th | 0.001306 | 0.001491 | 0.028691 | 0.018346 | 1.44 |
| 8th | 0.048667 | 0.001391 | 0.009444 | 0.054692 | 0.16 |
| 9th | 0.114805 | 0.002110 | 0.012507 | 0.085305 | 0.13 |
| 10th | 0.033851 | 0.001717 | 0.032575 | 0.066187 | 0.46 |
| 11th | 0.007468 | 0.001961 | 0.063449 | 0.081788 | 0.75 |
| 12th | 0.000097 | 0.001568 | 0.109865 | 0.070674 | 1.52 |
| 13th | 0.000240 | 0.000338 | 0.138912 | 0.065806 | 2.10 |
| 14th | 0.000271 | 0.000185 | 0.135558 | 0.067589 | 2.00 |
| 15th | 0.000463 | 0.000276 | 0.122543 | 0.072908 | 1.67 |
| 16th | 0.000833 | 0.000733 | 0.079265 | 0.094039 | 0.84 |
| 17th | 0.000429 | 0.001279 | 0.071445 | 0.097862 | 0.72 |
| 18th | 0.008171 | 0.000631 | 0.078709 | 0.089175 | 0.87 |
| 19th | 0.000173 | 0.001029 | 0.088567 | 0.087578 | 1.00 |
| 20th | 0.000024 | 0.000780 | 0.092602 | 0.087889 | 1.04 |
| 21st | 0.000175 | 0.000894 | 0.100391 | 0.102726 | 0.97 |
| 22nd | 0.000480 | 0.001075 | 0.113700 | 0.085210 | 1.32 |
| 23rd | 0.001401 | 0.000735 | 0.142531 | 0.089508 | 1.58 |
| 24th | 0.000446 | 0.000861 | 0.105665 | 0.081151 | 1.29 |
| 25th | 0.000290 | 0.001435 | 0.096849 | 0.080680 | 1.18 |
| 26th | 0.000062 | 0.001494 | 0.102799 | 0.083850 | 1.20 |
| 27th | 0.000393 | 0.001196 | 0.106133 | 0.062667 | 1.66 |
| 28th | 0.000501 | 0.000917 | 0.088961 | 0.070697 | 1.24 |
| 29th | 0.000132 | 0.001287 | 0.073934 | 0.095529 | 0.76 |
| 30th | 0.000433 | 0.001993 | 0.056144 | 0.101890 | 0.54 |
| 31st | 0.000133 | 0.002773 | 0.064011 | 0.110230 | 0.57 |
| 32nd | 0.007868 | 0.003017 | 0.066623 | 0.093852 | 0.68 |
| 33rd | 0.000200 | 0.003360 | 0.074506 | 0.093186 | 0.77 |
| 34th | 0.004917 | 0.002711 | 0.087412 | 0.074421 | 1.13 |
| 35th | 0.007889 | 0.000461 | 0.114787 | 0.069472 | 1.63 |
| 36th | 0.000284 | 0.000849 | 0.111479 | 0.073609 | 1.50 |
| 37th | 0.000993 | 0.000835 | 0.101052 | 0.064704 | 1.54 |
| 38th | 0.000425 | 0.000927 | 0.087654 | 0.064523 | 1.34 |
| 39th | 0.000439 | 0.001254 | 0.088453 | 0.070583 | 1.23 |
| 40th | 0.000228 | 0.001419 | 0.067653 | 0.087795 | 0.76 |
| 41st | 0.024646 | 0.002231 | 0.058471 | 0.098220 | 0.57 |
Scenario.history()
method shows the trajectories of parameters (and the number of cases).
[26]:
_ = snl.history(target="theta", show_legend=False)
[27]:
_ = snl.history(target="kappa", show_legend=False)
[28]:
_ = snl.history(target="rho", show_legend=False)
[29]:
_ = snl.history(target="sigma", show_legend=False)
Sigma values: the first wave < the second wave > the third wave
However, in the second wave (Jul - Oct), recovery period appears short because we have some effective medicines (not approved, in clinical study), yonger people (people un-associated to sever diseases) were infected.
In the third wave (Nov - ), older people tend to be infected and we are facing with medical collapse at this time…
Show the history of reproduction number¶
\(R_0\) (“R naught”) means “the average number of secondary infections caused by an infected host” (Infection Modeling — Part 1). When this value is larger than 1, the infection disease is outbreaking.
[30]:
_ = snl.history(target="Rt", show_legend=False)
Simulate the number of cases¶
We can compare the actual and simulated (with estimated parameter values) number of confirmed/infected/recovered/fatal cases using Scenario.history()
method.
[31]:
# Compare the actual values and the main scenario
_ = snl.history("Infected")
When we want to show only one scenario with all variables, we use Scenario.simulate()
method.
[32]:
_ =snl.simulate(name="Main")
Main scenario¶
To investigate the effect of parameter changes, we will perform scenario analysis. In the main scenario, we will assume that the parameter values do not change after the last past phase.
i.e. If the parameter velues will not be changed until 31Jul2021, how many cases will be? We call this scenario as “Main” scenario.
[33]:
# Clear future phases in Main scenario
snl.clear(name="Main")
# Add one future phase 30 days with the parameter set of the last past phase
snl.add(days=30, name="Main")
# Add one future phase until 31Jul2021 with the same parameter set
snl.add(end_date="31Jul2021", name="Main")
# Simulate the number of cases
snl.simulate(name="Main").tail()
[33]:
| Date | Infected | Fatal | Recovered | |
|---|---|---|---|---|
| 524 | 2021-07-27 | 4432 | 16116 | 791069 |
| 525 | 2021-07-28 | 4242 | 16132 | 791495 |
| 526 | 2021-07-29 | 4060 | 16147 | 791903 |
| 527 | 2021-07-30 | 3886 | 16162 | 792293 |
| 528 | 2021-07-31 | 3720 | 16176 | 792666 |
Medicine scenario¶
To investigate the effect of new medicines, we will assume that \(\sigma\) will be changed in the future phases.
If \(\sigma\) will be 1.2 times in 30 days, how many cases will be? We will call this scenario as “Medicine” scenario.
[34]:
# Calcuate the current sigma value of the last phase
sigma_current = snl.get("sigma", name="Main", phase="last")
sigma_current
[34]:
0.09821972244232675
[35]:
# Sigma value will be double
sigma_new = sigma_current * 1.2
sigma_new
[35]:
0.1178636669307921
[36]:
# Initialize "Medicine" scenario (with the same past phases as that of Main scenario)
snl.clear(name="Medicine")
# Add 30 days as a new future phases with the same parameter set
snl.add(name="Medicine", days=30, sigma=sigma_current)
# Add a phase with doubled sigma value and the same end date with main date
snl.add(name="Medicine", end_date="31Jul2021", sigma=sigma_new)
[36]:
<covsirphy.analysis.scenario.Scenario at 0x7f7a8a4d09d0>
Check summary of future phases.
[37]:
df = snl.summary()
df.loc[df["Type"] == "Future"]
[37]:
| Type | Start | End | Population | ODE | Rt | theta | kappa | rho | sigma | tau | alpha1 [-] | 1/alpha2 [day] | 1/beta [day] | 1/gamma [day] | RMSLE | Trials | Runtime | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Scenario | Phase | ||||||||||||||||||
| Main | 42nd | Future | 17Jun2021 | 16Jul2021 | 126529100 | SIR-F | 0.57 | 0.024646 | 0.002231 | 0.058471 | 0.098220 | 1440 | 0.025 | 448.0 | 17.0 | 10.0 | - | - | - |
| 43rd | Future | 17Jul2021 | 31Jul2021 | 126529100 | SIR-F | 0.57 | 0.024646 | 0.002231 | 0.058471 | 0.098220 | 1440 | 0.025 | 448.0 | 17.0 | 10.0 | - | - | - | |
| Medicine | 42nd | Future | 17Jun2021 | 16Jul2021 | 126529100 | SIR-F | 0.57 | 0.024646 | 0.002231 | 0.058471 | 0.098220 | 1440 | 0.025 | 448.0 | 17.0 | 10.0 | - | - | - |
| 43rd | Future | 17Jul2021 | 31Jul2021 | 126529100 | SIR-F | 0.47 | 0.024646 | 0.002231 | 0.058471 | 0.117864 | 1440 | 0.025 | 448.0 | 17.0 | 8.0 | - | - | - |
Simulate the number of cases.
[38]:
_ = snl.simulate(name="Medicine").tail()
Short-term prediction of parameter values¶
With extra datasets, we can predict the ODE parameter values in the future phases because OxCGRT indicators (policy measures), vaccinations and so on impact on parameter values with delay period (the number of days that indicators take for the ODE parameter values to be changed).
OxCGRT indicators are
school_closing,
workplace_closing,
cancel_events,
gatherings_restrictions,
transport_closing,
stay_home_restrictions,
internal_movement_restrictions,
international_movement_restrictions,
information_campaigns,
testing_policy, and
contact_tracing.
Scenario.fit()
method learns the relationship of indicators (X) and the parameter values (y) with regresion models. X was registered with Scenario.register()
and y was calculated with Scenario.estimate()
in advance respectively.
Regression models:
Indicators -> Parameters with Elastic Net
Indicators -> Parameters with Decision Tree Regressor
Indicators(n)/Indicators(n-1) -> Parameters(n)/Parameters(n-1) with Elastic Net
Indicators(n)/Indicators(n-1) -> Parameters(n)/Parameters(n-1) with Decision Tree Regressor
Scenario.fit()
has delay
argument and we can apply the following values.
delay=20
: Exact value of delay period [days].delay=(7, 31)
: Delay period will be found by grid search in the value range of (7, 31) to minimize test score of learing. This is the default value from version 2.20.0.delay=None
: Delay period will be calculated withScenario.estimate_delay()
method. In this method, change point analysis will be done with one selected indicator (“Stringency_index” as default) and variable (“Confirmed” as default) to estimate delay period. This is the default value to version 2.19.1.
When we use delay=None
, the indicator used to estimate delay period (“Stringency_index” as default) will be automatically removed from X dataset. If you have some indicators to be removed additionally, please use removed_cols
argument (list of indicator names) of Scenario.fit()
.
As an example, we only use he number of vaccinated (once/full) people and OxCGRT indicators (except for “Stringency_index” because this is calculated with the other OxCGRT indicators).
From development version 2.20.3-delta, “predicted vs. actual parameter values” figure will be shown when show_figure=True
(default).
[39]:
# Create Forecast scenario (copy Main scenario and delete future phases)
snl.clear(name="Forecast", template="Main")
# Fitting with linear regression model (Elastic Net regression)
fit_dict = snl.fit(
name="Forecast", metric="R2",
removed_cols=["Stringency_index", "Tests", "Tests_diff", "Vaccinations"]
)
Show determination coeefients of training/test dataset.
[40]:
print(f"R-squared: {fit_dict['score_train']:.3f} (train)")
print(f"R-squared: {fit_dict['score_test']:.3f} (test)")
R-squared: 0.883 (train)
R-squared: -240.265 (test)
Scenario.predict()
predicts the parameter values of future phases.
[41]:
# Short-term prediction
snl.predict(name="Forecast")
# We can select list of days to predict optionally
# snl.predict(days=[1, 4], name="Forecast")
[41]:
<covsirphy.analysis.scenario.Scenario at 0x7f7a8a4d09d0>
Show summary of future phases.
[42]:
df = snl.summary()
df.loc[df["Type"] == "Future"]
[42]:
| Type | Start | End | Population | ODE | Rt | theta | kappa | rho | sigma | tau | alpha1 [-] | 1/alpha2 [day] | 1/beta [day] | 1/gamma [day] | RMSLE | Trials | Runtime | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Scenario | Phase | ||||||||||||||||||
| Main | 42nd | Future | 17Jun2021 | 16Jul2021 | 126529100 | SIR-F | 0.57 | 0.024646 | 0.002231 | 0.058471 | 0.098220 | 1440 | 0.025 | 448.0 | 17.0 | 10.0 | - | - | - |
| 43rd | Future | 17Jul2021 | 31Jul2021 | 126529100 | SIR-F | 0.57 | 0.024646 | 0.002231 | 0.058471 | 0.098220 | 1440 | 0.025 | 448.0 | 17.0 | 10.0 | - | - | - | |
| Medicine | 42nd | Future | 17Jun2021 | 16Jul2021 | 126529100 | SIR-F | 0.57 | 0.024646 | 0.002231 | 0.058471 | 0.098220 | 1440 | 0.025 | 448.0 | 17.0 | 10.0 | - | - | - |
| 43rd | Future | 17Jul2021 | 31Jul2021 | 126529100 | SIR-F | 0.47 | 0.024646 | 0.002231 | 0.058471 | 0.117864 | 1440 | 0.025 | 448.0 | 17.0 | 8.0 | - | - | - | |
| Forecast | 42nd | Future | 17Jun2021 | 17Jul2021 | 126529100 | SIR-F | 1.50 | 0.007102 | 0.000899 | 0.109000 | 0.071360 | 1440 | 0.007 | 1112.0 | 9.0 | 14.0 | - | - | - |
Or, short-cut .fit()
and .predict()
with Scenario.fit_predict()
. We can apply all arguments (of .fit()
and .predict()
) to Scenario.fit_predict()
.
[43]:
# Or, when you do not need 'fit_dict',
# snl.fit_predict(name="Forecast").summary(name="Forecast")
To compare this scenario with the other scenarios, we should adjust the last end date with Scenario.adjust_end()
because the last end date is differenct from the other scenarios at this time.
[44]:
# Adjust the last end dates
snl.adjust_end()
# Show the last phases of all scenarios
all_df = snl.summary().reset_index()
for name in all_df["Scenario"].unique():
df = snl.summary(name=name)
last_end_date = df.loc[df.index[-1], "End"]
print(f"{name} scenario: to {last_end_date}")
Main scenario: to 31Jul2021
Medicine scenario: to 31Jul2021
Forecast scenario: to 31Jul2021
Simulate the number of cases of forecast scenario.
[45]:
_ = snl.simulate(variables="CFR", name="Forecast").tail()
Compare the number of cases of the all scenario with Scenario.history()
and variable name.
[46]:
_ = snl.history("Infected")
We can focus on the values in specified date range with the following arguments.
dates
: tuple of start date and end datepast_days
(integer): how many past days to use in calculation from today (Scenario.today
property)phases
(list of str): phase names to use in calculation
These arguments are effective with Scenario.history()
, Scenario.simulate()
, Scenario.track()
and Scenario.score()
.
[47]:
# Get the minimum value (from today to future) to set lower limit of y-axis
lower_limit = snl.history("Infected", dates=(snl.today, None), show_figure=False).min().min()
# From today to future (no limitation regarding end date)
_ = snl.history("Infected", dates=(snl.today, None), ylim=(lower_limit, None))
In the past 20 days. Reference date is today (Scenario.today
property).
[48]:
_ = snl.history("Infected", past_days=20)
In the selected phases. Here, we will show the 3rd, 4th and 5th phase.
[49]:
_ = snl.history("Infected", phases=["3rd", "4th", "5th"])
Compare the scenarios¶
We will compare the scenarios with representative values, reproduction number and parameter values. Currently, we can compare the scenarios with the following indexes.
max(Infected): max value of Infected
argmax(Infected): the date when Infected shows max value
Infected on …: Infected on the end date of the last phase
Fatal on …: Fatal on the end date of the last phase
[50]:
snl.describe()
[50]:
| max(Infected) | argmax(Infected) | Confirmed on 31Jul2021 | Infected on 31Jul2021 | Fatal on 31Jul2021 | 42nd_Rt | 43rd_Rt | |
|---|---|---|---|---|---|---|---|
| Main | 80225 | 19May2021 | 812562 | 3720 | 16176 | 0.57 | 0.57 |
| Medicine | 80225 | 19May2021 | 812011 | 2771 | 16141 | 0.57 | 0.47 |
| Forecast | 129928 | 31Jul2021 | 1099866 | 129928 | 19154 | 1.50 | 1.50 |
[51]:
_ = snl.history(target="Infected")
[52]:
_ = snl.history(target="Rt")
[53]:
_ = snl.history(target="rho")
[54]:
_ = snl.history(target="sigma")
[55]:
_ = snl.history(target="theta")
[56]:
_ = snl.history(target="kappa")
Change rate of parameters in main scenario¶
History of each parameter will be shown. Values will be divided by the values in 0th phase.
[57]:
_ = snl.history_rate(name="Main")
Retrospective analysis¶
We can evaluate the impact of measures using past records. How many people were infected if the parameter values have not changed sinse 01Sep2020?
[58]:
# Perform retrospective analysis
snl_retro = cs.Scenario(country="Japan")
snl_retro.register(jhu_data)
snl_retro.retrospective(
"01Jan2021", model=cs.SIRF, control="Main", target="Retrospective", timeout=10)
<SIR-F model: parameter estimation>
Running optimization with 4 CPUs...
6th phase (11Apr2020 - 23Apr2020): finished 339 trials in 0 min 10 sec
9th phase (14May2020 - 28May2020): finished 333 trials in 0 min 10 sec
3rd phase (14Mar2020 - 24Mar2020): finished 339 trials in 0 min 10 sec
0th phase (06Feb2020 - 18Feb2020): finished 398 trials in 0 min 10 sec
10th phase (29May2020 - 10Jun2020): finished 175 trials in 0 min 5 sec
7th phase (24Apr2020 - 02May2020): finished 318 trials in 0 min 10 sec
4th phase (25Mar2020 - 02Apr2020): finished 321 trials in 0 min 10 sec
1st phase (19Feb2020 - 05Mar2020): finished 319 trials in 0 min 10 sec
11th phase (11Jun2020 - 23Jun2020): finished 323 trials in 0 min 10 sec
8th phase (03May2020 - 13May2020): finished 313 trials in 0 min 10 sec
5th phase (03Apr2020 - 10Apr2020): finished 315 trials in 0 min 10 sec
2nd phase (06Mar2020 - 13Mar2020): finished 325 trials in 0 min 10 sec
12th phase (24Jun2020 - 03Jul2020): finished 333 trials in 0 min 10 sec
15th phase (31Jul2020 - 13Aug2020): finished 323 trials in 0 min 10 sec 18th phase (11Sep2020 - 25Sep2020): finished 319 trials in 0 min 10 sec
21st phase (18Oct2020 - 26Oct2020): finished 320 trials in 0 min 10 sec
13th phase (04Jul2020 - 16Jul2020): finished 328 trials in 0 min 10 sec
16th phase (14Aug2020 - 26Aug2020): finished 312 trials in 0 min 10 sec
19th phase (26Sep2020 - 09Oct2020): finished 322 trials in 0 min 10 sec
22nd phase (27Oct2020 - 09Nov2020): finished 319 trials in 0 min 10 sec
14th phase (17Jul2020 - 30Jul2020): finished 323 trials in 0 min 10 sec
23rd phase (10Nov2020 - 21Nov2020): finished 190 trials in 0 min 5 sec
17th phase (27Aug2020 - 10Sep2020): finished 325 trials in 0 min 10 sec
20th phase (10Oct2020 - 17Oct2020): finished 323 trials in 0 min 10 sec
27th phase (30Dec2020 - 31Dec2020): finished 280 trials in 0 min 5 sec
30th phase (21Jan2021 - 29Jan2021): finished 177 trials in 0 min 5 sec
33rd phase (19Feb2021 - 27Feb2021): finished 177 trials in 0 min 5 sec
24th phase (22Nov2020 - 03Dec2020): finished 321 trials in 0 min 10 sec
31st phase (30Jan2021 - 08Feb2021): finished 176 trials in 0 min 5 sec
34th phase (28Feb2021 - 09Mar2021): finished 183 trials in 0 min 5 sec
28th phase (01Jan2021 - 12Jan2021): finished 321 trials in 0 min 10 sec
32nd phase (09Feb2021 - 18Feb2021): finished 178 trials in 0 min 5 sec
25th phase (04Dec2020 - 16Dec2020): finished 316 trials in 0 min 10 sec
35th phase (10Mar2021 - 24Mar2021): finished 174 trials in 0 min 5 sec
29th phase (13Jan2021 - 20Jan2021): finished 168 trials in 0 min 5 sec
42nd phase (03Jun2021 - 16Jun2021): finished 170 trials in 0 min 5 sec
36th phase (25Mar2021 - 07Apr2021): finished 306 trials in 0 min 10 sec
26th phase (17Dec2020 - 29Dec2020): finished 312 trials in 0 min 10 sec
39th phase (29Apr2021 - 06May2021): finished 309 trials in 0 min 10 sec
37th phase (08Apr2021 - 19Apr2021): finished 391 trials in 0 min 10 sec
40th phase (07May2021 - 19May2021): finished 378 trials in 0 min 10 sec
41st phase (20May2021 - 02Jun2021): finished 163 trials in 0 min 5 sec
38th phase (20Apr2021 - 28Apr2021): finished 346 trials in 0 min 10 sec
Completed optimization. Total: 1 min 46 sec
<SIR-F model: parameter estimation>
Running optimization with 4 CPUs...
0th phase (06Feb2020 - 18Feb2020): finished 352 trials in 0 min 10 sec
2nd phase (06Mar2020 - 13Mar2020): finished 318 trials in 0 min 10 sec 6th phase (11Apr2020 - 23Apr2020): finished 313 trials in 0 min 10 sec
4th phase (25Mar2020 - 02Apr2020): finished 304 trials in 0 min 10 sec
1st phase (19Feb2020 - 05Mar2020): finished 309 trials in 0 min 10 sec
7th phase (24Apr2020 - 02May2020): finished 303 trials in 0 min 10 sec
5th phase (03Apr2020 - 10Apr2020): finished 322 trials in 0 min 10 sec
3rd phase (14Mar2020 - 24Mar2020): finished 312 trials in 0 min 10 sec
10th phase (29May2020 - 10Jun2020): finished 158 trials in 0 min 5 sec
8th phase (03May2020 - 13May2020): finished 297 trials in 0 min 10 sec
14th phase (17Jul2020 - 30Jul2020): finished 299 trials in 0 min 10 sec 12th phase (24Jun2020 - 03Jul2020): finished 302 trials in 0 min 10 sec
11th phase (11Jun2020 - 23Jun2020): finished 300 trials in 0 min 10 sec
9th phase (14May2020 - 28May2020): finished 300 trials in 0 min 10 sec
15th phase (31Jul2020 - 13Aug2020): finished 298 trials in 0 min 10 sec
13th phase (04Jul2020 - 16Jul2020): finished 303 trials in 0 min 10 sec
16th phase (14Aug2020 - 26Aug2020): finished 296 trials in 0 min 10 sec
18th phase (11Sep2020 - 25Sep2020): finished 292 trials in 0 min 10 sec
20th phase (10Oct2020 - 17Oct2020): finished 297 trials in 0 min 10 sec
22nd phase (27Oct2020 - 09Nov2020): finished 300 trials in 0 min 10 sec
17th phase (27Aug2020 - 10Sep2020): finished 309 trials in 0 min 10 sec
23rd phase (10Nov2020 - 21Nov2020): finished 163 trials in 0 min 5 sec
19th phase (26Sep2020 - 09Oct2020): finished 304 trials in 0 min 10 sec
21st phase (18Oct2020 - 26Oct2020): finished 303 trials in 0 min 10 sec
24th phase (22Nov2020 - 03Dec2020): finished 311 trials in 0 min 10 sec
26th phase (17Dec2020 - 29Dec2020): finished 316 trials in 0 min 10 sec
28th phase (01Jan2021 - 16Jun2021): finished 325 trials in 0 min 10 sec
25th phase (04Dec2020 - 16Dec2020): finished 179 trials in 0 min 5 sec
27th phase (30Dec2020 - 31Dec2020): finished 328 trials in 0 min 5 sec
Completed optimization. Total: 1 min 11 sec
[59]:
# Show the summary of estimation
cols = ["Start", "End", "ODE", "Rt", *cs.SIRF.PARAMETERS] + ["RMSLE", "Trials", "Runtime"]
snl_retro.summary(columns=cols)
[59]:
| Start | End | ODE | Rt | theta | kappa | rho | sigma | RMSLE | Trials | Runtime | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Scenario | Phase | |||||||||||
| Main | 0th | 06Feb2020 | 18Feb2020 | SIR-F | 2.23 | 0.027740 | 0.000000 | 0.067256 | 0.029281 | 0.142968 | 398.0 | 0 min 10 sec |
| 1st | 19Feb2020 | 05Mar2020 | SIR-F | 4.93 | 0.007714 | 0.001322 | 0.136657 | 0.026198 | 0.170717 | 319.0 | 0 min 10 sec | |
| 2nd | 06Mar2020 | 13Mar2020 | SIR-F | 5.06 | 0.022125 | 0.000656 | 0.126654 | 0.023830 | 0.093897 | 325.0 | 0 min 10 sec | |
| 3rd | 14Mar2020 | 24Mar2020 | SIR-F | 2.57 | 0.000096 | 0.002956 | 0.063547 | 0.021736 | 0.029797 | 339.0 | 0 min 10 sec | |
| 4th | 25Mar2020 | 02Apr2020 | SIR-F | 5.16 | 0.008327 | 0.000738 | 0.117883 | 0.021914 | 0.036594 | 321.0 | 0 min 10 sec | |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| Retrospective | 24th | 22Nov2020 | 03Dec2020 | SIR-F | 1.29 | 0.000778 | 0.000817 | 0.105297 | 0.080746 | 0.014815 | 311.0 | 0 min 10 sec |
| 25th | 04Dec2020 | 16Dec2020 | SIR-F | 1.18 | 0.000290 | 0.001435 | 0.096849 | 0.080680 | 0.011146 | 179.0 | 0 min 5 sec | |
| 26th | 17Dec2020 | 29Dec2020 | SIR-F | 1.20 | 0.000823 | 0.001372 | 0.100629 | 0.082107 | 0.012099 | 316.0 | 0 min 10 sec | |
| 27th | 30Dec2020 | 31Dec2020 | SIR-F | 1.81 | 0.000399 | 0.001710 | 0.104160 | 0.055658 | 0.000481 | 328.0 | 0 min 5 sec | |
| 28th | 01Jan2021 | 16Jun2021 | SIR-F | 1.00 | 0.008214 | 0.000873 | 0.104209 | 0.102629 | 0.355434 | 325.0 | 0 min 10 sec |
72 rows × 11 columns
[60]:
# History of reproduction number
_ = snl_retro.history("Rt")
[61]:
# History of Infected
_ = snl_retro.history("Infected")
[62]:
# Show the representative values
snl_retro.describe()
[62]:
| max(Infected) | argmax(Infected) | Confirmed on 16Jun2021 | Infected on 16Jun2021 | Fatal on 16Jun2021 | 4th_Rt | 25th_Rt | 28th_Rt | 29th_Rt | 30th_Rt | ... | 33rd_Rt | 34th_Rt | 35th_Rt | 36th_Rt | 37th_Rt | 38th_Rt | 39th_Rt | 40th_Rt | 41st_Rt | 42nd_Rt | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Main | 80153 | 19May2021 | 782120 | 26659 | 14257 | 5.16 | 1.17 | 1.65 | 1.24 | 0.76 | ... | 0.68 | 0.77 | 1.13 | 1.67 | 1.49 | 1.54 | 1.35 | 1.24 | 0.76 | 0.57 |
| Retrospective | 37436 | 01Jan2021 | 856310 | 33886 | 13575 | 4.96 | 1.18 | 1.00 | - | - | ... | - | - | - | - | - | - | - | - | - | - |
2 rows × 22 columns


What You Should Know About the Blaster Worm
Here. "At 11:34 A.M. Pacific Time on August 11, Microsoft began investigating a worm reported by Microsoft Product Support Services (PSS). A new worm commonly known as W32.Blaster.Worm has been identified that exploits the vulnerability that was addressed by Microsoft Security Bulletin MS03-026."


Obaseki congratulates Lyon, Bello on victory at guber polls
The Edo State Governor, Mr. Godwin Obaseki, has congratulated the governor-elect of Bayelsa State, David Lyon and his Kogi State counterpart, Yahaya Bello, on their victory in the Saturday, November 16, gubernatorial polls.
The governor, in a statement, said the victory of both governors-elect is a triumph for the All Progressives Congress (APC), and has once again proven the party to be the peoples’ choice.
According to him, “I want to congratulate governors-elect, David Lyon and Yahaya, of Bayelsa and Kogi states, respectfully, for securing the mandate of their people and swelling the ranks of the APC. It is refreshing that the good people of Bayelsa State have decided to join the ranks of the APC in the South-South and we are indeed delighted to have them in the fold.
Read Also: Lawan congratulates Lyon, Bello
“I also extend congratulations to President Muhammadu Buhari, whose policies and reforms has endeared our great party to more people across the length and breadth of the country.”
He noted that the victory in Bayelsa is most significant for the APC as the feat underscores the party’s growing acceptance in the South-South, adding, “Before now, Edo was the only state bearing the flag of the APC in the South-south. But now, we have a new addition to the fold, ensuring that more people in this part of the country benefit from the impactful policies of the APC.”
The governor said he is committed to working with the new governors-elect to share ideas and deepen the development strides of the APC across the country.


| Favorite Games | Favorite Books | Favorite Albums |
|---|---|---|
| Starcraft 2 | The Name of the Wind | 'Crush' by Lettuce |
| Magic: The Gathering | A Wise Man's Fear | 'Spirit' by Earth, Wind, and Fire |
| Warcraft 3 | Mistborn | 'Digitonium' by Turkuaz |
| Minecraft | The Lies of Locke Lamora | 'Wish You Were Here' by Pink Floyd |
| Settlers of Catan | Stormlight Archive | 'Deltron 3030' by Deltron 3030 |
Glade is very passionate about many styles of music. The main style of music he loves is funk. Funk music was created by many people, but the majority of the credit for pioneering the genre goes to James Brown and Sly Stone.
Another one of Glade's passions are strategy games. Real time strategy or RTS games are Glade's favorite. He has played such games as Starcraft 2 and Warcraft 3 for years. He is also a large fan of the trading card game Magic the Gathering.
Glade is a fan of fantasy literature. His favorite authors are Patrick Rothfuss, Brandon Sanderson, Scott Lynch, and many others.


{# Extension of default Sphinx layout template #} {% extends '!layout.html' %} {# Include our own CSS file with the theme's stylesheets #} {% set css_files = css_files + ['_static/style.css'] %} {% block footer %} {{ super() }} {# Alabaster theme doesn't provide a proper hook to add additional copyright text to the footer, so we cheat a little to make it look okay-ish #} {# TODO: file an issue (or submit a PR) with Alabaster and reference it here #}
{% endblock %}


Not A Legend
Here. Maybe he's not a official legend, but he's done what I've never been able to do: build a successful software business.
Plus, his site lampoons the "official" software legend site [1] nicely. : )
http://www.softwarelegends.com


---
layout: post
title: ''
date: '2010-10-26T11:24:03-07:00'
tags:
tumblr_url: http://alexhwilliams.tumblr.com/post/1408086666/new-footage-emerges-of-moveon-activist-stomped-by
---
New Footage Emerges Of MoveOn Activist Stomped By Rand Paul Supporter
The calls for civil discourse will not be heard. Thugs beat up people. They throw fists and clubs. We can’t expect them to understand concepts that require them to think. Their leaders know that and will exploit the frustrations of this weak minded lot by continuing to play to their fears.
Okay - on with the day.


Testimonials
Yrevocnu is an art project, a political movement, a scientific experiment, and, in the broadest possible sense, a romance, all in one. It's not for everybody. In this space, we display testimonials solicited from attendees in response to their first Event.


{% import 'macros/camera_feed.html' as kinect_macro %} {% import 'macros/console.html' as console_macro %}


This page pulls data from a google spreadsheet. The spreadsheet is here. The spreadsheet is filled from this google form but you can also just manually enter data into the spreadsheet. This only works if you "publish the spreadsheet the web", an option under "File" in google drive.


Work Log
Homework 2
Brother Twitchell,
CS273
Brother Michael Carey
Date Start Stop Interruption Work
mm/dd/yy hh:mm hh:mm mmm mmm
|
100 points
Expand acronyms, if appropriate, and briefly define the following terms (as they relate to the Internet). State the source(s) of your definitions. Submit as a text file (with the work log in the same file). 1. applet - A program designed to be executed from within another application. Unlike an application, applets cannot be executed directly from the operating system. With the growing popularity of OLE (object linking and embedding), applets are becoming more prevalent. A well-designed applet can be invoked from many different applications. 2. CGI - Abbreviation of Common Gateway Interface, a specification for transferring information between a World Wide Web server and a CGI program. A CGI program is any program designed to accept and return data that conforms to the CGI specification. The program could be written in any programming language, including C, Perl, Java, or Visual Basic. 3. client - The client part of a client-server architecture. Typically, a client is an application that runs on a personal computer or workstation and relies on a server to perform some operations. For example, an e-mail client is an application that enables you to send and receive e-mail. 4. DHTML - (1) Refers to Web content that changes each time it is viewed. For example, the same URL could result in a different page depending on any number of parameters, such as: Geographic location of the reader Time of day Previous pages viewed by the reader Profile of the reader There are many technologies for producing dynamic HTML, including CGI scripts, Server-Side Includes (SSI), cookies, Java, JavaScript, and ActiveX. (2) When capitalized, Dynamic HTML refers to new HTML extensions that will enable a Web page to react to user input without sending requests to the Web server. Microsoft and Netscape have submitted competing Dynamic HTML proposals to W3C, which is producing the final specification. 5. DNS - (1) Short for Domain Name System (or Service), an Internet service that translates domain names into IP addresses. Because domain names are alphabetic, they're easier to remember. The Internet however, is really based on IP addresses. Every time you use a domain name, therefore, a DNS service must translate the name into the corresponding IP address. For example, the domain name www.example.com might translate to <IP_ADDRESS>. The DNS system is, in fact, its own network. If one DNS server doesn't know how to translate a particular domain name, it asks another one, and so on, until the correct IP address is returned. (2) Short for digital nervous system, a term coined by Bill Gates to describe a network of personal computers that make it easier to obtain and understand information. 6. ethernet - A local-area network (LAN) architecture developed by Xerox Corporation in cooperation with DEC and Intel in 1976. Ethernet uses a bus or star topology and supports data transfer rates of 10 Mbps. The Ethernet specification served as the basis for the IEEE 802.3 standard, which specifies the physical and lower software layers. Ethernet uses the CSMA/CD access method to handle simultaneous demands. It is one of the most widely implemented LAN standards. A newer version of Ethernet, called 100Base-T (or Fast Ethernet), supports data transfer rates of 100 Mbps. And the newest version, Gigabit Ethernet supports data rates of 1 gigabit (1,000 megabits) per second. 7. FTP - Abbreviation of File Transfer Protocol, the protocol used on the Internet for sending files. 8. gopher - A system that pre-dates the World Wide Web for organizing and displaying files on Internet servers. A Gopher server presents its contents as a hierarchically structured list of files. With the ascendance of the Web, many gopher databases were converted to Web sites which can be more easily accessed via Web search engines. Gopher was developed at the 9. HTML - Short for Hyper Text Markup Language, the authoring language used to create documents on the World Wide Web. HTML is similar to SGML, although it is not a strict subset. HTML defines the structure and layout of a Web document by using a variety of tags and attributes. The correct structure for an HTML document starts with (enter here what document is about) and ends with . All the information you'd like to include in your Web page fits in between the  and  tags. There are hundreds of other tags used to format and layout the information in a Web page. Tags are also used to specify hypertext links. These allow Web developers to direct users to other Web pages with only a click of the mouse on either an image or word(s). For a more complete list of tags, check out some of the URLs below. 10. HTTP - Short for Hyper Text Transfer Protocol, the underlying protocol used by the World Wide Web. HTTP defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. For example, when you enter a URL in your browser, this actually sends an HTTP command to the Web server directing it to fetch and transmit the requested Web page. The other main standard that controls how the World Wide Web works is HTML, which covers how Web pages are formatted and displayed. HTTP is called a stateless protocol because each command is executed independently, without any knowledge of the commands that came before it. This is the main reason that it is difficult to implement Web sites that react intelligently to user input. This shortcoming of HTTP is being addressed in a number of new technologies, including ActiveX, Java, JavaScript and cookies. 11. Internet - A global network connecting millions of computers. More than 100 countries are linked into exchanges of data, news and opinions. Unlike online services, which are centrally controlled, the Internet is decentralized by design. Each Internet computer, called a host, is independent. Its operators can choose which Internet services to use and which local services to make available to the global Internet community. Remarkably, this anarchy by design works exceedingly well. There are a variety of ways to access the Internet. Most online services, such as America Online, offer access to some Internet services. It is also possible to gain access through a commercial Internet Service Provider (ISP). The Internet is not synonymous with World Wide Web. 12. IP address - An identifier for a computer or device on a TCP/IP network. Networks using the TCP/IP protocol route messages based on the IP address of the destination. The format of an IP address is a 32-bit numeric address written as four numbers separated by periods. Each number can be zero to 255. For example, <IP_ADDRESS> could be an IP address. Within an isolated network, you can assign IP addresses at random as long as each one is unique. However, connecting a private network to the Internet requires using registered IP addresses (called Internet addresses) to avoid duplicates. The four numbers in an IP address are used in different ways to identify a particular network and a host on that network. Three regional Internet registries -- ARIN, RIPE NCC and APNIC -- assign Internet addresses from the following three classes. Class A - supports 16 million hosts on each of 127 networks Class B - supports 65,000 hosts on each of 16,000 networks Class C - supports 254 hosts on each of 2 million networks The number of unassigned Internet addresses is running out, so a new classless scheme called CIDR is gradually replacing the system based on classes A, B, and C and is tied to adoption of IPv6. 13. MIME - Short for Multipurpose Internet Mail Extensions, a specification for formatting non-ASCII messages so that they can be sent over the Internet. Many e-mail clients now support MIME, which enables them to send and receive graphics, audio, and video files via the Internet mail system. In addition, MIME supports messages in character sets other than ASCII. There are many predefined MIME types, such as GIF graphics files and PostScript files. It is also possible to define your own MIME types. In addition to e-mail applications, Web browsers also support various MIME types. This enables the browser to display or output files that are not in HTML format. MIME was defined in 1992 by the Internet Engineering Task Force (IETF). A new version, called S/MIME, supports encrypted messages. 14. ping - A utility to determine whether a specific IP address is accessible. It works by sending a packet to the specified address and waiting for a reply. 15. router - A device that forwards data packets along networks. A router is connected to at least two networks, commonly two LANs or WANs or a LAN and its ISPs network. Routers are located at gateways, the places where two or more networks connect. Routers use headers and forwarding tables to determine the best path for forwarding the packets, and they use protocols such as ICMP to communicate with each other and configure the best route between any two hosts. Very little filtering of data is done through routers. 16. SSL - Short for Secure Sockets Layer, a protocol developed by Netscape for transmitting private documents via the Internet. SSL works by using a public key to encrypt data that's transferred over the SSL connection. Both Netscape Navigator and Internet Explorer support SSL, and many Web sites use the protocol to obtain confidential user information, such as credit card numbers. By convention, URLs that require an SSL connection start with https: instead of http:. Another protocol for transmitting data securely over the World Wide Web is Secure HTTP (S-HTTP). Whereas SSL creates a secure connection between a client and a server, over which any amount of data can be sent securely, S-HTTP is designed to transmit individual messages securely. SSL and S-HTTP, therefore, can be seen as complementary rather than competing technologies. Both protocols have been approved by the Internet Engineering Task Force (IETF) as a standard. 17. SGML - Short for Standard Generalized Markup Language, a system for organizing and tagging elements of a document. SGML was developed and standardized by the International Organization for Standards (ISO) in 1986. SGML itself does not specify any particular formatting; rather, it specifies the rules for tagging elements. These tags can then be interpreted to format elements in different ways. SGML is used widely to manage large documents that are subject to frequent revisions and need to be printed in different formats. Because it is a large and complex system, it is not yet widely used on personal computers. However, the growth of Internet, and especially the World Wide Web, is creating renewed interest in SGML because the World Wide Web uses HTML, which is one way of defining and interpreting tags according to SGML rules. 18. server - A computer or device on a network that manages network resources. For example, a file server is a computer and storage device dedicated to storing files. Any user on the network can store files on the server. A print server is a computer that manages one or more printers, and a network server is a computer that manages network traffic. A database server is a computer system that processes database queries. Servers are often dedicated, meaning that they perform no other tasks besides their server tasks. On multiprocessing operating systems, however, a single computer can execute several programs at once. A server in this case could refer to the program that is managing resources rather than the entire computer. 19. T1 - A dedicated phone connection supporting data rates of 1.544Mbits per second. A T-1 line actually consists of 24 individual channels, each of which supports 64Kbits per second. Each 64Kbit/second channel can be configured to carry voice or data traffic. Most telephone companies allow you to buy just some of these individual channels, known as fractional T-1 access. T-1 lines are a popular leased line option for businesses connecting to the Internet and for Internet Service Providers (ISPs) connecting to the Internet backbone. The Internet backbone itself consists of faster T-3 connections. T-1 lines are sometimes referred to as DS1 lines. 20. TCP/IP - Abbreviation for Transmission Control Protocol/Internet Protocol, the suite of communications protocols used to connect hosts on the Internet. TCP/IP uses several protocols, the two main ones being TCP and IP. TCP/IP is built into the UNIX operating system and is used by the Internet, making it the de facto standard for transmitting data over networks. Even network operating systems that have their own protocols, such as Netware, also support TCP/IP. 21. telnet - A terminal emulation program for TCP/IP networks such as the Internet. The Telnet program runs on your computer and connects your PC to a server on the network. You can then enter commands through the Telnet program and they will be executed as if you were entering them directly on the server console. This enables you to control the server and communicate with other servers on the network. To start a Telnet session, you must log in to a server by entering a valid username and password. Telnet is a common way to remotely control Web servers. 22. traceroute - A utility that traces a packet from your computer to an Internet host, showing how many hops the packet requires to reach the host and how long each hop takes. If you're visiting a Web site and pages are appearing slowly, you can use traceroute to figure out where the longest delays are occurring. The original traceroute is a UNIX utility, but nearly all platforms have something similar. Windows includes a traceroute utility called tracert. In Windows 95, you can run tracert by selecting Start->Run, and then entering tracert followed by the domain name of the host. For example: The Acyonym telnet has several meanings Network Virtual Terminal Protocol ( Internet ) Telecommunications Network Teleconferencing Network Telephone Network Teletypewriter Network tracert www.pcwebopedia.com Traceroute utilities work by sending packets with low time-to-live (TTL) fields. The TTL value specifies how many hops the packet is allowed before it is returned. When a packet can't reach its destination because the TTL value is too low, the last host returns the packet and identifies itself. By sending a series of packets and incrementing the TTL value with each successive packet, traceroute finds out who all the intermediary hosts are. 23. W3C - Short for World Wide Web Consortium, an international consortium of companies involved with the Internet and the Web. The W3C was founded in 1994 by Tim Berners-Lee, the original architect of the World Wide Web. The organization's purpose is to develop open standards so that the Web evolves in a single direction rather than being splintered among competing factions. 24. XHTML - Short for Extensible Hypertext Markup Language, a hybrid between HTML and XML specifically designed for Net device displays. XHTML is a markup language written in XML; therefore, it is an XML application. XHTML uses three XML namespaces (used to qualify element and attributes names by associating them with namespaces identified by URI references. Namespaces prevent identically custom-named tags that may be used in different XML documents from being read the same way), which correspond to three HTML 4.0 DTDs: Strict, Transitional, and Frameset. XHTML markup must conform to the markup standards defined in a HTML DTD. When applied to Net devices, XHTML must go through a modularization process. This enables XHTML pages to be read by many different platforms. A device designer, using standard building blocks, will specify which elements are supported. Content creators will then target these building blocks--or modules. Because these modules conform to certain standards, XHTML's extensibility ensures that layout and presentation stay true-to-form over any platform. 25. XML - Short for Extensible Markup Language, a specification developed by the W3C. XML is a pared-down version of SGML, designed especially for Web documents. It allows designers to create their own customized tags, enabling the definition, transmission, validation, and interpretation of data between applications and between organizations. All sources were found at http://www.pcwebopedia.com Aditional source was found for Telent at http://www.acronymfinder.com |


HobbySpot
Fill Out Form
Navbar Link
menu
Home
Form
First Name
Last Name
Email
Date of Birth
Password
Re-Enter Password
Hobbies
Main Device Used:
Computer
Mobile Device
Other
Create Account!


v0.6.1
- Fixed: level change sound and 1 minute warning sound was not played correctly
----
v0.6.0
+ Added: Player Out sound effect
----
v0.5.2
----
- Fixed: tournament reset did not reset addons
- Fixed: import from v0.3
+ Added: All-In sound effect added
! Improved: level scrolling does not scroll the page anymore
v0.5.1
----
+ Improved: usage guide
v0.5
----
+ Added support for presets: can create, change and delete presets
+ Added support for preset export/import
! Improved: mobile view
! Improved: scaling UI elements based on screen
! Improved: small fixes to texts and layout
v0.4
----
+ Added: break support
+ Added: when tournament in progress, browser does not let you navigate away
! Improved: angular js rewrite
v0.3
----
- Fixed: ticking does not loop anymore
v0.2
----
- Fixed: font selection to work better on iPad
- Fixed: corrected minor typos
+ Added: IE9 pin to taskbar support (drag application tab onto taskbar to pin it)
+ Added: usage page to describe how to use
+ Added: HTML5 offline application feature
! Improved: clock ticking looping below 1 minute (does not work on Firefox yet, because of FF bug, needs FF v11)


A set of statistical tools for inferring unknown parameters in continuous time processes governed by ordinary differential equations (ODE). Moreover, variance reduction and model selection can be obtained through various implemented penalisation schemes. The package offers two estimation procedures: exact estimation via least squares and a faster approximate estimation via inverse collocation methods. All estimators can handle multiple data sets arising from the same ODE system, but subjected to different interventions.
| Version: | 1.0.0 |
| Depends: | R (≥ 3.4.0) |
| Imports: | Matrix (≥ 1.2-9), glmnet (≥ 2.0-10), Rcpp (≥ 0.12.11), methods (≥ 3.4), stats (≥ 3.4), nnls (≥ 1.4) |
| LinkingTo: | Rcpp, RcppArmadillo |
| Suggests: | testthat, knitr, rmarkdown, devtools |
| Published: | 2017-10-29 |
| Author: | Frederik Vissing Mikkelsen [aut, cre] |
| Maintainer: | Frederik Vissing Mikkelsen <mifretz at gmail.com> |
| License: | GPL-3 |
| NeedsCompilation: | yes |
| SystemRequirements: | GNU make |
| CRAN checks: | episode results |
| Reference manual: | episode.pdf |
| Vignettes: |
Vignette Title |
| Package source: | episode_1.0.0.tar.gz |
| Windows binaries: | r-devel: episode_1.0.0.zip, r-release: episode_1.0.0.zip, r-oldrel: episode_1.0.0.zip |
| OS X binaries: | r-release: episode_1.0.0.tgz, r-oldrel: episode_1.0.0.tgz |
Please use the canonical form https://CRAN.R-project.org/package=episode to link to this page.


JavaScript is disabled on your browser.
Skip navigation links
Overview
Package
Class
Tree
Deprecated
Index
Help
Prev
Next
Frames
No Frames
All Classes
Hierarchy For All Packages
Package Hierarchies:
io.github.ph1lou.werewolfapi
,
io.github.ph1lou.werewolfapi.enumlg
,
io.github.ph1lou.werewolfapi.events
,
io.github.ph1lou.werewolfapi.rolesattributs
Class Hierarchy
java.lang.Object
org.bukkit.event.Event
io.github.ph1lou.werewolfapi.events.
ActionBarEvent
io.github.ph1lou.werewolfapi.events.
AngelChoiceEvent
io.github.ph1lou.werewolfapi.events.
AngelTargetDeathEvent
io.github.ph1lou.werewolfapi.events.
AngelTargetEvent
io.github.ph1lou.werewolfapi.events.
AutoAngelEvent
io.github.ph1lou.werewolfapi.events.
AutoModelEvent
io.github.ph1lou.werewolfapi.events.
BeginCharmEvent
io.github.ph1lou.werewolfapi.events.
BeginSniffEvent
io.github.ph1lou.werewolfapi.events.
BorderStartEvent
io.github.ph1lou.werewolfapi.events.
BorderStopEvent
io.github.ph1lou.werewolfapi.events.
CharmEvent
io.github.ph1lou.werewolfapi.events.
CitizenCancelVoteEvent
io.github.ph1lou.werewolfapi.events.
CitizenSeeVoteEvent
io.github.ph1lou.werewolfapi.events.
CupidLoversEvent
io.github.ph1lou.werewolfapi.events.
CurseEvent
io.github.ph1lou.werewolfapi.events.
DayEvent
io.github.ph1lou.werewolfapi.events.
DayWillComeEvent
io.github.ph1lou.werewolfapi.events.
DiggingEndEvent
io.github.ph1lou.werewolfapi.events.
DonEvent
io.github.ph1lou.werewolfapi.events.
EndPlayerMessageEvent
io.github.ph1lou.werewolfapi.events.
FinalDeathEvent
io.github.ph1lou.werewolfapi.events.
FirstDeathEvent
(implements org.bukkit.event.Cancellable)
io.github.ph1lou.werewolfapi.events.
GenerationStartEvent
io.github.ph1lou.werewolfapi.events.
GenerationStopEvent
io.github.ph1lou.werewolfapi.events.
GoldenAppleParticleEvent
(implements org.bukkit.event.Cancellable)
io.github.ph1lou.werewolfapi.events.
InvestigateEvent
io.github.ph1lou.werewolfapi.events.
InvisibleEvent
io.github.ph1lou.werewolfapi.events.
LoversRepartitionEvent
io.github.ph1lou.werewolfapi.events.
ModelEvent
io.github.ph1lou.werewolfapi.events.
NewDisplayRole
io.github.ph1lou.werewolfapi.events.
NewWereWolfEvent
io.github.ph1lou.werewolfapi.events.
NightEvent
io.github.ph1lou.werewolfapi.events.
ProtectionEvent
io.github.ph1lou.werewolfapi.events.
ResurrectionEvent
io.github.ph1lou.werewolfapi.events.
ElderResurrectionEvent
io.github.ph1lou.werewolfapi.events.
InfectionEvent
io.github.ph1lou.werewolfapi.events.
SuccubusResurrectionEvent
io.github.ph1lou.werewolfapi.events.
WitchResurrectionEvent
io.github.ph1lou.werewolfapi.events.
RevealAmnesiacLoversEvent
io.github.ph1lou.werewolfapi.events.
RevealCursedLoversEvent
io.github.ph1lou.werewolfapi.events.
RevealLoversEvent
io.github.ph1lou.werewolfapi.events.
SecondDeathEvent
(implements org.bukkit.event.Cancellable)
io.github.ph1lou.werewolfapi.events.
SeerEvent
io.github.ph1lou.werewolfapi.events.
SelectionEndEvent
io.github.ph1lou.werewolfapi.events.
SisterDeathEvent
io.github.ph1lou.werewolfapi.events.
SniffEvent
io.github.ph1lou.werewolfapi.events.
StartEvent
io.github.ph1lou.werewolfapi.events.
StealEvent
io.github.ph1lou.werewolfapi.events.
StopEvent
io.github.ph1lou.werewolfapi.events.
ThirdDeathEvent
(implements org.bukkit.event.Cancellable)
io.github.ph1lou.werewolfapi.events.
TrackEvent
io.github.ph1lou.werewolfapi.events.
TransformationEvent
io.github.ph1lou.werewolfapi.events.
AmnesiacTransformationEvent
io.github.ph1lou.werewolfapi.events.
WildChildTransformationEvent
io.github.ph1lou.werewolfapi.events.
TroubleMakerDeathEvent
io.github.ph1lou.werewolfapi.events.
TroubleMakerEvent
io.github.ph1lou.werewolfapi.events.
UpdateConfigEvent
io.github.ph1lou.werewolfapi.events.
UpdateEvent
io.github.ph1lou.werewolfapi.events.
UseMaskEvent
io.github.ph1lou.werewolfapi.events.
VoteEndEvent
io.github.ph1lou.werewolfapi.events.
VoteEvent
io.github.ph1lou.werewolfapi.events.
VoteResultEvent
io.github.ph1lou.werewolfapi.events.
WereWolfListEvent
io.github.ph1lou.werewolfapi.events.
WinConditionsCheckEvent
(implements org.bukkit.event.Cancellable)
io.github.ph1lou.werewolfapi.events.
WinEvent
io.github.ph1lou.werewolfapi.
RoleRegister
Interface Hierarchy
io.github.ph1lou.werewolfapi.rolesattributs.
AffectedPlayers
io.github.ph1lou.werewolfapi.
ConfigWereWolfAPI
io.github.ph1lou.werewolfapi.rolesattributs.
Display
io.github.ph1lou.werewolfapi.
GetWereWolfAPI
io.github.ph1lou.werewolfapi.rolesattributs.
InvisibleState
io.github.ph1lou.werewolfapi.rolesattributs.
LimitedUse
io.github.ph1lou.werewolfapi.
PlayerWW
io.github.ph1lou.werewolfapi.rolesattributs.
Power
io.github.ph1lou.werewolfapi.rolesattributs.
Progress
io.github.ph1lou.werewolfapi.rolesattributs.
Roles
io.github.ph1lou.werewolfapi.rolesattributs.
Transformed
io.github.ph1lou.werewolfapi.
WereWolfAPI
Enum Hierarchy
java.lang.Object
java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
io.github.ph1lou.werewolfapi.enumlg.
State
io.github.ph1lou.werewolfapi.enumlg.
Day
io.github.ph1lou.werewolfapi.enumlg.
AngelForm
io.github.ph1lou.werewolfapi.enumlg.
TimerLG
io.github.ph1lou.werewolfapi.enumlg.
ToolLG
io.github.ph1lou.werewolfapi.enumlg.
Camp
io.github.ph1lou.werewolfapi.enumlg.
StateLG
io.github.ph1lou.werewolfapi.enumlg.
ScenarioLG
io.github.ph1lou.werewolfapi.enumlg.
Category
Skip navigation links
Overview
Package
Class
Tree
Deprecated
Index
Help
Prev
Next
Frames
No Frames
All Classes


BTC traders active in the OTC market know that for all of 2018, large bidders have lived at 6K and under. Lot of fishing/expressions of interest there. Buyers here see that as a backstop. If price rises, patient 6K guys would probably start reaching.


Id: 365
Name: Tricia Lange
Status: Alive
Species: Human
Type:
Gender: Female
OriginName: Earth (Replacement Dimension)
OriginUrl: https://rickandmortyapi.com/api/location/20
LocationName: Earth (Replacement Dimension)
LocationUrl: https://rickandmortyapi.com/api/location/20
Image: https://rickandmortyapi.com/api/character/avatar/365.jpeg
Episode: ['https://rickandmortyapi.com/api/episode/26', 'https://rickandmortyapi.com/api/episode/27']
Url: https://rickandmortyapi.com/api/character/365
Created: 2018-01-10T18:59:31.842Z


change climate students concern behavioral knowledge Taiwan levels East significantly higher change. education {border-style public relationship Table px;} student university #ffffff;} high political Climate Taiwan, Taiwan’s level reported study income China results variable International Science policy variables < Asia Asian attitudes population science (students Environmental Ministry Sciences Taiwan. based degree economic emissions environmental greater odds ranking region related scored social Education Education, Global However, Knowledge Odds countries likely ordinal outcome perception positive px; risk significant studies support terms {font-family *** Energy Students University Western change, changes data dependent font-size global knowledge, major model negative regression report sample scores universities value (NA Change Change. Data Income Political Republic Social analysis appear change: concerned differences double; hometown independent lack need policies present ratios research response review role set ./journal.pone..t China, National No. Party Reference) Research Student Table). Technology Writing adult awareness behavior beliefs border-color border-width concern. concerned," did different eastern environment family given household included increases indicate key logistic lower opinion parties provided region, require responses solid; suggest understanding {font-style {font-weight "very (DOCX) (Table Asia, Chinese Click Education. Funding Further, LINK Participants People Project Statistics, US, United additional asked bold categories college compared concern, conflict consumption courier; denialism differed does educational effects efforts em; emissions. file. findings future greenhouse growth higher), highest human interests investigation majors occurring party pt;} question recent reduce reference responded south students, study. used variables. vulnerability western


This is a panel that keeps track of particular clients and how much money they owe to a business. It uses Angular, Bootstrap and Google's Firebase as the backend.


Privacy Policy
Last updated: 20 August 2019
ladder requests details about your team's users (real name, avatar, status) as well as information about your team's custom emoji.ladder stores only the basic information required to create and maintain the leaderboard: your match outcomes and dates. No personal information is recorded; only team and user IDs are stored. Usernames in /ladder responses are generated by Slack, outside of ladder's view.
ladder will never sell your data, either in the aggregate or any data specific to your user(s).


[§432E-32] Notice of right to external review. Notice of the right to external review issued pursuant to this part shall set forth the options available to the enrollee under this part. The commissioner may specify the form and content of notice of external review. [L 2011, c 230, pt of §2]


A washed up singer is given a couple days to compose a chart-topping hit for an aspiring teen sensation. Though he's never written a decent lyric in his life, he sparks with an offbeat younger woman with a flair for words.
Hugh Grant, Drew Barrymore, Scott Porter


FIRST LOOK: Next week’s Emmerdale in 10 pictures
Kim's revenge is underway...
by Claire CrickNext week's Emmerdale sees Graham's world come crashing down when Kim makes a shock announcement, while Bernice and Liam's wedding is thrown into jeopardy, and Jimmy tries to put the last few weeks behind him.
Kim makes a shock revelation
Graham is worried when Kim asks all her employees to come to the Woolpack for a special announcement, knowing that she is up to no good.
As soon as he walks in and sees Kim has thrown a party, Graham realises what she has got planned.
Graham is left reeling as Kim makes a shocking announcement, while Rhona is seething as she struggles to get her head around what Kim has just revealed.
Kim enjoys her plan's success, while Graham tries to make amends with Rhona. But what has Kim just said?
As Graham attempts to apologise to Rhona, Marlon sees red and punches him in the face.
Is this the end for Graham and Rhona's romance?
Bernice gets good news ahead of her wedding
Bernice is thrilled when Dee Dee announces her wedding gift...
She's going to be moving to the village permanently!
Bernice panics when Liam reveals he has got her a wedding gift, and she desperately tries to think of what she can buy him to mark the occasion.
Bernice asks everyone's advice, but Leanna is hurt when she isn't asked to help decide on a gift, so Bernice tries to make it up to her future stepdaughter by asking her to organise her hen night.
Wedding drama for Bernice and Liam
The hen and stag celebrations get under way.
Bernice is having the time of her life, but little does she know her night is going to end in disaster...
Across the village, Liam is also having a great time celebrating his last week of freedom.
He's oblivious to the fact his wedding to Bernice is about to be thrown into jeopardy thanks to a mysterious phone call.
Bernice is having such a good time at her hen she doesn't realise that someone is trying to contact her on the phone.
Soon the caller gets hold of Dee Dee and makes a shock revelation that could change everything. Is the wedding about to be called off?
Jimmy moves forward
When the childminder cancels on Laurel, Jimmy offers to look after Archie.
He's happy to put the abuse accusations behind him, but will Laurel agree?
And can Nicola forgive her?
Emmerdale airs weeknights at 7pm on ITV, with an extra episode at 8pm on Thursdays.
Which storyline are you looking forward to the most next week? Leave us a comment on our Facebook page @EntertainmentDailyFix and let us know what you think!


Contact information
- District:Kicukiro
- Sector:Gatenga
- Phone number:0781055307
-<EMAIL_ADDRESS>Personal information
- Date of birthday: 13/12/1993
- Citizenship:Rwandese
- Gender:Female
- Marital status:Single
About me
MY BACKGROUND
- 2017-2014:I have a bachelor degree in finance,and i completed my courses at ULK.
- 2013-2011:I had A2 degree in computer science and management at lycee de kicukiro(APADE).
- 2010-2008:I completed o'level at Group scolaire de kimisange.
- 2007-2001:I completed my primary school at Group scolaire de gatenga
Job experience
- Working history:Indangamirwa culture trouple.
I decided to take a class on programming because i want to master what i learnt in high school,and the second reason is that i want to be a woman programmer in my future.
Research and training
- trained english skill by Teacher's Association for Promoting Education(T.A.P.E)
- Unity and recommondation camp(INGANDO)
Skills
- skilled in microsoft office and internet
Hobbies
- Praying
- Dancing
- music
- make friends
List of projects
- Spoc project
this project i did in spoc means about build and sell buildings,so I used two languages like html and css)
if you want to kwown alot click hereSpoc project
- Cookie-recipe project
showing how to correct errors,forking and cloning,I used css and html languages)
for more click hereCookie-recipe
- My-first-webpage project
this project was showing how to create a website,and i was listing the things i am going to use in coding like HTML,CSS,javascript and learning to call an image,I used also html.)
for more click heremy-first-webpage
- My-favorite-things project
this project was showing how to create a website,and I was talking about my best friends,favorite foods,and my hobbies,I used two html language.)
for more click heremy-favorite-things
- Hello-world project
this website project welcoming peaple,I used html language.)for more click herehello-world


Margin is a credit loan from your brokerage you receive after you deposit collateral into your margin account. You need margin to place short-biased trades and you can use margin to increase your buying power, but you incur interest fees. Margin is the dollar value of the loan that the brokerage gives you. A margin requirement of 25% means that to purchase $10,000 worth of securities, you need at least $2,500 worth of collateral in your brokerage account to open the trade and you can borrow the rest on margin. Maintenance margin is the minimum equity (equity = total portfolio value - borrowed funds) you must have in your brokerage account to stay in your positions. If the value of your portfolio falls below the maintenance margin, you receive a margin call. If you receive a margin call, you either need to add more capital to your brokerage account or the brokerage will liquidate some of your holdings to reduce your exposure and their risk.
Some securities have special margin rules. Derivatives are leveraged assets with a floating margin requirement. In particular, long Options have zero maintenance margin requirement and their initial margin requirement is only the premium that you pay upfront.


Interfacing CPP and Python using Python Boost
Sometimes there will be situations where we need to pass data between CPP and Python codes. We can use Boost. Python to interface between CPP and Python. In this note, let’s see how to call CPP functions from Python and transfer Numpy arrays between them.
Test System Configuration
- Ubuntu 20.04 LTS on WSL 1, Windows 10
- Python 3.8
- Boost 1.71 [To see Boost version, open up
/usr/include/boost/version.hpp
and look for#define BOOST_LIB_VERSION
]
Install dependencies, if needed
sudo apt-get install libboost-all-dev
sudo apt install python-dev
orsudo apt-get install python3-dev
depending upon the Pythonsudo apt install libboost-numpy-dev
Find out library names and their paths
We need the library names and their paths for linking.
- Python - Find out where the
pyconfig
is [usefind /usr/include/ -name pyconfig*
]. In my system it was at/usr/include/python3.8/
. - Boost Python - use
find /usr/lib -name libboost*
. In my system, boost_python library was at/usr/lib/x86_64-linux-gnu/libboost_python38
. So the name of the library isboost_python38
. - Boost Numpy - Just like Boost Python, I found out libboost_numpy was at
/usr/lib/x86_64-linux-gnu/libboost_numpy38
, and hence the library name wasboost_numpy38
Code
We need to create a shared library (.so
) using Boost by compiling cpp
code and linking existing libraries (boost_python
, python
, boost_numpy
).
CPP header file - sample_interface.h
CPP definition file - sample_interface.cpp
Generating shared library (.so) file
g++ sample_interface.cpp -I/usr/include/python3.8/ -lboost_python38 -lpython3.8 -lboost_numpy38 -fPIC --shared -o cpp_interface.so
Python file - calling_cpp_from_python.py
All of these snippets are available here.
Acknowledgement
Reference:


jQuery is a Javascript framework which simplify the developer to do some stuff, like events, DOM elements selection, make effects and animations, use Ajax and Json, also extends abilities through plug-ins, and more.
It can simplify a code, for readability for example, and also the number of lines written.
Maybe we could use jQuery to select the elements when we want to delete some items.
CDNs, for Content Delivery Networks, are geographically distributed networks of proxy servers and their data centers [Wikipedia]. They permit the developer to include remote scripts and run them in its own web page.
For example, if the developer want to include a framework (like jQuery, Bootstrap, Tween...), he can either download the script, so this will be locally available on his website but not up-to-date,
or link the remote script and will be always up-to-date.
The most advantage to do that is that the framework is always up-to-date and permits the developer to save space by non including third-part packages,
but the main drawback is that his webpage is dependent of the remote server, so if this stop working, his webpage will also do, or if the server is hack and the script is replaced by a malware, he also will be affected.
Take again our person list, and use jQuery when applicable.
Indeed, I replaced classic JS by jQuery when displaying all elements (in personView) and when looking for checked checkboxes to delete selected elements (in personController).
Use jQuery and AJAX to read a JSON file which contains a list of persons with their own email address.


{{ seller.email }}
{{contract.declineReason ?? "Seller hasn't given any reason."}}
0; else askPrice"> {{ price | currency: negotiation.currency }} Buyer requested Asking Price


The Telegraph, 2014
Stage Awards, 2014
Described as “one of the great theatrical productions of the decade”, this outstanding performance of Arthur Miller’s play sold out even before it opened at the Young Vic and went on to win 3 Olivier Awards. It transferred to the Wyndham’s Theatre in the West End and will be the first Young Vic production to be transferred to Broadway.
Photo by Jan Versweyveld
Chiwetel (12 Years a Slave, Dirty Pretty Things) directed this short film, based on the Young Vic’s Main Stage production of A Season in the Congo, the epic retelling of a vibrant nation’s turbulent first year of freedom. The film won a prestigious Webby Award before touring international film festivals.
Photo by TBC
Taking Part Production
The Sound of Yellow was inspired by our main house production, The Valley of Astonishment directed by Peter Brook and Marie-Helene Estienne. The Sound of Yellow was an interactive multi-sensory show which told the story of intermingled senses. The audience experienced the production through sound, taste and texture.
Photo by Helen Murray
Over the last two years we have led the UK in producing theatre of black experience. Following the 2013 production of Feast, which brought together 5 writers from 5 countries to explore the Yoruba cosmology, and A Season in the Congo where Chiwetel Ejiofor played Patrice Lumumba, we produced two acclaimed runs of Sizwe Banzi is Dead followed by a national small scale tour, a JMK award winner directed The Island (both of the last by Athol Fugard) and a sold out run of The Scottsboro Boys, which transferred to the West End and received the 2014 Evening Standard Award for Best Musical.
In addition to this the Young Vic associate dance company BirdGang put on a contemporary harlem renaissance and hip hop production of A Harlem Dream, 2014 Genesis Future Award winner Tinuke Craig directed the compelling drama Dirty Butterfly, and Oh my Sweet Land explored the crisis in Syria through the stories of some of its 2 million refugees.
Photo by Chris Nash
In October 2013 we held a very successful Forever Young Gala at the Young Vic and raised £250,000 from our generous supporters.
Photo by TBC


iwc
- Interactive lines count
iwc
[-chlvw
] [file ...]
The iwc
utility displays the number of lines, words and bytes in the standard
input. The number is printed while iwc
counts all lines, instead of just
displaying the total number at the end.
Not passing any option is equivalent to passing -clw
.
-c
Count the number of bytes in each input file.
-h
Print the help and exit
-l
Count the number of lines in each input file.
-m
Same as -c
for now.
-v
Print the version and exit
-w
Count the number of words in each input file.
Written by Baptiste Fontaine<EMAIL_ADDRESS>Bugs should be reported at https://github.com/bfontaine/iwc/issues.
The project homepage is at https://github.com/bfontaine/iwc.


Patna Pirates
Owned by KVS Eneargy and Sports Limited, Patna
Pirates belive that the spirit of the pirets is the
spirit of not letting go, of using the environment to
advantage, of striking when the enemy is least
aware. It is named not after the criminal meaning of
the world but after the greek word 'peirin' which
means "to attack".
Patna Pirates is lead by Rakesh Kumar, the Indian
kabaddi team caption and is efficiently supported
by Ravi Dalal, Sandeep Narwal, Wasim Sajjad and
many others.
KVS Eneargy and Sports Limited, is owned by Rajesh
Shah, Co Chairman and Managing Director of
Mukand Ltd and his son Mr. Kaustubh Vir Shah
Patna Pirates is his first venture into sporting
territory.
|


J-K: Army jawan killed, three injured in IED blast in Akhnoor
The incident took place near the Line of Control in Palanwala sector of the area.
by Express News ServiceOne Army jawan was killed and two others were injured in an Improvised Explosive Device (IED) blast in Akhnoor of Jammu and Kashmir. The incident took place near the Line of Control (LoC) in Palanwala sector of the area.
The explosion took place when an Army team was on routine patrolling duty in the Pallanwalla area, he said.
Defence ministry spokesperson Lt Colonel Devender Anand here identified the deceased soldier as Havaldar Santosh Kumar of Pura Bhadauria village in Uttar Pradesh’s Bah tehsil in Agra dIstrict.
The Improvised Explosive Device (IED) is believed to have been planted from across the border and detonated when some Army personnel were moving towards a forward post, they said, adding that the condition of one of the injured was stated to be “serious”.
Meanwhile, Pakistani troops resorted to unprovoked mortar shelling and small arms fire along the LoC in Shahpur area of Poonch district. The Indian army retaliated.


Wrong to say I am behind Ajit Pawar's revolt: Sharad Pawar
The NCP chief reiterated that the decision of aligning with the BJP was that of his nephew Ajit Pawar and not of his party.
PUNE: NCP chief Sharad Pawar on Monday said he was not behind Ajit Pawar's decision to align with the BJP and become the deputy chief minister and asserted that his party along with Congress and Shiv Sena will form the next government in Maharashtra.
Addressing reporters in Karad town of neighbouring Satara district, the NCP chief reiterated that the decision of aligning with the BJP was that of his nephew Ajit Pawar and not of the NCP.
"It is not the party's decision and we do not endorse it," Pawar said.
"It is wrong to say that I have a hand behind Ajit Pawar's revolt," he added.
Asked whether the NCP, Congress and Shiv Sena will form government in the state, he said, "There is not an iota of doubt that the government (of the combine) will be formed in Maharashtra." He also said that he has no contact with his nephew, who rebelled against the NCP.
READ | 'I'll always stay in party, Sharad Pawar my leader': Ajit assures of stable BJP-NCP govt
On whether Ajit Pawar will be expelled from the NCP, he said the decision will be taken at the party-level.
In a dramatic turn of events, Devendra Fadnavis and Ajit Pawar were sworn in as chief minister and deputy chief minister respectively by Governor Bhagat Singh Koshyari at 8 am on Saturday at a hush hush ceremony in Raj Bhavan here, leading to the lifting of the President's rule in the state.
The BJP was propped up by NCP's Ajit Pawar, who revolted against his party.
"I have seen many such scenarios in my 50 years of political career. Difficulties come but they are temporary, and my experience is that people of the state stand strong," the NCP supremo said.
He said till the time he has the support of youngsters, he is not worried about anything.
Earlier, Sharad Pawar paid tributes to the state's first chief minister Yashwantrao Chavan on his death anniversary.
He arrived at Chavan's memorial in Karad early in the morning and offered floral tributes. He was accompanied by Srinivas Patil, the NCP's Lok Sabha member from Satara.
READ | Sharad Pawar rebuffs nephew's NCP-BJP government claim, says Ajit is misleading people
Pawar also attended a 'bhajan' ceremony organised as a mark of respect to the late Congress stalwart.
The NCP chief is expected to attend a couple of other events also in Karad during the day.
Notably, Ajit Pawar sat on a day-long fast at Chavan's memorial in April 2013 after some of his remarks on the then drought situation in the state stoked a controversy.


Home
About
Products
Blog
Contact
Contact
Please fill out our contact form and we will be in contact shortly.
Full Name
Email
Subject
Message


{% extends "_base.html" %} {% block title %}Request failed{% endblock %} {% block body %}
The request failed for the following reason: {{ failure_reason }}.
No changes have been made to your account.