Skip to content
This repository was archived by the owner on Nov 24, 2021. It is now read-only.

Commit b2c7983

Browse files
committed
MC19 connector: Increase smoothing of distancing function
Matches what the model code does when processing a distancing time series. Increase smoothing factor. Introduce 5-day gradual delay before distancing reaches full effectiveness.
1 parent 2acb1ff commit b2c7983

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/modelingcovid-covidmodel/connector.wl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ translateInput[modelInput_]:=Module[{
116116

117117
(* TODO: These are copied from modules in data.wl,
118118
and should be shared instead. *)
119-
smoothing = 3;
119+
smoothing = 7;
120120
SlowJoin := Fold[Module[{smoother},
121121
smoother=1-Exp[-Range[Length[#2]]/smoothing];
122122
Join[#1, Last[#1](1-smoother)+#2 smoother]]&];
@@ -128,6 +128,14 @@ translateInput[modelInput_]:=Module[{
128128
Assert[Length[fullDistancing] == Length[fullDays]];
129129
Off[Assert];
130130

131+
distancingDelay = 5;
132+
Which[
133+
distancingDelay>0,
134+
smoothedFullDistancing=Join[ConstantArray[1,distancingDelay], smoothedFullDistancing[[;;-distancingDelay-1]]];,
135+
distancingDelay<0,
136+
smoothedFullDistancing=Join[smoothedFullDistancing[[distancingDelay+1;;]], ConstantArray[1,Abs[distancingDelay]]];
137+
];
138+
131139
distancingFunction = Interpolation[
132140
Transpose[{
133141
fullDays,

0 commit comments

Comments
 (0)