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.21.0-eta'
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()
From development version 2.21.0-gamma, we can collect datasets and get them as dictionary with DataLoader.collect()
. This will be implemented in stable version 2.22.0.
data_dict = loader.collect()
snl = cs.Scenario(country="Japan", province=None)
snl.register(**data_dict)
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 | |
|---|---|---|---|---|
| 506 | 2021-06-26 | 792832 | 14626 | 760243 |
| 507 | 2021-06-27 | 794457 | 14657 | 761912 |
| 508 | 2021-06-28 | 795756 | 14669 | 763364 |
| 509 | 2021-06-29 | 796829 | 14705 | 764913 |
| 510 | 2021-06-30 | 798159 | 14740 | 766616 |
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 | |
|---|---|---|
| 506 | 2021-06-26 | 27610926 |
| 507 | 2021-06-27 | 28100490 |
| 508 | 2021-06-28 | 28554475 |
| 509 | 2021-06-29 | 28913862 |
| 510 | 2021-06-30 | 28913862 |
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 | 29Jul2020 | 126529100 |
| 15th | Past | 30Jul2020 | 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 | 27Oct2020 | 126529100 |
| 22nd | Past | 28Oct2020 | 10Nov2020 | 126529100 |
| 23rd | Past | 11Nov2020 | 23Nov2020 | 126529100 |
| 24th | Past | 24Nov2020 | 08Dec2020 | 126529100 |
| 25th | Past | 09Dec2020 | 19Dec2020 | 126529100 |
| 26th | Past | 20Dec2020 | 28Dec2020 | 126529100 |
| 27th | Past | 29Dec2020 | 05Jan2021 | 126529100 |
| 28th | Past | 06Jan2021 | 15Jan2021 | 126529100 |
| 29th | Past | 16Jan2021 | 29Jan2021 | 126529100 |
| 30th | Past | 30Jan2021 | 06Feb2021 | 126529100 |
| 31st | Past | 07Feb2021 | 14Feb2021 | 126529100 |
| 32nd | Past | 15Feb2021 | 26Feb2021 | 126529100 |
| 33rd | Past | 27Feb2021 | 09Mar2021 | 126529100 |
| 34th | Past | 10Mar2021 | 18Mar2021 | 126529100 |
| 35th | Past | 19Mar2021 | 29Mar2021 | 126529100 |
| 36th | Past | 30Mar2021 | 06Apr2021 | 126529100 |
| 37th | Past | 07Apr2021 | 14Apr2021 | 126529100 |
| 38th | Past | 15Apr2021 | 22Apr2021 | 126529100 |
| 39th | Past | 23Apr2021 | 01May2021 | 126529100 |
| 40th | Past | 02May2021 | 13May2021 | 126529100 |
| 41st | Past | 14May2021 | 28May2021 | 126529100 |
| 42nd | Past | 29May2021 | 11Jun2021 | 126529100 |
| 43rd | Past | 12Jun2021 | 21Jun2021 | 126529100 |
| 44th | Past | 22Jun2021 | 30Jun2021 | 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
snl.estimate(cs.SIRF)
<SIR-F model: parameter estimation>
Running optimization with 4 CPUs...
9th phase (14May2020 - 28May2020): finished 118 trials in 0 min 5 sec
6th phase (11Apr2020 - 23Apr2020): finished 138 trials in 0 min 6 sec
10th phase (29May2020 - 10Jun2020): finished 46 trials in 0 min 2 sec
0th phase (06Feb2020 - 18Feb2020): finished 290 trials in 0 min 11 sec
3rd phase (14Mar2020 - 24Mar2020): finished 275 trials in 0 min 13 sec
11th phase (11Jun2020 - 23Jun2020): finished 270 trials in 0 min 12 sec 7th phase (24Apr2020 - 02May2020): finished 298 trials in 0 min 13 sec
8th phase (03May2020 - 13May2020): finished 150 trials in 0 min 7 sec
1st phase (19Feb2020 - 05Mar2020): finished 307 trials in 0 min 16 sec
4th phase (25Mar2020 - 02Apr2020): finished 314 trials in 0 min 16 sec
2nd phase (06Mar2020 - 13Mar2020): finished 160 trials in 0 min 8 sec
5th phase (03Apr2020 - 10Apr2020): finished 148 trials in 0 min 7 sec
12th phase (24Jun2020 - 03Jul2020): finished 316 trials in 0 min 18 sec
15th phase (30Jul2020 - 13Aug2020): finished 219 trials in 0 min 13 sec
18th phase (11Sep2020 - 25Sep2020): finished 93 trials in 0 min 6 sec
13th phase (04Jul2020 - 16Jul2020): finished 134 trials in 0 min 7 sec
19th phase (26Sep2020 - 09Oct2020): finished 97 trials in 0 min 5 sec
21st phase (18Oct2020 - 27Oct2020): finished 169 trials in 0 min 10 sec
16th phase (14Aug2020 - 26Aug2020): finished 127 trials in 0 min 7 sec
17th phase (27Aug2020 - 10Sep2020): finished 24 trials in 0 min 1 sec
14th phase (17Jul2020 - 29Jul2020): finished 134 trials in 0 min 7 sec
24th phase (24Nov2020 - 08Dec2020): finished 103 trials in 0 min 5 sec
22nd phase (28Oct2020 - 10Nov2020): finished 139 trials in 0 min 8 sec
20th phase (10Oct2020 - 17Oct2020): finished 163 trials in 0 min 9 sec
30th phase (30Jan2021 - 06Feb2021): finished 46 trials in 0 min 2 sec
25th phase (09Dec2020 - 19Dec2020): finished 105 trials in 0 min 6 sec
31st phase (07Feb2021 - 14Feb2021): finished 43 trials in 0 min 2 sec
23rd phase (11Nov2020 - 23Nov2020): finished 118 trials in 0 min 6 sec
32nd phase (15Feb2021 - 26Feb2021): finished 64 trials in 0 min 3 sec
33rd phase (27Feb2021 - 09Mar2021): finished 52 trials in 0 min 2 sec
36th phase (30Mar2021 - 06Apr2021): finished 79 trials in 0 min 4 sec
27th phase (29Dec2020 - 05Jan2021): finished 269 trials in 0 min 18 sec
34th phase (10Mar2021 - 18Mar2021): finished 111 trials in 0 min 6 sec
37th phase (07Apr2021 - 14Apr2021): finished 159 trials in 0 min 8 sec
28th phase (06Jan2021 - 15Jan2021): finished 209 trials in 0 min 10 sec
38th phase (15Apr2021 - 22Apr2021): finished 93 trials in 0 min 4 sec
35th phase (19Mar2021 - 29Mar2021): finished 224 trials in 0 min 11 sec
39th phase (23Apr2021 - 01May2021): finished 59 trials in 0 min 2 sec
29th phase (16Jan2021 - 29Jan2021): finished 142 trials in 0 min 5 sec
40th phase (02May2021 - 13May2021): finished 137 trials in 0 min 5 sec
42nd phase (29May2021 - 11Jun2021): finished 277 trials in 0 min 11 sec
43rd phase (12Jun2021 - 21Jun2021): finished 34 trials in 0 min 1 sec
44th phase (22Jun2021 - 30Jun2021): finished 41 trials in 0 min 1 sec
41st phase (14May2021 - 28May2021): finished 278 trials in 0 min 10 sec
26th phase (20Dec2020 - 28Dec2020): finished 764 trials in 0 min 41 sec
Completed optimization. Total: 1 min 43 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.23 | 0.027740 | 0.000000 | 0.067256 | 0.029281 | 1440 | - | - | - | - | 0.142968 | 290.0 | 0 min 11 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 | 307.0 | 0 min 16 sec |
| 2nd | Past | 06Mar2020 | 13Mar2020 | 126529100 | SIR-F | 5.57 | 0.021376 | 0.000448 | 0.131409 | 0.022629 | 1440 | 0.021 | 2230.0 | 7.0 | 44.0 | 0.097536 | 160.0 | 0 min 8 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 | 275.0 | 0 min 13 sec |
| 4th | Past | 25Mar2020 | 02Apr2020 | 126529100 | SIR-F | 4.96 | 0.008054 | 0.000702 | 0.117287 | 0.022752 | 1440 | 0.008 | 1424.0 | 8.0 | 43.0 | 0.036893 | 314.0 | 0 min 16 sec |
| 5th | Past | 03Apr2020 | 10Apr2020 | 126529100 | SIR-F | 11.26 | 0.000398 | 0.001149 | 0.127080 | 0.010130 | 1440 | 0.0 | 870.0 | 7.0 | 98.0 | 0.027305 | 148.0 | 0 min 7 sec |
| 6th | Past | 11Apr2020 | 23Apr2020 | 126529100 | SIR-F | 6.78 | 0.004414 | 0.000923 | 0.073450 | 0.009859 | 1440 | 0.004 | 1083.0 | 13.0 | 101.0 | 0.120836 | 138.0 | 0 min 6 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 | 298.0 | 0 min 13 sec |
| 8th | Past | 03May2020 | 13May2020 | 126529100 | SIR-F | 0.19 | 0.089823 | 0.000796 | 0.011794 | 0.055541 | 1440 | 0.09 | 1256.0 | 84.0 | 18.0 | 0.093924 | 150.0 | 0 min 7 sec |
| 9th | Past | 14May2020 | 28May2020 | 126529100 | SIR-F | 0.14 | 0.104481 | 0.002213 | 0.014100 | 0.087040 | 1440 | 0.104 | 451.0 | 70.0 | 11.0 | 0.022774 | 118.0 | 0 min 5 sec |
| 10th | Past | 29May2020 | 10Jun2020 | 126529100 | SIR-F | 0.46 | 0.033367 | 0.001493 | 0.033128 | 0.067853 | 1440 | 0.033 | 669.0 | 30.0 | 14.0 | 0.016955 | 46.0 | 0 min 2 sec |
| 11th | Past | 11Jun2020 | 23Jun2020 | 126529100 | SIR-F | 0.77 | 0.029438 | 0.000692 | 0.072653 | 0.090691 | 1440 | 0.029 | 1445.0 | 13.0 | 11.0 | 0.030298 | 270.0 | 0 min 12 sec |
| 12th | Past | 24Jun2020 | 03Jul2020 | 126529100 | SIR-F | 1.51 | 0.009791 | 0.000386 | 0.112017 | 0.073033 | 1440 | 0.01 | 2590.0 | 8.0 | 13.0 | 0.018071 | 316.0 | 0 min 18 sec |
| 13th | Past | 04Jul2020 | 16Jul2020 | 126529100 | SIR-F | 2.66 | 0.000999 | 0.000101 | 0.116808 | 0.043765 | 1440 | 0.001 | 9908.0 | 8.0 | 22.0 | 0.024677 | 134.0 | 0 min 7 sec |
| 14th | Past | 17Jul2020 | 29Jul2020 | 126529100 | SIR-F | 1.96 | 0.000444 | 0.000165 | 0.141974 | 0.072280 | 1440 | 0.0 | 6051.0 | 7.0 | 13.0 | 0.021073 | 134.0 | 0 min 7 sec |
| 15th | Past | 30Jul2020 | 13Aug2020 | 126529100 | SIR-F | 1.70 | 0.000014 | 0.000415 | 0.124693 | 0.072972 | 1440 | 0.0 | 2407.0 | 8.0 | 13.0 | 0.048825 | 219.0 | 0 min 13 sec |
| 16th | Past | 14Aug2020 | 26Aug2020 | 126529100 | SIR-F | 0.81 | 0.000312 | 0.000872 | 0.071496 | 0.086979 | 1440 | 0.0 | 1146.0 | 13.0 | 11.0 | 0.016110 | 127.0 | 0 min 7 sec |
| 17th | Past | 27Aug2020 | 10Sep2020 | 126529100 | SIR-F | 0.81 | 0.000476 | 0.001337 | 0.074952 | 0.091451 | 1440 | 0.0 | 747.0 | 13.0 | 10.0 | 0.049029 | 24.0 | 0 min 1 sec |
| 18th | Past | 11Sep2020 | 25Sep2020 | 126529100 | SIR-F | 0.86 | 0.004155 | 0.000767 | 0.077287 | 0.088692 | 1440 | 0.004 | 1303.0 | 12.0 | 11.0 | 0.018562 | 93.0 | 0 min 6 sec |
| 19th | Past | 26Sep2020 | 09Oct2020 | 126529100 | SIR-F | 0.98 | 0.001601 | 0.001037 | 0.070078 | 0.070278 | 1440 | 0.002 | 964.0 | 14.0 | 14.0 | 0.015223 | 97.0 | 0 min 5 sec |
| 20th | Past | 10Oct2020 | 17Oct2020 | 126529100 | SIR-F | 1.05 | 0.004557 | 0.000506 | 0.075335 | 0.070729 | 1440 | 0.005 | 1976.0 | 13.0 | 14.0 | 0.015339 | 163.0 | 0 min 9 sec |
| 21st | Past | 18Oct2020 | 27Oct2020 | 126529100 | SIR-F | 0.99 | 0.003096 | 0.000619 | 0.093259 | 0.093528 | 1440 | 0.003 | 1615.0 | 10.0 | 10.0 | 0.021374 | 169.0 | 0 min 10 sec |
| 22nd | Past | 28Oct2020 | 10Nov2020 | 126529100 | SIR-F | 1.39 | 0.000491 | 0.001003 | 0.117626 | 0.083300 | 1440 | 0.0 | 996.0 | 8.0 | 12.0 | 0.014576 | 139.0 | 0 min 8 sec |
| 23rd | Past | 11Nov2020 | 23Nov2020 | 126529100 | SIR-F | 1.68 | 0.000642 | 0.000620 | 0.137217 | 0.081010 | 1440 | 0.001 | 1612.0 | 7.0 | 12.0 | 0.012670 | 118.0 | 0 min 6 sec |
| 24th | Past | 24Nov2020 | 08Dec2020 | 126529100 | SIR-F | 1.20 | 0.002399 | 0.000852 | 0.102798 | 0.084676 | 1440 | 0.002 | 1173.0 | 9.0 | 11.0 | 0.012275 | 103.0 | 0 min 5 sec |
| 25th | Past | 09Dec2020 | 19Dec2020 | 126529100 | SIR-F | 1.22 | 0.002399 | 0.001136 | 0.103101 | 0.082974 | 1440 | 0.002 | 879.0 | 9.0 | 12.0 | 0.012485 | 105.0 | 0 min 6 sec |
| 26th | Past | 20Dec2020 | 28Dec2020 | 126529100 | SIR-F | 1.18 | 0.000009 | 0.001477 | 0.101733 | 0.084606 | 1440 | 0.0 | 676.0 | 9.0 | 11.0 | 0.014154 | 764.0 | 0 min 41 sec |
| 27th | Past | 29Dec2020 | 05Jan2021 | 126529100 | SIR-F | 1.48 | 0.000565 | 0.001216 | 0.100762 | 0.066722 | 1440 | 0.001 | 822.0 | 9.0 | 14.0 | 0.007705 | 269.0 | 0 min 18 sec |
| 28th | Past | 06Jan2021 | 15Jan2021 | 126529100 | SIR-F | 1.92 | 0.000602 | 0.001062 | 0.126949 | 0.064997 | 1440 | 0.001 | 941.0 | 7.0 | 15.0 | 0.025471 | 209.0 | 0 min 10 sec |
| 29th | Past | 16Jan2021 | 29Jan2021 | 126529100 | SIR-F | 0.88 | 0.002393 | 0.001034 | 0.080418 | 0.090450 | 1440 | 0.002 | 966.0 | 12.0 | 11.0 | 0.034686 | 142.0 | 0 min 5 sec |
| 30th | Past | 30Jan2021 | 06Feb2021 | 126529100 | SIR-F | 0.57 | 0.002393 | 0.001884 | 0.063793 | 0.110569 | 1440 | 0.002 | 530.0 | 15.0 | 9.0 | 0.016285 | 46.0 | 0 min 2 sec |
| 31st | Past | 07Feb2021 | 14Feb2021 | 126529100 | SIR-F | 0.54 | 0.002399 | 0.002291 | 0.056380 | 0.102259 | 1440 | 0.002 | 436.0 | 17.0 | 9.0 | 0.009356 | 43.0 | 0 min 2 sec |
| 32nd | Past | 15Feb2021 | 26Feb2021 | 126529100 | SIR-F | 0.64 | 0.001161 | 0.003477 | 0.073976 | 0.112318 | 1440 | 0.001 | 287.0 | 13.0 | 8.0 | 0.017117 | 64.0 | 0 min 3 sec |
| 33rd | Past | 27Feb2021 | 09Mar2021 | 126529100 | SIR-F | 0.75 | 0.006982 | 0.002557 | 0.063703 | 0.081476 | 1440 | 0.007 | 391.0 | 15.0 | 12.0 | 0.013387 | 52.0 | 0 min 2 sec |
| 34th | Past | 10Mar2021 | 18Mar2021 | 126529100 | SIR-F | 1.09 | 0.009204 | 0.002766 | 0.088085 | 0.077117 | 1440 | 0.009 | 361.0 | 11.0 | 12.0 | 0.008536 | 111.0 | 0 min 6 sec |
| 35th | Past | 19Mar2021 | 29Mar2021 | 126529100 | SIR-F | 1.30 | 0.000576 | 0.001862 | 0.095808 | 0.071851 | 1440 | 0.001 | 536.0 | 10.0 | 13.0 | 0.019581 | 224.0 | 0 min 11 sec |
| 36th | Past | 30Mar2021 | 06Apr2021 | 126529100 | SIR-F | 1.73 | 0.000476 | 0.000940 | 0.118545 | 0.067493 | 1440 | 0.0 | 1064.0 | 8.0 | 14.0 | 0.009955 | 79.0 | 0 min 4 sec |
| 37th | Past | 07Apr2021 | 14Apr2021 | 126529100 | SIR-F | 1.56 | 0.000418 | 0.000933 | 0.108137 | 0.068261 | 1440 | 0.0 | 1071.0 | 9.0 | 14.0 | 0.018471 | 159.0 | 0 min 8 sec |
| 38th | Past | 15Apr2021 | 22Apr2021 | 126529100 | SIR-F | 1.74 | 0.000476 | 0.000799 | 0.110978 | 0.062970 | 1440 | 0.0 | 1252.0 | 9.0 | 15.0 | 0.013765 | 93.0 | 0 min 4 sec |
| 39th | Past | 23Apr2021 | 01May2021 | 126529100 | SIR-F | 1.40 | 0.000988 | 0.000732 | 0.092479 | 0.065460 | 1440 | 0.001 | 1366.0 | 10.0 | 15.0 | 0.006804 | 59.0 | 0 min 2 sec |
| 40th | Past | 02May2021 | 13May2021 | 126529100 | SIR-F | 1.28 | 0.000222 | 0.000976 | 0.083747 | 0.064608 | 1440 | 0.0 | 1024.0 | 11.0 | 15.0 | 0.007991 | 137.0 | 0 min 5 sec |
| 41st | Past | 14May2021 | 28May2021 | 126529100 | SIR-F | 0.86 | 0.000367 | 0.001377 | 0.070622 | 0.080827 | 1440 | 0.0 | 726.0 | 14.0 | 12.0 | 0.016152 | 278.0 | 0 min 10 sec |
| 42nd | Past | 29May2021 | 11Jun2021 | 126529100 | SIR-F | 0.55 | 0.009039 | 0.001651 | 0.047024 | 0.082946 | 1440 | 0.009 | 605.0 | 21.0 | 12.0 | 0.017846 | 277.0 | 0 min 11 sec |
| 43rd | Past | 12Jun2021 | 21Jun2021 | 126529100 | SIR-F | 0.52 | 0.002216 | 0.001990 | 0.060362 | 0.113161 | 1440 | 0.002 | 502.0 | 16.0 | 8.0 | 0.012433 | 34.0 | 0 min 1 sec |
| 44th | Past | 22Jun2021 | 30Jun2021 | 126529100 | SIR-F | 0.83 | 0.001502 | 0.001759 | 0.075558 | 0.088990 | 1440 | 0.002 | 568.0 | 13.0 | 11.0 | 0.006717 | 41.0 | 0 min 1 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.142968 | 290.0 | 0 min 11 sec |
| 1st | 19Feb2020 | 05Mar2020 | 0.170717 | 307.0 | 0 min 16 sec |
| 2nd | 06Mar2020 | 13Mar2020 | 0.097536 | 160.0 | 0 min 8 sec |
| 3rd | 14Mar2020 | 24Mar2020 | 0.029797 | 275.0 | 0 min 13 sec |
| 4th | 25Mar2020 | 02Apr2020 | 0.036893 | 314.0 | 0 min 16 sec |
| 5th | 03Apr2020 | 10Apr2020 | 0.027305 | 148.0 | 0 min 7 sec |
| 6th | 11Apr2020 | 23Apr2020 | 0.120836 | 138.0 | 0 min 6 sec |
| 7th | 24Apr2020 | 02May2020 | 0.026841 | 298.0 | 0 min 13 sec |
| 8th | 03May2020 | 13May2020 | 0.093924 | 150.0 | 0 min 7 sec |
| 9th | 14May2020 | 28May2020 | 0.022774 | 118.0 | 0 min 5 sec |
| 10th | 29May2020 | 10Jun2020 | 0.016955 | 46.0 | 0 min 2 sec |
| 11th | 11Jun2020 | 23Jun2020 | 0.030298 | 270.0 | 0 min 12 sec |
| 12th | 24Jun2020 | 03Jul2020 | 0.018071 | 316.0 | 0 min 18 sec |
| 13th | 04Jul2020 | 16Jul2020 | 0.024677 | 134.0 | 0 min 7 sec |
| 14th | 17Jul2020 | 29Jul2020 | 0.021073 | 134.0 | 0 min 7 sec |
| 15th | 30Jul2020 | 13Aug2020 | 0.048825 | 219.0 | 0 min 13 sec |
| 16th | 14Aug2020 | 26Aug2020 | 0.016110 | 127.0 | 0 min 7 sec |
| 17th | 27Aug2020 | 10Sep2020 | 0.049029 | 24.0 | 0 min 1 sec |
| 18th | 11Sep2020 | 25Sep2020 | 0.018562 | 93.0 | 0 min 6 sec |
| 19th | 26Sep2020 | 09Oct2020 | 0.015223 | 97.0 | 0 min 5 sec |
| 20th | 10Oct2020 | 17Oct2020 | 0.015339 | 163.0 | 0 min 9 sec |
| 21st | 18Oct2020 | 27Oct2020 | 0.021374 | 169.0 | 0 min 10 sec |
| 22nd | 28Oct2020 | 10Nov2020 | 0.014576 | 139.0 | 0 min 8 sec |
| 23rd | 11Nov2020 | 23Nov2020 | 0.012670 | 118.0 | 0 min 6 sec |
| 24th | 24Nov2020 | 08Dec2020 | 0.012275 | 103.0 | 0 min 5 sec |
| 25th | 09Dec2020 | 19Dec2020 | 0.012485 | 105.0 | 0 min 6 sec |
| 26th | 20Dec2020 | 28Dec2020 | 0.014154 | 764.0 | 0 min 41 sec |
| 27th | 29Dec2020 | 05Jan2021 | 0.007705 | 269.0 | 0 min 18 sec |
| 28th | 06Jan2021 | 15Jan2021 | 0.025471 | 209.0 | 0 min 10 sec |
| 29th | 16Jan2021 | 29Jan2021 | 0.034686 | 142.0 | 0 min 5 sec |
| 30th | 30Jan2021 | 06Feb2021 | 0.016285 | 46.0 | 0 min 2 sec |
| 31st | 07Feb2021 | 14Feb2021 | 0.009356 | 43.0 | 0 min 2 sec |
| 32nd | 15Feb2021 | 26Feb2021 | 0.017117 | 64.0 | 0 min 3 sec |
| 33rd | 27Feb2021 | 09Mar2021 | 0.013387 | 52.0 | 0 min 2 sec |
| 34th | 10Mar2021 | 18Mar2021 | 0.008536 | 111.0 | 0 min 6 sec |
| 35th | 19Mar2021 | 29Mar2021 | 0.019581 | 224.0 | 0 min 11 sec |
| 36th | 30Mar2021 | 06Apr2021 | 0.009955 | 79.0 | 0 min 4 sec |
| 37th | 07Apr2021 | 14Apr2021 | 0.018471 | 159.0 | 0 min 8 sec |
| 38th | 15Apr2021 | 22Apr2021 | 0.013765 | 93.0 | 0 min 4 sec |
| 39th | 23Apr2021 | 01May2021 | 0.006804 | 59.0 | 0 min 2 sec |
| 40th | 02May2021 | 13May2021 | 0.007991 | 137.0 | 0 min 5 sec |
| 41st | 14May2021 | 28May2021 | 0.016152 | 278.0 | 0 min 10 sec |
| 42nd | 29May2021 | 11Jun2021 | 0.017846 | 277.0 | 0 min 11 sec |
| 43rd | 12Jun2021 | 21Jun2021 | 0.012433 | 34.0 | 0 min 1 sec |
| 44th | 22Jun2021 | 30Jun2021 | 0.006717 | 41.0 | 0 min 1 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, RMSLE and MAPE.
[22]:
# Get total score
# snl.score(metrics="RMSLE")
metrics_list = ["MAE", "MSE", "MSLE", "RMSE", "RMSLE", "MAPE"]
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: 751.542
MSE: 2467028.993
MSLE: 0.003
RMSE: 1264.148
RMSLE: 0.057
MAPE: 0.034
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]:
4.96
[24]:
# phase="last" means the last phases
snl.get("Rt", phase="last")
[24]:
0.83
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.027740 | 0.000000 | 0.067256 | 0.029281 | 2.23 |
| 1st | 0.007714 | 0.001322 | 0.136657 | 0.026198 | 4.93 |
| 2nd | 0.021376 | 0.000448 | 0.131409 | 0.022629 | 5.57 |
| 3rd | 0.000096 | 0.002956 | 0.063547 | 0.021736 | 2.57 |
| 4th | 0.008054 | 0.000702 | 0.117287 | 0.022752 | 4.96 |
| 5th | 0.000398 | 0.001149 | 0.127080 | 0.010130 | 11.26 |
| 6th | 0.004414 | 0.000923 | 0.073450 | 0.009859 | 6.78 |
| 7th | 0.001306 | 0.001491 | 0.028691 | 0.018346 | 1.44 |
| 8th | 0.089823 | 0.000796 | 0.011794 | 0.055541 | 0.19 |
| 9th | 0.104481 | 0.002213 | 0.014100 | 0.087040 | 0.14 |
| 10th | 0.033367 | 0.001493 | 0.033128 | 0.067853 | 0.46 |
| 11th | 0.029438 | 0.000692 | 0.072653 | 0.090691 | 0.77 |
| 12th | 0.009791 | 0.000386 | 0.112017 | 0.073033 | 1.51 |
| 13th | 0.000999 | 0.000101 | 0.116808 | 0.043765 | 2.66 |
| 14th | 0.000444 | 0.000165 | 0.141974 | 0.072280 | 1.96 |
| 15th | 0.000014 | 0.000415 | 0.124693 | 0.072972 | 1.70 |
| 16th | 0.000312 | 0.000872 | 0.071496 | 0.086979 | 0.81 |
| 17th | 0.000476 | 0.001337 | 0.074952 | 0.091451 | 0.81 |
| 18th | 0.004155 | 0.000767 | 0.077287 | 0.088692 | 0.86 |
| 19th | 0.001601 | 0.001037 | 0.070078 | 0.070278 | 0.98 |
| 20th | 0.004557 | 0.000506 | 0.075335 | 0.070729 | 1.05 |
| 21st | 0.003096 | 0.000619 | 0.093259 | 0.093528 | 0.99 |
| 22nd | 0.000491 | 0.001003 | 0.117626 | 0.083300 | 1.39 |
| 23rd | 0.000642 | 0.000620 | 0.137217 | 0.081010 | 1.68 |
| 24th | 0.002399 | 0.000852 | 0.102798 | 0.084676 | 1.20 |
| 25th | 0.002399 | 0.001136 | 0.103101 | 0.082974 | 1.22 |
| 26th | 0.000009 | 0.001477 | 0.101733 | 0.084606 | 1.18 |
| 27th | 0.000565 | 0.001216 | 0.100762 | 0.066722 | 1.48 |
| 28th | 0.000602 | 0.001062 | 0.126949 | 0.064997 | 1.92 |
| 29th | 0.002393 | 0.001034 | 0.080418 | 0.090450 | 0.88 |
| 30th | 0.002393 | 0.001884 | 0.063793 | 0.110569 | 0.57 |
| 31st | 0.002399 | 0.002291 | 0.056380 | 0.102259 | 0.54 |
| 32nd | 0.001161 | 0.003477 | 0.073976 | 0.112318 | 0.64 |
| 33rd | 0.006982 | 0.002557 | 0.063703 | 0.081476 | 0.75 |
| 34th | 0.009204 | 0.002766 | 0.088085 | 0.077117 | 1.09 |
| 35th | 0.000576 | 0.001862 | 0.095808 | 0.071851 | 1.30 |
| 36th | 0.000476 | 0.000940 | 0.118545 | 0.067493 | 1.73 |
| 37th | 0.000418 | 0.000933 | 0.108137 | 0.068261 | 1.56 |
| 38th | 0.000476 | 0.000799 | 0.110978 | 0.062970 | 1.74 |
| 39th | 0.000988 | 0.000732 | 0.092479 | 0.065460 | 1.40 |
| 40th | 0.000222 | 0.000976 | 0.083747 | 0.064608 | 1.28 |
| 41st | 0.000367 | 0.001377 | 0.070622 | 0.080827 | 0.86 |
| 42nd | 0.009039 | 0.001651 | 0.047024 | 0.082946 | 0.55 |
| 43rd | 0.002216 | 0.001990 | 0.060362 | 0.113161 | 0.52 |
| 44th | 0.001502 | 0.001759 | 0.075558 | 0.088990 | 0.83 |
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 | 11000 | 15452 | 799883 |
| 525 | 2021-07-28 | 10828 | 15472 | 800854 |
| 526 | 2021-07-29 | 10658 | 15493 | 801810 |
| 527 | 2021-07-30 | 10491 | 15512 | 802751 |
| 528 | 2021-07-31 | 10327 | 15531 | 803677 |
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.08898960554102445
[35]:
# Sigma value will be double
sigma_new = sigma_current * 1.2
sigma_new
[35]:
0.10678752664922933
[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 0x7fe317906730>
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 | 45th | Future | 01Jul2021 | 30Jul2021 | 126529100 | SIR-F | 0.83 | 0.001502 | 0.001759 | 0.075558 | 0.088990 | 1440 | 0.002 | 568.0 | 13.0 | 11.0 | - | - | - |
| 46th | Future | 31Jul2021 | 31Jul2021 | 126529100 | SIR-F | 0.83 | 0.001502 | 0.001759 | 0.075558 | 0.088990 | 1440 | 0.002 | 568.0 | 13.0 | 11.0 | - | - | - | |
| Medicine | 45th | Future | 01Jul2021 | 30Jul2021 | 126529100 | SIR-F | 0.83 | 0.001502 | 0.001759 | 0.075558 | 0.088990 | 1440 | 0.002 | 568.0 | 13.0 | 11.0 | - | - | - |
| 46th | Future | 31Jul2021 | 31Jul2021 | 126529100 | SIR-F | 0.70 | 0.001502 | 0.001759 | 0.075558 | 0.106788 | 1440 | 0.002 | 568.0 | 13.0 | 9.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 and abbreviations:
“en”: Indicators -> Parameters with Elastic Net
“dt”: Indicators -> Parameters with Decision Tree Regressor
“lgbm”: Indicators -> Parameters with Light Gradient Boosting Machine Regressor (Light GBM, from version 2.21.0)
“svr”: Indicators -> Parameters with Epsilon-Support Vector Regressor (SVR, from version 2.21.0)
From version 2.21.0, we can specify regressors with regressors
argument of Scenario.fit()
and abbreviations. When regreesors=["en", "svr"]
, only Elastic Net and SVR will be used. As default, regressors=None
and we use all registered regressors.
Scenario.fit()
has delay
argument and we can apply the following values.
delay=20
: Exact value of delay period [days].delay=(7, 31)
(default): All values 7, 9,…,31 will be inculded in X and some values will be selected by feature selection or PCA.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.
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.21.0, Scenario.fit()
shows “predicted vs. actual parameter values” figure and train/test score when show_figure=True
(default) via Scenario.fit_accuracy()
.
[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="MAPE", regressors=None,
removed_cols=["Stringency_index", "Tests", "Tests_diff", "Vaccinations"]
)
Scenario.predict()
predicts the parameter values of future phases.
[40]:
# Short-term prediction
snl.predict(name="Forecast")
# We can select list of days to predict optionally
# snl.predict(days=[1, 4], name="Forecast")
[40]:
<covsirphy.analysis.scenario.Scenario at 0x7fe317906730>
Show summary of future phases.
[41]:
df = snl.summary()
df.loc[df["Type"] == "Future"]
[41]:
| 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 | 45th | Future | 01Jul2021 | 30Jul2021 | 126529100 | SIR-F | 0.83 | 0.001502 | 0.001759 | 0.075558 | 0.088990 | 1440 | 0.002 | 568.0 | 13.0 | 11.0 | - | - | - |
| 46th | Future | 31Jul2021 | 31Jul2021 | 126529100 | SIR-F | 0.83 | 0.001502 | 0.001759 | 0.075558 | 0.088990 | 1440 | 0.002 | 568.0 | 13.0 | 11.0 | - | - | - | |
| Medicine | 45th | Future | 01Jul2021 | 30Jul2021 | 126529100 | SIR-F | 0.83 | 0.001502 | 0.001759 | 0.075558 | 0.088990 | 1440 | 0.002 | 568.0 | 13.0 | 11.0 | - | - | - |
| 46th | Future | 31Jul2021 | 31Jul2021 | 126529100 | SIR-F | 0.70 | 0.001502 | 0.001759 | 0.075558 | 0.106788 | 1440 | 0.002 | 568.0 | 13.0 | 9.0 | - | - | - | |
| Forecast | 45th | Future | 01Jul2021 | 31Jul2021 | 126529100 | SIR-F | 1.09 | 0.009204 | 0.002766 | 0.088090 | 0.077120 | 1440 | 0.009 | 361.0 | 11.0 | 12.0 | - | - | - |
Or, short-cut .fit()
and .predict()
with Scenario.fit_predict()
. We can apply all arguments (of .fit()
and .predict()
) to Scenario.fit_predict()
.
[42]:
# 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.
[43]:
# 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.
[44]:
_ = snl.simulate(variables="CFR", name="Forecast").tail()
Compare the number of cases of the all scenario with Scenario.history()
and variable name.
[45]:
_ = 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()
.
[46]:
# 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).
[47]:
_ = snl.history("Infected", past_days=20)
In the selected phases. Here, we will show the 3rd, 4th and 5th phase.
[48]:
_ = 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
[49]:
snl.describe()
[49]:
| max(Infected) | argmax(Infected) | Confirmed on 31Jul2021 | Infected on 31Jul2021 | Fatal on 31Jul2021 | 45th_Rt | 46th_Rt | |
|---|---|---|---|---|---|---|---|
| Main | 76575 | 15Jan2021 | 829535 | 10327 | 15531 | 0.83 | 0.83 |
| Medicine | 76575 | 15Jan2021 | 829528 | 10144 | 15531 | 0.83 | 0.7 |
| Forecast | 76575 | 15Jan2021 | 849437 | 20817 | 16836 | 1.09 | - |
[50]:
_ = snl.history(target="Infected")
[51]:
_ = snl.history(target="Rt")
[52]:
_ = snl.history(target="rho")
[53]:
_ = snl.history(target="sigma")
[54]:
_ = snl.history(target="theta")
[55]:
_ = 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.
[56]:
_ = 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?
[57]:
# 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...
9th phase (14May2020 - 28May2020): finished 125 trials in 0 min 5 sec
6th phase (11Apr2020 - 23Apr2020): finished 144 trials in 0 min 6 sec
10th phase (29May2020 - 10Jun2020): finished 56 trials in 0 min 2 sec
3rd phase (14Mar2020 - 24Mar2020): finished 229 trials in 0 min 10 sec
0th phase (06Feb2020 - 18Feb2020): finished 272 trials in 0 min 10 sec
7th phase (24Apr2020 - 02May2020): finished 238 trials in 0 min 10 sec
11th phase (11Jun2020 - 23Jun2020): finished 245 trials in 0 min 10 sec
4th phase (25Mar2020 - 02Apr2020): finished 231 trials in 0 min 10 sec
1st phase (19Feb2020 - 05Mar2020): finished 232 trials in 0 min 10 sec
8th phase (03May2020 - 13May2020): finished 156 trials in 0 min 7 sec
12th phase (24Jun2020 - 03Jul2020): finished 228 trials in 0 min 10 sec
2nd phase (06Mar2020 - 13Mar2020): finished 172 trials in 0 min 7 sec
5th phase (03Apr2020 - 10Apr2020): finished 196 trials in 0 min 8 sec
13th phase (04Jul2020 - 16Jul2020): finished 137 trials in 0 min 5 sec
18th phase (11Sep2020 - 25Sep2020): finished 135 trials in 0 min 5 sec
15th phase (30Jul2020 - 13Aug2020): finished 242 trials in 0 min 10 sec
21st phase (18Oct2020 - 27Oct2020): finished 168 trials in 0 min 7 sec
14th phase (17Jul2020 - 29Jul2020): finished 150 trials in 0 min 6 sec
24th phase (24Nov2020 - 08Dec2020): finished 107 trials in 0 min 4 sec
16th phase (14Aug2020 - 26Aug2020): finished 208 trials in 0 min 9 sec
22nd phase (28Oct2020 - 10Nov2020): finished 171 trials in 0 min 7 sec
19th phase (26Sep2020 - 09Oct2020): finished 236 trials in 0 min 10 sec
25th phase (09Dec2020 - 19Dec2020): finished 122 trials in 0 min 5 sec
23rd phase (11Nov2020 - 23Nov2020): finished 133 trials in 0 min 5 sec
17th phase (27Aug2020 - 10Sep2020): finished 149 trials in 0 min 6 sec
27th phase (29Dec2020 - 31Dec2020): finished 36 trials in 0 min 1 sec
28th phase (01Jan2021 - 05Jan2021): finished 61 trials in 0 min 2 sec
30th phase (16Jan2021 - 29Jan2021): finished 114 trials in 0 min 4 sec
20th phase (10Oct2020 - 17Oct2020): finished 246 trials in 0 min 10 sec
31st phase (30Jan2021 - 06Feb2021): finished 59 trials in 0 min 2 sec
33rd phase (15Feb2021 - 26Feb2021): finished 83 trials in 0 min 3 sec
32nd phase (07Feb2021 - 14Feb2021): finished 55 trials in 0 min 2 sec
26th phase (20Dec2020 - 28Dec2020): finished 247 trials in 0 min 10 sec
34th phase (27Feb2021 - 09Mar2021): finished 53 trials in 0 min 2 sec
29th phase (06Jan2021 - 15Jan2021): finished 220 trials in 0 min 9 sec
39th phase (15Apr2021 - 22Apr2021): finished 100 trials in 0 min 4 sec
35th phase (10Mar2021 - 18Mar2021): finished 104 trials in 0 min 4 sec
45th phase (22Jun2021 - 30Jun2021): finished 38 trials in 0 min 1 sec
40th phase (23Apr2021 - 01May2021): finished 55 trials in 0 min 2 sec
36th phase (19Mar2021 - 29Mar2021): finished 222 trials in 0 min 9 sec
41st phase (02May2021 - 13May2021): finished 133 trials in 0 min 5 sec
37th phase (30Mar2021 - 06Apr2021): finished 108 trials in 0 min 4 sec
42nd phase (14May2021 - 28May2021): finished 257 trials in 0 min 10 sec
38th phase (07Apr2021 - 14Apr2021): finished 210 trials in 0 min 7 sec
43rd phase (29May2021 - 11Jun2021): finished 293 trials in 0 min 10 sec
44th phase (12Jun2021 - 21Jun2021): finished 37 trials in 0 min 1 sec
Completed optimization. Total: 1 min 24 sec
<SIR-F model: parameter estimation>
Running optimization with 4 CPUs...
6th phase (11Apr2020 - 23Apr2020): finished 151 trials in 0 min 6 sec
0th phase (06Feb2020 - 18Feb2020): finished 294 trials in 0 min 10 sec
4th phase (25Mar2020 - 02Apr2020): finished 246 trials in 0 min 10 sec
2nd phase (06Mar2020 - 13Mar2020): finished 261 trials in 0 min 10 sec
7th phase (24Apr2020 - 02May2020): finished 237 trials in 0 min 10 sec
5th phase (03Apr2020 - 10Apr2020): finished 163 trials in 0 min 7 sec
10th phase (29May2020 - 10Jun2020): finished 34 trials in 0 min 2 sec
1st phase (19Feb2020 - 05Mar2020): finished 203 trials in 0 min 10 sec
3rd phase (14Mar2020 - 24Mar2020): finished 203 trials in 0 min 10 sec
8th phase (03May2020 - 13May2020): finished 158 trials in 0 min 8 sec
14th phase (17Jul2020 - 29Jul2020): finished 144 trials in 0 min 6 sec
9th phase (14May2020 - 28May2020): finished 111 trials in 0 min 4 sec
11th phase (11Jun2020 - 23Jun2020): finished 228 trials in 0 min 10 sec
12th phase (24Jun2020 - 03Jul2020): finished 229 trials in 0 min 10 sec
18th phase (11Sep2020 - 25Sep2020): finished 130 trials in 0 min 5 sec
13th phase (04Jul2020 - 16Jul2020): finished 128 trials in 0 min 5 sec
15th phase (30Jul2020 - 13Aug2020): finished 230 trials in 0 min 10 sec
16th phase (14Aug2020 - 26Aug2020): finished 211 trials in 0 min 9 sec
22nd phase (28Oct2020 - 10Nov2020): finished 172 trials in 0 min 7 sec
17th phase (27Aug2020 - 10Sep2020): finished 162 trials in 0 min 6 sec
19th phase (26Sep2020 - 09Oct2020): finished 246 trials in 0 min 10 sec
20th phase (10Oct2020 - 17Oct2020): finished 236 trials in 0 min 10 sec
24th phase (24Nov2020 - 08Dec2020): finished 106 trials in 0 min 5 sec
23rd phase (11Nov2020 - 23Nov2020): finished 127 trials in 0 min 6 sec
25th phase (09Dec2020 - 19Dec2020): finished 127 trials in 0 min 5 sec
21st phase (18Oct2020 - 27Oct2020): finished 194 trials in 0 min 9 sec
26th phase (20Dec2020 - 28Dec2020): finished 231 trials in 0 min 10 sec
27th phase (29Dec2020 - 31Dec2020): finished 43 trials in 0 min 1 sec
28th phase (01Jan2021 - 30Jun2021): finished 284 trials in 0 min 10 sec
Completed optimization. Total: 1 min 2 sec
[58]:
# Show the summary of estimation
cols = ["Start", "End", "ODE", "Rt", *cs.SIRF.PARAMETERS] + ["RMSLE", "Trials", "Runtime"]
snl_retro.summary(columns=cols)
[58]:
| 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 | 272.0 | 0 min 10 sec |
| 1st | 19Feb2020 | 05Mar2020 | SIR-F | 5.06 | 0.009385 | 0.001038 | 0.136759 | 0.025747 | 0.179086 | 232.0 | 0 min 10 sec | |
| 2nd | 06Mar2020 | 13Mar2020 | SIR-F | 5.57 | 0.021376 | 0.000448 | 0.131409 | 0.022629 | 0.097536 | 172.0 | 0 min 7 sec | |
| 3rd | 14Mar2020 | 24Mar2020 | SIR-F | 2.57 | 0.000096 | 0.002956 | 0.063547 | 0.021736 | 0.029797 | 229.0 | 0 min 10 sec | |
| 4th | 25Mar2020 | 02Apr2020 | SIR-F | 5.08 | 0.008598 | 0.000674 | 0.118416 | 0.022418 | 0.036930 | 231.0 | 0 min 10 sec | |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| Retrospective | 24th | 24Nov2020 | 08Dec2020 | SIR-F | 1.20 | 0.002399 | 0.000852 | 0.102798 | 0.084676 | 0.012275 | 106.0 | 0 min 5 sec |
| 25th | 09Dec2020 | 19Dec2020 | SIR-F | 1.22 | 0.002399 | 0.001136 | 0.103101 | 0.082974 | 0.012485 | 127.0 | 0 min 5 sec | |
| 26th | 20Dec2020 | 28Dec2020 | SIR-F | 1.16 | 0.000129 | 0.001515 | 0.108173 | 0.091496 | 0.014656 | 231.0 | 0 min 10 sec | |
| 27th | 29Dec2020 | 31Dec2020 | SIR-F | 1.60 | 0.001156 | 0.001263 | 0.103979 | 0.063480 | 0.004160 | 43.0 | 0 min 1 sec | |
| 28th | 01Jan2021 | 30Jun2021 | SIR-F | 0.99 | 0.000225 | 0.001696 | 0.082361 | 0.081446 | 0.348633 | 284.0 | 0 min 10 sec |
75 rows × 11 columns
[59]:
# History of reproduction number
_ = snl_retro.history("Rt")
[60]:
# History of Infected
_ = snl_retro.history("Infected")
[61]:
# Show the representative values
snl_retro.describe()
[61]:
| max(Infected) | argmax(Infected) | Confirmed on 30Jun2021 | Infected on 30Jun2021 | Fatal on 30Jun2021 | 2nd_Rt | 28th_Rt | 29th_Rt | 30th_Rt | 31st_Rt | ... | 36th_Rt | 37th_Rt | 38th_Rt | 39th_Rt | 40th_Rt | 41st_Rt | 42nd_Rt | 43rd_Rt | 44th_Rt | 45th_Rt | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Main | 76575 | 15Jan2021 | 798531 | 16847 | 14759 | 5.57 | 1.37 | 1.92 | 0.88 | 0.57 | ... | 1.3 | 1.73 | 1.56 | 1.74 | 1.4 | 1.28 | 0.86 | 0.55 | 0.52 | 0.83 |
| Retrospective | 37413 | 01Jan2021 | 740157 | 30563 | 13801 | 5.17 | 0.99 | - | - | - | ... | - | - | - | - | - | - | - | - | - | - |
2 rows × 24 columns


Responsive Grid for Bootstrap
There are three requirements you need to meet before you can use versatileGrid: jquery 1.10 +, bootstrap and font-awesome.
Add css files in the header section
<link href="your_css_path/bootstrap.min.css" rel="stylesheet"> <link href="your_css_path/font-awesome.min.css" rel="stylesheet"> <link href="your_css_path/versatileGrid.css" rel="stylesheet">
Add js at the bottom closest to  tag

bootstrap.min.js file is optional, add it only if you are going to use functions or plugins from bootstrap, otherwise is no needed.
If you are going to show static information, you can use the following HTML code. (This is default HTML for tables in Bootstrap)

 Id	 First name	 Last name	 Phone	 Username

 1	 Mark	 This is a long long long long very very very long so long example text text text and text	 315-789-8038	 mSmith

 2	 Sean	 Paterson	 315-232-1234	 sPat16

$(function() { $("#vgTable").versatilGrid(); });
If you want to apply versatilGrid to multiple grid on the fly, you can set different styles via attributes. Reffer to basic_multiple.html file in examples.
Options can be passed via data attributes for static data tables, for dynamic data use JavaScript options.
| Name | type | default | description |
|---|---|---|---|
| title | string | Grid Name | Add a Title to Grid Header. Available via attributes for static data: data-title |
| theme | string | gray | Change the style for Grid. Available themes: gray, blue, green, orange, dark. Available via attributes for static data: data-theme |
| colswidth | array | [ ] | Array for column widths in pixels. First index in the array is gonna be the width for first column, second index will be width for second column...etc. You can use auto for not apply width.
Available via attributes: data-colswidth
Some Examples:
|
| limits | array | [10,20,30] | This array hold the limit of rows per page. You will see a dropdown select with these limits down right in the Grid Footer. |
| defaultLimit | int | 10 | This going to be the default selected limit from previous option (limits). This value must exists in limits array. |
| url | string | If a url script is provided, content will be loaded via jQuery's Ajax method and injected into the grid. Ther response from script should be in Json Format. |
|
| onLoadData | function | This will trigger the function passed each time the grid load data pages. | |
| onBeforeLoadData | function | This will trigger the function passed before each time the grid load data pages. | |
| checkbox | boolean | false | This will enable multiple selector by checkboxes in each row. |
| toolbar | Array | This will enable the toolbar section. Bellow is an example to add buttons to toolbar:
$("#myGrid").versatileGrid({ title : 'Contacts', toolbar : [ {type:'button', name:'Activate', icon:'icon-ok', click:activateUsers}, {type:'button', name:'Add New', icon:'icon-plus', click:addNew} ] }); You need to have defined functions to use them in the click event. |
|
| errorMsg | String | Sorry, there was a problem getting the data. | This message will be shown if there is a problem getting the information from script. |
| notFoundMsg | String | Sorry, The server script was not found. | This message will be shown if the server script doesn't exits. |
Return an array with the row ids selected.
$("#myGrid").versatileGrid('getSelectedRows')
Reload grid using default or user options. You can use it for example after add or delete a record from the table.
$("#myGrid").versatileGrid('refreshGrid')
You can use any kind of server script, only you need to return the response in JSON format. The example below is a default response:
{ "page":1,"total":3,"records":15, "rows":[ { "id":"15", "data":["15","Katty","Phillips","qwerty@sdfgf.com","8545 5425 544"], }, { "id":"14", "data":["14","Matt","Runny","matrun@dsagfdfg.com","98956"], }, { "id":"13", "data":["13","Jago","Rott","jr@dfg.com","6256451"], } ] }
If you want to add action buttons per row use the option "rowActions", specify icon and function you want to execute:
{ "page":1,"total":3,"records":15, "rows":[ { "id":"15", "data":["15","Katty","Phillips","qwerty@sdfgf.com","8545 5425 544"], "rowActions":[ {"icon":"icon-edit","function":"editRow"}, {"icon":"icon-trash","function":"deleteRow"} ] }, { "id":"14", "data":["14","Matt","Runny","matrun@dsagfdfg.com","98956"], "rowActions":[ {"icon":"icon-edit","function":"editRow"}, {"icon":"icon-trash","function":"deleteRow"} ] }, { "id":"13", "data":["13","Jago","Rott","jr@dfg.com","6256451"], "rowActions":[ {"icon":"icon-edit","function":"editRow"}, {"icon":"icon-trash","function":"deleteRow"} ] } ] }
You can create new themes as you like, just follow the instuctions in
assets/css/custom_theme.css
, also view examples/custom_theme.html
to see how implement it.


class: center, middle, inverse, title-slide # ETC3250: High Dimensional DA ## Semester 1, 2020 ###
Professor Di Cook
Econometrics and Business Statistics
Monash University ### Week 3 (a) --- ## High Dimensional Data .orange[High dimensional data] is data that has *many more* variables than observations, that is, `\(p \gg n\)`. It occurs commonly in bioinformatics, when genetic studies often have many more information on genes than patients.    --- class: split-two .column[.pad50px[ ## SRBCT cancer prediction - The SRBCT dataset (Khan et al., 2001) looks at classifying 4 classes of different childhood tumours sharing similar visual features during routine histology. - Data contains 83 microarray samples with 1586 features. - .orange[**Goal**: to use DA techniques to classify cancer types based on ] ]] .column[.content.vmiddle.center[  .purple[Source:] [Nature](https://www.nature.com/articles/modpathol2016119) ]] --- class: split-two .column[.pad50px[ ## Diagonal Discriminant Analysis
 - The simplest form of regularisation assumes that the features are independent within each class. - Consider a *diagonal-covariance* LDA rule for classifying classes - A special case of the naive-Bayes classifier ]] .column[.content.vmiddle.center[  ]] --- ## Discriminant Function It can be shown that the discriminant score for a new observation `\(\mathbf{x}^*\)` when the features are considered independent reduces to the following: `$$\delta_k(\mathbf{x}^*) = - \sum_{j=1}^{p}\frac{(x_j^* - \bar{x}_{kj})^2}{s^2_j} + 2\log \pi_k.$$` The classification rule is then `$$C(\mathbf{x}^*) = \ell \quad \mbox{if} \quad \delta_{\ell}(\mathbf{x}^*) = \max_k \delta_k(\mathbf{x}^*).$$` --- ## Filter features for prediction To motivate the upcoming method, consider a binary classfication DLDA problem. One way we could establish which of the features are driving prediction would be to perform a two-sample `\(t\)`-test `$$t_{j} = \frac{\bar{x}_{1j} - \bar{x}_{0j}}{s_j}$$` with the `\(t\)` statistic providing a measure of how significant the difference in class means for predictor `\(j\)`. --- ## Filter features for prediction .green[Think about it:] Using the `\(t\)` statistic - `\(t_{j} = \frac{\bar{x}_{1j} - \bar{x}_{0j}}{s_j}\)` for all features, what is one way we can determine important features for prediction?
01
:
00
--- ## Filter features for prediction .orange[Answer:] Can consider filtering for features with `\(\lvert t_j \lvert > 2\)`, as this is deemed significant at the 5% level.  .font_tiny[Note - further consideration can be given to the issue of [*Multiple Testing*](https://en.wikipedia.org/wiki/Multiple_comparisons_problem)] --- ## Nearest Shrunken Centroids (NSC) Now consider the following statistic,
 `$$d_{kj} = \frac{\bar{x}_{kj} - \bar{x}_j}{m_k(s_j + s_0)} \quad \mbox{with} \quad m_k^2 = \frac{1}{N_k} - \frac{1}{N}$$` and `\(s_0\)` a small value to protect `\(d_{kj}\)` from small expression values.
 This statistic is a measure for how significant the difference between the class `\(k\)` mean for predictor `\(j\)`, and the overall mean for predictor `\(j\)`. --- ## Soft Thresholding Each `\(d_{kj}\)` is reduced by an amount `\(\Delta\)` in absolute value, and is set to zero if its absolute value is less than zero. `$$d'_{kj} = \mbox{sign}(d_{kj})( \lvert d_{kj} \lvert - \Delta)_{+},$$`    --- ## Nearest Shrunken Centroids Classifier The NSC uses either version of the statistic `\(d'_{kj}\)` to regularise by shinking the class means towards the overall mean for each predictor seperately as follows: `$$\bar{x}'_{kj} = \bar{x}_j + m_k(s_j + s_0)d'_{kj}$$`
 .green.center[Unless a predictor has a significant difference to the overall mean for at least one class, it is useless for classification.] We then use the shrunken centroids `\(\bar{x}'_{kj}\)` in place of `\(\bar{x}_{kj}\)` in the DLDA discriminant function. --- ## multiDA (DA via multiple hypothesis testing)
 The multiDA method utilises a multiple hypothesis testing approach to select informative features. It uses a three step process: - .orange[Define] what is a discriminative feature - .orange[Estimate] parameters of the hypothesis testing process, and - .orange[Predict] new data points using the estimates from training data. --- class: split-two .column[.pad50px[ ## What defines a discriminative feature?
 Suppose we have 3 classes to model. If we assume the features are independent, within each feature we can group them as: .orange[**One group**] (NOT a discriminative feature) ]] .column[.content.vmiddle.center[  ]] --- class: split-two .column[.pad50px[ ## What defines a discriminative feature?
 Suppose we have 3 classes to model. If we assume the features are independent, within each feature we can group them as: .orange[**Two groups**] (Groups 2 and 3, against 1) ]] .column[.content.vmiddle.center[  ]] --- class: split-two .column[.pad50px[ ## What defines a discriminative feature?
 Suppose we have 3 classes to model. If we assume the features are independent, within each feature we can group them as: .orange[**Two groups**] (Groups 1 and 3, against 2) ]] .column[.content.vmiddle.center[  ]] --- class: split-two .column[.pad50px[ ## What defines a discriminative feature?
 Suppose we have 3 classes to model. If we assume the features are independent, within each feature we can group them as: .orange[**Two groups**] (Groups 1 and 2, against 3) ]] .column[.content.vmiddle.center[  ]] --- class: split-two .column[.pad50px[ ## What defines a discriminative feature?
 Suppose we have 3 classes to model. If we assume the features are independent, within each feature we can group them as: .orange[**Three groups**] (All groups are different) ]] .column[.content.vmiddle.center[  ]] --- class: split-two .column[.pad50px[ ## What about K > 3 classes? .green[Question: How many ways can you partition a set of size K?] The total number of partitions of a K-element set is the [Bell number](https://en.wikipedia.org/wiki/Bell_number) `\(B_K\)`. The first several Bell numbers are: `\(B_0= 1\)`, `\(B_1= 1\)`, `\(B_2= 2\)`, `\(B_3= 5\)`, `\(B_4= 15\)`, `\(B_5= 52\)`, and `\(B_6= 203\)`. .font_small[.orange[Right: The 52 partitions of a set with 5 elements]] ]] .column[.content.vmiddle.center[  ]] --- ## LRT – compare to the null For all 5 hypotheses, compare the likelihood to the null. Pick the "partition" that is the most likely.    --- class: split-60 .column[.pad50px[ ## multiDA in R
 ```r library(multiDA) res <- multiDA(y = SRBCT$y, X = SRBCT$X, penalty = "EBIC", equal.var = TRUE, set.options = "exhaustive") ``` We can then examine the class groupings using the `plot()` method for `multiDA`: ```r plot(res, ranks= 1) ``` ]] .column[.content.vmiddle.center[  ]] --- ## Compare performance - 100 trial, 5 fold CV  --- layout: false # 👩💻 Made by a human with a computer ### Slides at [https://monba.dicook.org](https://monba.dicook.org). ### Code and data at [https://github.com/dicook/Business_Analytics](https://github.com/dicook/Business_Analytics).
 ### Created using [R Markdown](https://rmarkdown.rstudio.com) with flair by [**xaringan**](https://github.com/yihui/xaringan), and [**kunoichi** (female ninja) style](https://github.com/emitanaka/ninja-theme).

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.


Gastroenteritis
Executive summary
Introduction
Bacterial and viral gastroenteritis causes acute inflammation of the GI mucosa of the middle or lower intestine. It has many causes, can range from mild to severe, and typically manifests with symptoms of vomiting, diarrhoea, and abdominal discomfort. It is primarily an acute, self璴imited illness. Immunocompromised patients can develop unremitting or fatal symptoms from gastroenteritis.
Gastroenteritis is commonly due to infectious agents鈥攙iruses, bacteria, and parasites. There are four viral agents: rotavirus, norovirus, enteric adenovirus, and astrovirus. Rotavirus is the most common cause of severe diarrhoea in children. Exotoxins produced by some organisms induce hypersecretion or increased peristalsis resulting in diarrhoea or vomiting. Viruses destroy enterocytes of the upper jejuna.
Bacteria such as E. coli and Salmonella penetrate and invade the gastric mucosa and lead to diarrhoea accompanied by fever and faecal leukocytes.
Target User
路 Doctors
路 Nurses
Target area of use
路 Ward
路 Outpatient department
路 Gate clinic
Key areas of focus/new additions/changes
This guideline addresses the management of gastroenteritis as well as persistent diarrhoea in children, adults and those infected with HIV.
Limitations
We have limited access to diagnostic tests for persistent diarrhoea.
Presenting symptoms and signs
In all age groups, gastroenteritis may present with fever, abrupt onset of nausea and vomiting, abrupt onset of diarrhoea, explosive flatulence, cramping abdominal pain, mucoid stools with or without blood, tenesmus, myalgia, headache, malaise, potential for seizures in children with high fever or electrolyte abnormalities
Any patient complaining of diarrhoea and vomiting should be asked for more details in order to establish:
路 how frequent the stools and vomiting are
路 how long the illness has gone on for
路 the nature of the stools and vomitus
路 if there are any risk factors for more serious illness
路 recent study abroad
路 if there is a potential outbreak in the compound or surrounding area
Examination findings
Examine the patient looking for evidence of:
路 Dehydration 鈥?see below for classification of severity.
路 Malnutrition (in which case they must be managed according to the malnutrition protocol).
路 Chronic illness and sepsis.
路 Rule out a surgical cause (such as intussusception in a child).
路 Auscultate the abdomen in all quadrants for bowel sounds; note hyperactive bowel sounds, absent or hypoactive bowel sounds (common with botulism), and borborygmi.
路 Palpate the abdomen for diffuse tenderness, slight distension, masses, rebound tenderness, and spasm.
路 Rectal exam: Check for masses, fissures, inflammation, perianal erythema, or stool in ampulla.
路 Neurologic exam: Check for dizziness, difficulty swallowing, and other neurologic signs. (Neurologic signs and symptoms indicate botulism and require emergency intervention.)
Severity of dehydration
Children:
路 Some dehydration: Two or more of the following signs
o restlessness or irritability
o sunken eyes
o drinks eagerly, thirsty
o skin pinch goes back slowly
路 Severe dehydration: Two or more of the following signs:
o lethargy or unconsciousness
o sunken eyes
o unable to drink or drinks poorly
o skin pinch goes back very slowly (≥ 2 s)
Adults:
路 Severe dehydration is present in adults with reduced level of consciousness, reduced urine output, clammy extremities, tachycardia, low blood pressure or peripheral cyanosis.
When to refer to doctor in OPD
Refer patients with:
路 diarrhoea for more than 2 weeks (persistent or intermittent)
路 malnutrition
路 known HIV infection
路 severe dehydration
路 chronic illness
路 sepsis
路 a surgical abdomen.
Other patients can be managed in gate clinic without further investigation.
Investigations
May not be necessary but for more severe cases consider:
路 FBC.
路 Stool for M,C&S.
路 If there is fever, test for malaria.
路 If there is evidence of systemic compromise, send blood for U&Es 鈥?children frequently present with severe electrolyte disturbance.
路 If there is evidence of chronic illness, counsel and test the patient for HIV.
路 Urinalysis: Excludes UTI as cause of nonspecific vomiting.
路 Abdominal US to rule out intussusception.
Differential Diagnoses
路 Acute viral hepatitis
路 Acute appendicitis
路 Cholecystitis
路 Inflammatory bowel disease
路 Pelvic inflammatory disease
路 Intussusception
路 Bowel obstruction from other causes
Management in Gate clinic
Treat patients with some dehydration with ORS. Give 50-100 ml/kg over 4 hours to replace the existing deficit.
If patient cannot drink the prescribed ORS, the diarrhoea losses are large or they fail to improve with the ORS, then refer to the doctor.
If the patient improves, prescribe further ORS for the rest of the day. Advise them to make up sugar-salt-solution the next day. If the diarrhoea persists after this, tell them to return to the clinic.
Acute watery diarrhoea with or without vomiting
Give zinc supplements to all children for 10-14 days in a dose of 20 mg/day for those aged 6 months and above and 10mg/day for those aged under 6 months.
Antibiotics are not indicated unless the diarrhoea is profuse and cholera is suspected.
Dysentery with or without vomiting
This is most commonly caused by shigella. It should be treated with ciprofloxacin 20 mg/kg up to 500 mg BD for 5 days.
If there is no response after 48 hours, then the possibility of amoebic dysentery should be considered. Give metronidazole 15 mg/kg up to 500 mg TDS for 7-10 days.
Management in OPD or on the ward
See flow chart for quick reference.
Rehydration
All patients with dehydration must be rehydrated.
Treat all patients with severe dehydration with iv fluids. ORS should be started at the same time unless the patient is vomiting. Give a 30 ml/kg bolus of Ringer鈥檚 lactate over 30 minutes. Follow this in children with a further 70 ml/kg infusion of Ringer鈥檚 lactate over 2.5 hours. Give adults a further 100 ml/kg over the next 4 hours.
Treat patients with some dehydration with ORS. Give 50-100 ml/kg over 4 hours to replace the existing deficit. Add extra fluid by measuring ongoing losses and replacing ml for ml.
Acute watery diarrhoea or dysentery with or without vomiting
Treat as described for Gate clinic above
Persistent diarrhoea and vomiting in patients with HIV
This is most commonly caused by an infection, although other possibilities should be considered. Infectious causes include all the usual enteric bacteria, viruses and protozoa such as cryptosporidium. Abdominal TB and HIV itself can cause diarrhoea, as can infiltrative conditions such as lymphoma and Kaposi鈥檚 sarcoma.
Begin by assuming a bacterial or parasitic cause. After sending a stool culture, treat with Metronidazole 10 mg/kg up to 500 mg TDS for 7 days and Chloramphenicol 12.5 mg/kg up to 500 mg QDS for 7 days. High dose septrin can be used as an alternative to Chloramphenicol for patients not on septrin prophylaxis. The dose is 48 mg/kg (max 1920 mg) BD for 2 weeks, followed by 24 mg/kg (max 960 mg) BD for another 3 weeks.
If the diarrhoea has been present for more than 2 weeks, then also add albendazole 7.5 mg/kg up to 400 mg BD for 3 days. Then repeat this treatment after 2 weeks.
Refer the patient to an ART centre to ensure they are assessed and started on treatment. Encourage the patient to eat nutritious meals on a frequent basis.
If diarrhoea persists after this, consider an alternative cause. Is there evidence of abdominal TB, lymphoma or KS?
Refer to a gastroenterologist for further management.
Persistent diarrhoea and vomiting in children
This is most commonly infectious in origin. There are a number of different mechanisms for the persistence:
路 the infection is difficult to clear
路 there is secondary damage to the intestine such as lactulose intolerance or antibiotic-associated diarrhoea
路 intestinal healing is delayed by specific deficiencies or malnutrition
路 there are multiple acute infections with different agents mimicking persistent diarrhoea.
Malnutrition may also itself cause chronic diarrhoea which may be associated with allergic enteropathy and small bowel bacterial overgrowth.
Treat as for acute watery diarrhoea, but with extra concern for nutritional status. Give multivitamins for 2 weeks. Advise the carer to avoid giving milk-based products until the diarrhoea has resolved and to feed the child little and often.
If the diarrhoea fails to respond to these measures, do not use loperamide or other anti-diarrhoeal agents. Refer to a paediatrician for further assessment.
Persistent diarrhoea and vomiting in adults
This may also be caused by a persistent pathogen, however, other causes may need to be considered 鈥?most patients are likely to have been treated with antibiotics prior to presenting to us.
Consider the possibility of difficult to treat infections and send stools for MC&S prior to further treatment. If the patient has been given many courses of antibiotics, antibiotic-associated diarrhoea may be the cause. This is best treated with a 2 week course of metronidazole (500 mg TDS).
In other cases, refer to a gastroenterologist for further assessment.
Key Issues for Nursing care
路 Ensure the patient is receiving the right fluid replacement and is taking everything as prescribed.
路 Ensure that the patient or their carer informs you of all episodes of diarrhoea and vomiting and record losses 鈥?either by weighing nappies or estimating quantities.
路 Send stool samples prior to starting antibiotics wherever possible.
路 Ensure meticulous hand washing to decrease transmission.
路 If the patient is diapered and/or incontinent, tell the patient or caregiver to adhere strictly to contact precautions.
路 Diaper changing areas should be separate from food preparation areas.
路 Chlorine璪ased disinfectants inactivate rotavirus and may prevent disease transmission from contact with environmental surfaces.
References
LaRocque and Pietroni 2017. Approach to the adult with acute diarrhea in resource-limited countries. UpToDate May 2017.
Harris and Pietroni 2017. Approach to the child with acute diarrhea in resource-limited countries. UpToDate Mar 2017.
Moore 2016. Persistent diarrhoea in children in resource-limited countries. UpToDate Dec 2016.
Bonis and Lamont 2017. Approach to the adult with chronic diarrhea in resource-rich settings. UpToDate Jun 2017.
The Gambia HIV treatment manual 2011. Banjul, The Gambia: National Aids Secretariat; 2011.
Centers for Disease Control and Prevention: www.cdc.gov
|
Written by: |
Name: Amie Secka |
Date: 16 July 2018 |
|
Reviewed by: |
Name: Baderinwa Abatan |
Date: 01 August 2018 |
|
Version: |
Change history: |
Review due date: |
|
1.0 |
New document |
|
|
2.0 |
Adapted from previous guideline on diarrhoea |
15 August 2020 |
|
Review Comments (if applicable) |
|
|


This is a simple Windows application that helps to change the logon background in Windows Vista/7. Tested to work on Windows 7 64-bit, and it does require administrator access (as it modifies the registry).
This might be labelled internally as "LogonBGChanger2" - for a good reason - I had to make the program again from scratch because I lost the source while configuring Git with Visual Studio. They do not play nice.


I am a hard working, honest individual, always willing to learn new skills. Quite friendly, helpful and polite, have a good sense of humor. To fulfill my object, I am outgoing and tactful, and able to listen effectively when solving problems.
To obtain a position where I can gain experience in a professional environment and acquire new skills that will guide me to my career objectives & where enterprising spirit and effort is valued, individual as well as team performance is rewarded and creativity is encouraged.
2007-2013
2013-2016
2016-2019
2019 - Now
Build With Angga Class
Build With Angga Class
Dicoding Academy


This page shows how to create a Rating widget to gracefull degrade in pages with Java Script disabled. It requires PHP scripting enabled on the server.
Please disable the Java Script for your browser and see how the Rating widget will behave.
For graceful degradation we added inside the main Rating widget container an input element that will get in action when Java Script is off allowing you to rate and send the rated values to the server. If Java Script is enabled the input elements you add for graceful degradation are hidden by default, becoming visible only in pages with Java Script disabled.
To have your page working also when Java Script is off and still be able to send your rate to the server, you have to include your Rating widget inside a form and provide a submit button to send the data.
You can use any input element for graceful degradation: text input, select input, radio input.


6.10 psb_spfree — Frees a sparse matrix
call psb_spfree(a, desc_a, info)
-
Type:
- Synchronous.
-
On Entry
-
-
a
- the matrix to be freed.
Scope:local
Type:required
Intent: inout.
Specified as: a structured data of type psb_Tspmat_type.
-
desc_a
- the communication descriptor.
Scope:local.
Type:required.
Intent: in.
Specified as: a structured data of type psb_desc_type.
-
On Return
-
-
info
- Error code.
Scope: local
Type: required
Intent: out.
An integer value; 0 means no error has been detected.


Cyprus president: Arsonists won’t stop national park plan
NICOSIA, Cyprus (AP) - Cyprus’ president is vowing to go ahead with creating a national park in a largely untouched area of the tourism-reliant island, following a string of deliberately-set forest fires that were blamed on local landowners’ development plans.
Nicos Anastasiades tweeted Thursday that such actions only make authorities more determined to protect and rehabilitate the remote northwestern Akamas Peninsula.
Authorities say “premeditated arson attacks” on Wednesday burnt around 70 hectares (173 acres) of dense pine forest in the area.
Police believe the fires may have been set by local residents who fear that declaring the area a national park will reduce property values and prevent land development.
Anastasiades said any development “can and must” be in step with efforts to safeguard the peninsula’s environmental value.
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


Exercise counseling sessions are offered in UCSF’s Helen Diller Cancer Center and the Mission Bay Campus, The Stanford Cancer Center, Marin General Hospital, SF General Hospital, Oakland's Charlotte Maxwell Clinic and Standford Sout Bay Cancer Center. Sign up here.
Exercise at clubs located throught the San Francisco Bay Area where steep discounts as well as scholarships are available. Most of the fitness clubs offer one-on-one personal training sessions. Need more information? Learn more about each of the fitness clubs and their programs. Ready to start? Sign-up now.


|
panel - A panel gadget handle
file$ - An image filename |
|
SetPanelImage allows you to select a background bitmap image for a panel gadget.
The image is tiled if necessary to fill the entire client area of the panel. See also: CreatePanel, SetPanelColor. |


Hello, MongoDB!
"HelloMongo" is a dashboard of activity in the MongoDB world. At a glance, you can see the latest news, announcements, code commits, forum posts and bug/feature/roadmap activity
About
HelloMongo is an experiment in bringing together some of the public information from the MongoDB project into a single dashboard. For now, it pulls in mailing list activity, twitter feeds, GitHub commit logs and JIRA issues to give a snapshot of what is happening in the MongoDB community.
HelloMongo uses Twitter bootstrap for its look-and-feel and uses the zRSSFeed jQuery plugin to parse RSS feeds. Source code for HelloMongo is available here. HelloMongo is designed to work as a single HTML file and so doesn't require any application server or database infrastructure. www.hellomongo.com is hosted on a web accessible AWS S3 bucket.
I've written a bit more about HelloMongo here. If you have thoughts or questions, drop me an email at<EMAIL_ADDRESS>Enhancements and patches are, of course, welcome. More importantly, adapt the code or come up with new dashboards for your company. Transparency and openness are good.


WITNESS LIST Children's Health Insurance (Interim) Committee June 25, 1998-9:30A CHIP On: Beckett, Sheila (ERS), Austin Berndt, Debbie (TXMHMR), Austin Berndt, Trey (LBB), Austin Camacho, Jose (TACHC), Austin Dunkelberg, Anne (CPPP), Austin Gilbert, Don Comm. (HHSC), Austin Hall, Don (BC/BS of Texas), Richardson Hamilton, Tyrette (THKC), Austin Johnson, Ronald Dr. (Tx. Dental Assn.), Houston McCormack, Maureen (LBB), Austin McGuire, Mary (Managed Care Industry), Austin Myron, Rhonda (TDI), Austin Rider, Jane Dr. (TMA,TPS,TAFP), San Angelo Schwartz, Jonas (UCP of Texas), Austin Stelly-Seitz, Charlotte (TMA,TPS,TAFP), Houston Van Hoose, Thomas Dr. (TPA), Austin Wayne, Richard Dr. (TCHA/Santa Rosa Hosp.), San Antonio Wertz,Linda (HHSC-State Medicaid), Austin Wood, Gary (Mental Health Assn.), Austin Zinnecker, Anita (LBB), Austin


Library for interacting with the self-sovereign identity solution provided by Jolocom.
Interested in our vision? Take a look at our whitepaper (it is currently outdated, and we are working on updating it).
Want to use our library? Please refer to the following resources:
Integration and unit tests located in the ./tests
folder are a good place to start too.
We use tslint
for static Typescript code analysis.tslint [file]
running code analysistslint [file] --fix
running automatic fix of rule violations (fixes most of the common issues)
Generated using TypeDoc


COVID- opacities lower CXR Fig patients {border-style px;} #ffffff;} bilateral right Chest chest day lung respiratory worsening peripheral positive showed shows coronavirus (%) infection lobe patchy (arrows). GGOs clinical findings Case Day LL, acute features patient presented (A) CXR, FIG disease history mild px; {font-family B/L, COVID-. Patient airspace font-size pneumonia syndrome tested Elsevier Radiology cough, days double; fever, glass global ground hazy ill-defined initial multifocal pulmonary reported seen (B) (white Axial Imaging border-color border-width case imaging include mid novel septal solid; subpleural symptoms treatment upper {font-style {font-weight (B, (D) A). ARDS China College GGO, Initial Radiol Roentgenol Serial bold centre common contact courier; disease, distress em; health hospitalized hydroxychloroquine, left lobe. male mean middle opacities. organizing pandemic predominant present progression pt;} radiograph. radiograph; recent resource revealed series severe shortness thickening, viral virus worsened


The barriers are rectangles which are defined on a scene with a very specific function: they prevent the protagonist (the other characters are not affected by barriers) go through a given area. The barriers have some conditions, so when a barrier with active conditions is brought into the path of the player when moving (even slightly), the protagonist will stand right in front of the barrier, without traspassing it. If conditions stop satisfying then stop the barrier disappears.
General explanation of the panel of edition usage
General explanation of the table usage


Privacy Policy
Although the University System of Maryland and Affiliated Institutions (USMAI) Library Consortium makes every effort to protect the privacy of user circulation records (including books and Internet searches), the USMAI Libraries may be obligated to release such information to federal law enforcement agents in response to a search warrant or subpoena issued in accordance with the Foreign Intelligence Surveillance Act, 50 U.S.C. 1861, as amended by the USA PATRIOT Act (Public Law 107-56). That law prohibits library staff from informing you that it received such a request.
Google Analytics Notice
Some USMAI websites and applications utilize Google Universal Analytics to collect information about use of these web applications.
When you browse these websites, certain information about your visit is automatically gathered and stored. This information, which does not identify you personally, includes the following:
- The domain and IP address from which you access our site
- The type of browser and operating system used to access our site
- The date and time you access our site
- The pages you visit and the amount of time you spend on each page
Demographic and Interests based on advertiser data is also collected. This information is derived from the third-party DoubleClick cookie and device identifiers. You can prevent this information from being collected by disabling cookies.
This information helps us make improvements to the website. You can opt out of Google Analytics tracking by installing the Google Analytics Opt-out Browser Add-on.
For more information, see "How Google uses data when you use our partners' sites or apps".


{% extends "base.html" %} {% load i18n %} {% block head_title %}{% trans "Password Reset" %}{% endblock %} {% block content %}
{% trans "Note" %}: {% blocktrans %}you are already logged in as {{ user }}.{% endblocktrans %}
{% endif %}{% trans "Forgotten your password? Enter your e-mail address below, and we'll reset your password and e-mail the new one to you." %}
{% comment %}{% blocktrans %}If you have any trouble resetting your password, contact us at {{ contact_email }}.{% endblocktrans %}
{% endcomment %} {% endblock %} {% block extra_body %} {% endblock %}


Transport Corp Standalone September 2019 Net Sales at Rs 628.23 crore, up 1.28% Y-o-Y
Reported Standalone quarterly numbers for Transport Corporation of India are:
Net Sales at Rs 628.23 crore in September 2019 up 1.28% from Rs. 620.26 crore in September 2018.
Quarterly Net Profit at Rs. 33.27 crore in September 2019 up 28.6% from Rs. 25.87 crore in September 2018.
EBITDA stands at Rs. 64.92 crore in September 2019 up 6.04% from Rs. 61.22 crore in September 2018.
Transport Corp EPS has increased to Rs. 4.33 in September 2019 from Rs. 3.37 in September 2018.
Transport Corp shares closed at 284.65 on November 05, 2019 (NSE) and has given -0.54% returns over the last 6 months and 5.64% over the last 12 months.
| Transport Corporation of India | |
| Standalone Quarterly Results | in Rs. Cr. |
| Sep'19 | Jun'19 | Sep'18 | |
| Net Sales/Income from operations | 628.23 | 612.11 | 620.26 |
| Other Operating Income | -- | -- | -- |
| Total Income From Operations | 628.23 | 612.11 | 620.26 |
| EXPENDITURE | |||
| Consumption of Raw Materials | -- | -- | -- |
| Purchase of Traded Goods | -- | -- | -- |
| Increase/Decrease in Stocks | -- | -- | -- |
| Power & Fuel | -- | -- | -- |
| Employees Cost | 37.35 | 37.23 | 34.66 |
| Depreciation | 18.98 | 18.61 | 19.05 |
| Excise Duty | -- | -- | -- |
| Admin. And Selling Expenses | -- | -- | -- |
| R & D Expenses | -- | -- | -- |
| Provisions And Contingencies | -- | -- | -- |
| Exp. Capitalised | -- | -- | -- |
| Other Expenses | 534.31 | 518.67 | 532.50 |
| P/L Before Other Inc. , Int., Excpt. Items & Tax | 37.59 | 37.60 | 34.05 |
| Other Income | 8.35 | 7.53 | 8.12 |
| P/L Before Int., Excpt. Items & Tax | 45.94 | 45.13 | 42.17 |
| Interest | 7.70 | 8.24 | 9.30 |
| P/L Before Exceptional Items & Tax | 38.24 | 36.89 | 32.87 |
| Exceptional Items | -9.88 | -- | -- |
| P/L Before Tax | 28.36 | 36.89 | 32.87 |
| Tax | -4.91 | 7.15 | 7.00 |
| P/L After Tax from Ordinary Activities | 33.27 | 29.74 | 25.87 |
| Prior Year Adjustments | -- | -- | -- |
| Extra Ordinary Items | -- | -- | -- |
| Net Profit/(Loss) For the Period | 33.27 | 29.74 | 25.87 |
| Equity Share Capital | 15.37 | 15.33 | 15.33 |
| Reserves Excluding Revaluation Reserves | -- | -- | -- |
| Equity Dividend Rate (%) | -- | -- | -- |
| EPS Before Extra Ordinary | |||
| Basic EPS | 4.33 | 3.88 | 3.37 |
| Diluted EPS | 4.32 | 3.87 | 3.36 |
| EPS After Extra Ordinary | |||
| Basic EPS | 4.33 | 3.88 | 3.37 |
| Diluted EPS | 4.32 | 3.87 | 3.36 |
| Public Share Holding | |||
| No Of Shares (Crores) | -- | -- | -- |
| Share Holding (%) | -- | -- | -- |
| Promoters and Promoter Group Shareholding | |||
| a) Pledged/Encumbered | |||
| - Number of shares (Crores) | -- | -- | -- |
| - Per. of shares (as a % of the total sh. of prom. and promoter group) | -- | -- | -- |
| - Per. of shares (as a % of the total Share Cap. of the company) | -- | -- | -- |
| b) Non-encumbered | |||
| - Number of shares (Crores) | -- | -- | -- |
| - Per. of shares (as a % of the total sh. of prom. and promoter group) | -- | -- | -- |
| - Per. of shares (as a % of the total Share Cap. of the company) | -- | -- | -- |
| Source : Dion Global Solutions Limited |


foodraveller
top stories645 Stories
more
deepika
27 Follower . 7 stories
Not even 6 months old, and this baby has already been...
Shruti Shergill
32 Follower . 4 stories
A typical turkish breakfast spread is something one...
Kapil Kumar
145 Follower . 54 stories
Pattaya is one of the best tourist place in Thailand...
Sagrika Tanwar
3 Follower . 1 stories
I was on a road trip with my cousins. We were...
top Photos893 Photos
more
Sagrika Tanwar
3 Follower . 10 photos
deepika
27 Follower . 14 photos
Parag Bagul
117 Follower . 152 photos
Events579 events | 244 events today
more
6th Aug 2017, 6:45PM, Delhi
M-89/90 Outer Circle, Connaught Place
Delhi
109 people are intrested
21th july 2017, 8:30PM, Delhi
Oodles Hotel
Delhi
38 people are intrested
11th Aug 2017 Manali
Leh, Ladakh (Outside Delhi) - Leh, Ladakh
Manali
55 people are intrested


Nuklear Brain
Home
Services
Download
Contact
About
We have Everything for You...
Site under Construction...
Fresh Content comming soon..!!


Run workcell demo¶
To run the demo simulation for the scene you just generated, do the following:
ROS1¶
$ source /opt/ros/melodic/setup.bash
$ catkin build
$ source devel/setup.bash
$ roslaunch <scene_name> demo.launch
ROS2¶
In a new terminal, navigate to your workcell_ws
$ source /opt/ros/foxy/setup.bash
$ colcon build
$ source install/setup.bash
$ ros2 launch <scene_name> demo.launch.py
Rviz will then be launched and you should see your scene displayed. To integrate this scene with Moveit2, check out Grasp Execution Demo


Man struck and killed by train at East Harlem subway stop: cops
by Joseph Konig and Craig McCarthyA man using a walker was struck and killed by a train in East Harlem on Sunday morning, officials said.
The man was struck by a No. 2 train at the 116th Street station near Lenox Avenue around 8:30 a.m., cops said.
It was unclear how the man ended up on the tracks.


Class ShiftInstance is an instance of a Shift. A shift instance is worked by a Team.
More...
Class ShiftInstance is an instance of a Shift. A shift instance is worked by a Team.
◆ CompareTo()
| int Point85.ShiftSharp.Schedule.ShiftInstance.CompareTo |
( |
ShiftInstance |
other | ) |
|
|
inline |
Compare this non-working period to another such period by start time of day
- Parameters
-
| other | Other shift instance |
- Returns
- -1 if less than, 0 if equal and 1 if greater than
◆ GetEndTime()
| LocalDateTime Point85.ShiftSharp.Schedule.ShiftInstance.GetEndTime |
( |
| ) |
|
|
inline |
Get the end date and time of day
- Returns
- Ending time
◆ IsInShiftInstance()
| Boolean Point85.ShiftSharp.Schedule.ShiftInstance.IsInShiftInstance |
( |
LocalDateTime |
ldt | ) |
|
|
inline |
Determine if this time falls within the shift instance period
- Parameters
-
| ldt | Date and time to check |
- Returns
- True if the specified time is in this shift instance
◆ ToString()
| override string Point85.ShiftSharp.Schedule.ShiftInstance.ToString |
( |
| ) |
|
|
inline |
Build a string representation of a shift instance
- Returns
- String
◆ Shift
| Shift Point85.ShiftSharp.Schedule.ShiftInstance.Shift |
|
get |
◆ StartDateTime
| LocalDateTime Point85.ShiftSharp.Schedule.ShiftInstance.StartDateTime |
|
get |
start date and time of day
◆ Team
| Team Point85.ShiftSharp.Schedule.ShiftInstance.Team |
|
get |
The documentation for this class was generated from the following file:


Dex+
Your Info
Address
ETH Balance
ERC20 Balance
ERC721 Balance
Orders
#
Currency
Token
Owner
Price
Expire time
Fill
Place an order
Price
Token Name
Expiration Date & Time
Create an order


National Lottery has named the luckiest postcodes in the UK - see if you live by one
Feeling lucky? Well, it could all be in the postcode. The statistics by the National Lottery looked at where players are most likely to win a prize of more than £50,000
by Emma BowdenIf you never have much luck with your lottery numbers, a move to Birmingham might boost your chances.
The National Lottery has revealed the luckiest postcodes in the UK as part of its 25th birthday celebrations.
A staggering 5,500 millionaires have been made since the lottery launched in 1994, according to the statistics, and 168 of them are from the Birmingham postcode.
While the West Midlands city takes the top spot for players banking a seven-figure sum, some 133 players with a Belfast postcode have scooped a million each.
Lottery luck also lives in Glasgow, which takes third place with 125 millionaires made since the lottery launched.
The statistics by the National Lottery also looked at where players are most likely to win a prize of more than £50,000.
Galashiels, a town in the Scottish borders, has seen the most big winners by local population.
On average, one in every 894 players has banked a big prize since the lottery's launch, while traditionally lucky Romford in Essex and Cleveland in the north-east of England have seen one in 922 and one in 952 respectively.
Data from the last three years suggests Leicester locals have been in luck recently, climbing the top 10 with 30 millionaires made since September 2016.
Andy Carter, senior winners' adviser for the National Lottery, said: "We go to every corner of the country to pay out big prizes and make millionaires.
"With on average seven new millionaires made every week, you can be sure we'll be visiting somewhere close to you very soon.
"Over the last 25 years, The National Lottery has been making amazing things happen.
"Thanks to our National Lottery players, 565,000 Good Cause grants have been given out to projects big and small, that's the equivalent of 200 life-changing projects in every UK postcode district making a huge impact on communities all over the country.
"On top of this, we have celebrated so many lucky winners who have won life-changing sums of money - here's to another 25 years of making dreams come true."


This page demonstrates how to sign EIP712 typed data using MetaMask and verify it in Solidity. Feel free to learn from it and adapt it for your dApp and smart contracts.
You need a version of MetaMask that supports eth_signTypedData_v3 to use this demo. Prebuilt extensions can be downloaded from metamaskbot here.
Next, copy and paste this into Remix, deploy it in the Javascript VM environment, and run the verify function.
The signature generated by MetaMask, as well as your wallet address, has been inserted into the Solidity code above. The code hashes the data you just signed, runs ecrecover with yoour signature, and compares it with your wallet address.
If Remix displays
0: bool: truethat's great! Your wallet address was successfully authenticated against the signature.


Emscripten Box2D demo
This demo uses JavaScript generated from the Box2D C++ source code by the
emscripten
compiler.
See
https://github.com/kripken/box2d.js
for more details.
Reset
Pause
Single step
(Keyboard: R, P, S)
Zoom
+
-
(Keyboard: X, Z)
Hold down Shift while moving the mouse to pan (Keyboard: arrow keys)
You need to click on the canvas before using the keyboard.
Test:
ball
Debug draw flags:
Shapes
Joints
AABBs
Transforms
Show stats


http://arduino.cc/en/Main/ArduinoBoardDue
Would it be possible to use this with the emonTx shield? The reason would be the high processing power for calculations and also more RAM. Is there anyone who tried this out?
Archived Forum |
|
Arduino Due (ARM CPU at 84 MHz) + emonTx ShieldSubmitted by fluppie007 on Thu, 13/12/2012 - 10:26http://arduino.cc/en/Main/ArduinoBoardDue Would it be possible to use this with the emonTx shield? The reason would be the high processing power for calculations and also more RAM. Is there anyone who tried this out? » |
Re: Arduino Due (ARM CPU at 84 MHz) + emonTx Shield
I know this topic is quite old, but still, if anybody's interested, I've been successful in using Arduino Due for my version of emonTx. In my system I'm monitoring 10 current probes + 1 AC-AC voltage adapter using Due's 12-bits ADC inputs. I've also modified EmonLib to run on Due. The whole measurement cycle takes less than 2 sec.
The complete description you can get here: http://boredomprojects.net/index.php/projects/home-energy-monitor
Hope this helps!
Re: Arduino Due (ARM CPU at 84 MHz) + emonTx Shield
Wow, nice work! and good blog post. :-)
It's great that you have got the RFM12B and EmonLib working on an Arduino Due. Will the changes you made to emonLib integrate into the current emonLib? If so it would be great if you could push a GitHub pull request to us with the changes needed for the Arduino Due to the OpenEnergyMonitor GitHub. This way the whole community could benefit.
..or we could create a new library called emonLib Due if you think the changes are too much to integrate.
Please let us know what you think.
Do you think the RFM12B using the RF12 JeeLib library could be made to work on the Due? What was your reason for going for the LowPowerLab version.
Keep up the good work and have a good Christmas.
Re: Arduino Due (ARM CPU at 84 MHz) + emonTx Shield
Nice work.
I bought a Due for running Robins MK2i diverter but I'm not very good with code and had put it on the back burner until I had some spare time to look at it. I'm also new to programs and sketches.
Re: Arduino Due (ARM CPU at 84 MHz) + emonTx Shield
Follow the links to boredman's blog post above. He's done a nice write up of using he Due. We'll try and integrate it into the project in 'Due' course! It's a nice bit of hardware.
Re: Arduino Due (ARM CPU at 84 MHz) + emonTx Shield
Thanks a lot for your comments, Glyn!
I'm happy to know that it could be useful to the community. I am new to Git stuff, but I will work on setting up a pull request.
Actually, my EmonLib incorporates two types of changes: (1) utilization of Due's 12-bit ADC resolution and (2) 3-phase buffer and delay algorithm, since my 10 CT inputs come from all three line phases, but my AC-AC voltage adapter is connected to only one phase. So, what do you think, maybe it's best to keep this version separated from main EmonTx library?
About RFM12B library. The main difficulty was dealing with SPI in Due environment. The easiest way was to use SPI_Class.cpp (object oriented). That is the reason I used LowPowerLab version, which is also already object oriented and is way cleaner. To be honest, I think it is not worth the effort to try and modify RF12 JeeLib library for Due.
Let me know what you think is the best way to get this stuff more universal. I also can do some changes or write up about the code a bit.
Merry Christmas to all!
Re: Arduino Due (ARM CPU at 84 MHz) + emonTx Shield
It would be great to have support for the Due's 12 bit adc in emonlib (1).
I think (2) is best kept separate. Emonlib is single phase and should be as barebones and as easy to follow as possible. However if you could make a three phase example for the due we would be most happy to push this up as a example.
Keep us updated on your progress. Thanks a lot for contributing.
Merry Christmas!
Re: Arduino Due (ARM CPU at 84 MHz) + emonTx Shield
Hi Glyn,
I followed your suggestion and created 2 separate GitHub pull requests. One containing only Arduino Due 12-bit ADC resolution support and the other including 3-phase buffer-delay algorithm. As you mentioned, the second feature can be added only as an example, in order to keep EmonLib clean and not mess it up with 3-phase stuff.
I hope you guys will find these mods useful.
Happy New Year!
Re: Arduino Due (ARM CPU at 84 MHz) + emonTx Shield
Thanks a lot, that's great. I've merged the changes into emonLib and have created a separate github repo for the 3PH examples: https://github.com/openenergymonitor/ArduinoDue_3phase.
Thanks again, this should be most useful to many people going forward as the Due get's more adopted in the future. It's a very nice bit of hardware.
Re: Arduino Due (ARM CPU at 84 MHz) + emonTx Shield
Currently i'm working on my due to interface with a network interface to my Raspberry PI.
i started a blog about it, if i have my code ready i will post it there.
blog.steinor.nl