In this tutorial we will illustrate how to perform a scenario analysis by running the model multiple times under a specific shock and comparing the results with the unshocked model.
import BeforeIT as Bit
+using Plots, StatsPlots
+
+parameters = Bit.AUSTRIA2010Q1.parameters
+initial_conditions = Bit.AUSTRIA2010Q1.initial_conditions
Dict{String, Any} with 21 entries:
+ "sb_inact" => 2.23847
+ "C_G" => [11482.3; 11556.2; … ; 14578.2; 14714.8;;]
+ "E_CB" => 1.0618e5
+ "D_RoW" => 0.0
+ "sb_other" => 0.590286
+ "L_I" => 236919.0
+ "omega" => 0.85
+ "r_bar" => 0.00164593
+ "N_s" => [123.0; 18.0; … ; 5.0; 60.0;;]
+ "C_E" => [17384.5; 17752.9; … ; 38786.7; 38617.8;;]
+ "D_H" => 219841.0
+ "K_H" => 4.05377e5
+ "L_G" => 2.32611e5
+ "pi" => [-0.00749736; -0.00789543; … ; 0.00530319; 0.00100796;;]
+ "w_UB" => 4.06546
+ "Y" => [1.04531e5; 1.05062e5; … ; 1.35709e5; 1.34636e5;;]
+ "Y_I" => [19804.6; 19944.1; … ; 36883.2; 36575.9;;]
+ "Y_EA" => 2.35485e6
+ "D_I" => 54049.0
+ ⋮ => ⋮
Initialise the model and the data collector
T = 20
+model = Bit.init_model(parameters, initial_conditions, T);
Simulate the model for T quarters
data_vec_baseline = Bit.run_n_sims(model, 4)
BeforeIT.DataVector(BeforeIT.Data[BeforeIT.Data{Float64, Vector{Float64}, Matrix{Float64}}([72422.0, 72482.17886654705, 72839.0439535848, 73050.97018237105, 73291.65320300258, 73601.43782920495, 73993.22299523717, 73985.40928890712, 74088.8102754535, 74065.59371855546 … 74198.85585289636, 74236.87303221022, 74432.82871668038, 74704.63685879551, 74929.71415460567, 74862.89693275974, 75166.5291784729, 75283.84751195589, 75362.52762386456, 75686.7775369771], [72422.0, 72409.15661178499, 72692.35432433043, 72830.40668594724, 72996.74818846468, 73231.43483306852, 73547.08063571894, 73465.22677533976, 73493.78469544792, 73396.73639994458 … 73380.71638587752, 73344.34901048626, 73463.86289674653, 73657.85112104836, 73805.34429622, 73665.24073660452, 73889.50034262643, 73930.26926954759, 73932.97576322588, 74176.27064822474], [64900.92049553803, 64966.370940930254, 65293.83317658212, 65484.50615310138, 65709.21905691604, 65989.10951683734, 66337.69984323585, 66304.65416274894, 66390.03732880189, 66355.9397859308 … 66463.70374835031, 66492.12771646437, 66668.48956091437, 66919.67087204198, 67121.53587777383, 67040.16224245242, 67318.4356354505, 67421.38594211277, 67486.50618702403, 67800.17534998983], [64900.92049553803, 64900.920495538005, 65162.33875186982, 65286.78815424857, 65444.82362640801, 65657.37458130164, 65937.71648347631, 65838.4741146139, 65856.8425005776, 65756.70532724576 … 65730.85445390055, 65692.71606537378, 65800.59983046986, 65981.97061688922, 66114.33289240277, 65967.65411104736, 66174.74063675731, 66209.1721127151, 66206.3545847692, 66447.0640766932], [40512.94792630534, 40453.79241725306, 40552.09958166174, 40633.202552324845, 40672.930775976136, 40812.3506325723, 41031.36813458389, 41202.11979355534, 41300.65335256123, 41370.19874170262 … 41528.4365669332, 41579.52659502329, 41679.322970076166, 41787.32593609307, 41900.79374361453, 42010.00683784348, 42120.49660582642, 42221.83800771901, 42289.15554275522, 42307.43001942751], [40512.94792630534, 40413.03719738821, 40470.432221270385, 40510.51833329994, 40509.27433328998, 40607.182194851506, 40783.96937760581, 40912.43264517685, 40968.95757928121, 40996.60070769617 … 41070.53121827991, 41079.63045470677, 41136.741960429026, 41201.78829548885, 41272.04465442746, 41337.93098917503, 41404.897663934375, 41462.70356958264, 41486.972509660656, 41463.08617801435], [14866.888022051655, 14951.605527970985, 15240.833134977553, 15419.550559059064, 15588.289468712615, 15714.62092007791, 15847.867784707041, 15963.69226091939, 15966.437743567996, 16034.244559470431 … 15978.523100433751, 16032.092557423724, 16187.702013083359, 16231.235230314234, 16085.532311999264, 16287.129442889182, 16317.841535537294, 16326.345847733235, 16385.17086122995, 16405.405212514393], [14866.888022051655, 14936.54251572383, 15210.139813913063, 15372.994161846298, 15525.566572837142, 15635.6216913255, 15752.313018465036, 15851.453460784138, 15838.207328696084, 15889.445587592196 … 15802.338977068632, 15839.344302526266, 15976.97067014789, 16003.7978681967, 15844.158273785486, 16026.568039389422, 16040.612369744948, 16032.803643822705, 16074.360539043559, 16077.996933384387], [15944.236265986641, 15956.927445049878, 16087.118231046683, 16067.791150462303, 15969.742966729815, 16178.179309404464, 16547.34462015482, 16405.54545995725, 16606.098794319674, 16618.31692382491 … 16259.12000482161, 16360.527006955057, 16002.434721195817, 16087.637882176063, 16897.874943280498, 16271.872096242478, 16713.76548936121, 16411.888166807927, 15851.736887991927, 16616.52980435066], [15944.236265986641, 15940.851620076943, 16054.720587132162, 16019.277514201145, 15905.485209182356, 16096.849718664647, 16447.572356239896, 16290.20004312672, 16472.73110316655, 16468.243423574142 … 16079.841933454687, 16163.83009926829, 15794.115186013532, 15862.212652937164, 16644.311167262433, 16011.554779686954, 16429.80984156469, 16116.807940788654, 15551.045275368677, 16284.908039579814], [15944.236265986641, 15954.251914177627, 15998.590693281947, 16036.16592245556, 16069.58157757529, 16135.361579054857, 16198.195167410267, 16233.933783176342, 16250.288412966358, 16248.423387286575 … 16267.093263228597, 16290.503501241079, 16324.41329387179, 16349.109526009188, 16420.572375915865, 16416.22932124981, 16471.669463627844, 16490.73572225061, 16521.293432466224, 16562.386324773164], [15944.236265986641, 15938.178784671356, 15966.37133385592, 15987.747772549299, 16004.92209751652, 16054.24723803005, 16100.5281011657, 16119.794947403394, 16119.778323085948, 16101.690250443422 … 16087.727276255584, 16094.648461730898, 16111.902244850071, 16120.020470813844, 16174.170840220346, 16153.602578635808, 16191.826864674795, 16194.237843719657, 16207.90100109213, 16231.845119930278], [3173.2320350842083, 3170.368545219235, 3162.525474185151, 3169.0110263590927, 3168.2934356007627, 3180.6152661072383, 3182.5707255789484, 3228.8276163141927, 3231.5964824701196, 3240.677902439034 … 3251.281165616078, 3258.4776294574226, 3257.028461662328, 3239.134454420831, 3269.6345037617175, 3271.672817643442, 3293.13112082863, 3288.5306790439554, 3297.650374978906, 3281.33873584027], [3173.2320350842083, 3167.1745537689317, 3156.1565041364634, 3159.442800907272, 3155.545113235889, 3164.625942899345, 3163.381405863347, 3206.1261177150323, 3205.642730963291, 3211.412611721952 … 3215.43153681265, 3219.30208986702, 3214.6284977174487, 3193.7466459512952, 3220.571478159054, 3219.332614653937, 3237.183035324558, 3229.404004149464, 3235.097241771704, 3215.851937140256], [34195.564496956766, 34318.971895810304, 34531.11889516812, 34738.98444398425, 34996.54034378281, 35392.00931817583, 35408.875816981454, 35461.171130001036, 35368.29108902636, 35732.246201974616 … 35748.73288323159, 36092.564132545565, 36313.95895082579, 36014.77604727731, 36523.79296872867, 37288.01739071316, 37156.515583047774, 36319.06768062642, 36960.82364709919, 37482.86132611478], [34195.564496956766, 34284.39720796093, 34461.57711162004, 34634.096694347994, 34855.72410089805, 35214.08956724108, 35195.377894260986, 35211.84790114092, 35084.239585961215, 35409.562305408406 … 35354.55632981316, 35658.635827403574, 35841.224196329706, 35510.12525852227, 35975.72932813845, 36691.48390216225, 36525.251344060955, 35666.063066466115, 36259.71374697531, 36734.80305113291], [33097.63671130043, 33199.11841953696, 33572.12588926933, 33808.5585234597, 33935.85035219865, 34495.7223510254, 34842.233361190025, 35047.11935552575, 35152.670704022064, 35689.41270841742 … 35315.95670252392, 35827.8372597376, 35750.589938501034, 35416.33823706508, 36478.27981301722, 36994.12883492859, 37142.09003529992, 35995.29219093111, 36124.35931521193, 37125.44882543027], [33097.63671130043, 33165.67192936486, 33504.51540960524, 33706.48001774835, 33799.302027742764, 34322.30833901402, 34632.152010852784, 34800.70727488881, 34870.35090165736, 35367.11562432659 … 34926.552072738996, 35397.09167341883, 35285.1891161739, 34920.07295409657, 35930.89912739377, 36402.29697380909, 36511.07087667865, 35348.10895111287, 35439.11630782254, 36384.523553886786], [29576.14777688488, 29605.9743499166, 29700.1802890915, 29759.22512223044, 29828.56284158422, 29949.047951390814, 30076.00165741326, 30063.989133401345, 30092.77722401472, 30066.61365700711 … 30110.976642808986, 30131.263413413468, 30214.033507788434, 30301.457575438137, 30389.65834479293, 30404.856180484116, 30485.466845177623, 30559.65926965192, 30580.70400295602, 30705.19756473774], [34346.71094688274, 34381.34847608994, 34607.53947989688, 34733.10237382612, 34881.12466510991, 35035.65212053354, 35251.767218226065, 35224.24845702411, 35276.28464668706, 35264.74987007562 … 35317.84570765812, 35327.541594040216, 35419.99602022882, 35578.371485765434, 35690.88552620485, 35603.12862814764, 35783.586894702275, 35828.24030159598, 35863.30940151209, 36043.261861021114], [28335.329312139656, 28363.904560528437, 28550.50748126297, 28654.094283340535, 28776.209625783376, 28903.691594696415, 29081.982100355403, 29059.279688991315, 29102.20847400741, 29092.692520810822 … 29136.495493541766, 29144.49440016298, 29220.767398077405, 29351.423896100856, 29444.245662732916, 29371.84802880201, 29520.722382967433, 29557.56052421475, 29586.491809552084, 29734.948883319743], [978.0617717704339, 979.048114923888, 986.113407593733, 992.1786570447834, 999.5315502219956, 1004.4094449129501, 1009.930967596549, 1016.4165723235664, 1020.9754581000396, 1024.5762588480177 … 1034.881397883193, 1033.3227090107057, 1034.4600328971308, 1039.8418108384253, 1040.9920067761202, 1032.1774338206121, 1049.3818955705717, 1033.486370864788, 1042.49278255596, 1051.7159242310156], [0.0019383188997990075, 0.0028757694938645884, 0.004840000455283988, 0.002607260886745788, 0.002981527532834205, 0.006953111022180769, 0.004830867005468642, 0.0017027529907025496, 0.0015998445659046734, 0.0009756531941349511 … -0.0002630685930093968, 0.003197801497617725, 0.0035813104482096403, 0.0037892853597620846, 0.011051628803043778, 0.008460326601238854, 0.006236460891076989, 0.0021052610258667226, 0.0029557358430265523, 0.006787529926410185], [2.3548476e6, 2.353206718292822e6, 2.3647359776932676e6, 2.3506350187464342e6, 2.359691053608583e6, 2.3609895572258537e6, 2.347646582526366e6, 2.3649291808171156e6, 2.364677571755358e6, 2.34963367731328e6 … 2.363395394269168e6, 2.371311431761232e6, 2.361903181225142e6, 2.3458361211483744e6, 2.3655476778223976e6, 2.3685836706524114e6, 2.356402557359404e6, 2.349390906159332e6, 2.3681004247143464e6, 2.3892173957194597e6], [0.0016459319014481277, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 … 0.009071529145045647, 0.008802768701936865, 0.007843010102694566, 0.0066802217801227885, 0.007265774438542948, 0.007048251354972088, 0.006163717865914008, 0.005463032788688573, 0.005909710932368727, 0.006505058119999496], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.6059091613041 258.50369622511613 … 137.13538556670352 505.4138092341076; … ; 510.6767089583184 260.9976960017441 … 142.21792619459336 528.3770975671101; 505.32893740795964 256.9357957088257 … 142.32411548068052 529.647632916932], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.0834390395163 258.2432663779743 … 136.99722836422478 504.904629508617; … ; 500.9896819636838 256.04683044951753 … 139.52019421269418 518.3543118835423; 495.24391508463845 251.80804021420659 … 139.48370446220207 519.0772740753025]), BeforeIT.Data{Float64, Vector{Float64}, Matrix{Float64}}([72422.0, 72492.86532709548, 72411.64734727719, 72574.97842370647, 72866.35455154335, 73046.54570894543, 72952.09552203688, 73011.55947619377, 73172.70223014345, 73323.64947363971 … 74348.6001350424, 74881.55983894745, 75445.2838746264, 75755.02932713756, 75863.41512367484, 75869.41922859983, 76182.90535750276, 76357.93948247566, 76481.25287306341, 76947.42008306239], [72422.0, 72419.83230624639, 72265.81844664193, 72355.85209377471, 72573.16081925246, 72679.3322200944, 72512.23064373477, 72498.22398352266, 72585.0341406821, 72661.49236241679 … 73528.80954138847, 73981.28497269012, 74463.1379235704, 74693.52514752168, 74725.03446545849, 74655.66069452296, 74888.608973149, 74985.04942790957, 75030.47991207172, 75411.75412013476], [64900.92049553803, 64966.370940930254, 64898.169104874, 65055.19017075315, 65312.06478312069, 65473.53455451669, 65370.6542661932, 65414.05454331101, 65557.02629832865, 65721.85042656456 … 66679.00340739616, 67177.0629946147, 67679.52385004294, 67952.55632119424, 68033.37701479948, 68029.66575787538, 68315.50284696142, 68463.12769464342, 68691.75544217828, 69046.55952228226], [64900.92049553803, 64900.920495538005, 64767.47150303079, 64858.76840977229, 65049.26738979366, 65144.391474336415, 64976.501710635115, 64954.13619397682, 65030.52158794726, 65128.34218011096 … 65943.78015250883, 66369.41660566245, 66798.47248533234, 67000.38293823587, 67012.49125081782, 66941.3275549003, 67154.86834614785, 67232.18369912042, 67388.74146561639, 67668.57373404966], [40512.94792630534, 40553.229999843556, 40470.737342713976, 40465.94107889167, 40629.47140769029, 40758.106005207, 40874.8204990825, 40961.76351512013, 41030.79277104491, 40920.21819992507 … 41258.070209689584, 41359.12124218307, 41722.84871100376, 41913.972979749735, 42126.888984669466, 42160.30266578271, 42321.68502727824, 42493.08903885016, 41942.88489186185, 42444.92028443618], [40512.94792630534, 40512.37460147135, 40389.233836706466, 40343.76187404121, 40465.98983328821, 40553.21026154283, 40628.365646541344, 40673.76628282478, 40701.26431491373, 40550.68376364995 … 40803.14600387016, 40861.87495851982, 41179.70108369644, 41326.66071946169, 41494.74718703491, 41485.82238531991, 41602.668029258646, 41729.07759846001, 41147.27026708452, 41597.83250281045], [14866.888022051655, 14840.46170248162, 14925.813020902166, 15102.131542349092, 15264.601130854004, 14901.259867010596, 14913.707236375854, 15131.499365643624, 15081.838646916049, 15323.970552647243 … 15408.355592553746, 15653.000365095662, 15816.311690385304, 15784.243984186463, 15784.23303316476, 15840.671243284809, 15869.828775942618, 16026.819678831662, 16179.01851859702, 16268.90660913992], [14866.888022051655, 14825.510662209746, 14895.754114860643, 15056.533531424433, 15203.180665880407, 14826.34949895781, 14823.78499395609, 15025.111613656927, 14960.71266641964, 15185.585786661813 … 15238.45831196597, 15464.809803353635, 15610.415102956926, 15563.070009202775, 15547.38018966381, 15587.252275503986, 15600.211045972554, 15738.662854636037, 15872.118700400755, 15944.222479292095], [15944.236265986641, 16263.384591144004, 15989.021267557926, 15965.029967420885, 15904.212613409223, 16327.039662746065, 16143.243654636246, 16070.549082644164, 15996.73857290419, 15743.733298792215 … 16304.645960259551, 16428.977682679382, 16648.14107217999, 16779.808361780262, 16971.534702130244, 16353.264393360467, 16769.982415446488, 16866.1263586755, 18498.715716162053, 17645.081157493598], [15944.236265986641, 16247.000025565505, 15956.821179877315, 15916.826598987402, 15840.218531586796, 16244.961733680728, 16045.90791870246, 15957.558985048396, 15868.264804569324, 15601.557820132482 … 16124.865905668052, 16231.457816402175, 16431.415738177388, 16544.684214018875, 16716.865612771995, 16091.644963301962, 16485.071679840756, 16562.879082834657, 18147.813559543047, 17292.932241813156], [15944.236265986641, 15960.066812414321, 15945.91835318055, 15975.977009536156, 16018.522346354994, 16064.971702229432, 16079.667557364955, 16094.678170684523, 16119.725772689628, 16133.384152791235 … 16319.140050938746, 16429.40905839211, 16539.05424209364, 16626.75018711141, 16687.148008610544, 16710.1420840494, 16760.9780402937, 16806.76692188051, 18123.775927877396, 16900.656242429624], [15944.236265986641, 15943.98782468211, 15913.80506991398, 15927.740588593193, 15954.068314292897, 15984.211219309746, 15982.715153699955, 15981.518424373047, 15990.264263701163, 15987.68989014132 … 16139.200180033544, 16231.884005835225, 16323.748999354275, 16393.770740415795, 16436.746329450332, 16442.81332674021, 16476.220282972914, 16504.586908736546, 17779.986004471226, 16563.36406922066], [3173.2320350842083, 3176.18344345593, 3171.4514088184214, 3173.535535851692, 3162.880353652254, 3174.7192587338623, 3196.9892578924823, 3208.38875416386, 3216.0973815943057, 3196.2142498833487 … 3174.8212933611208, 3196.780297834221, 3206.370831111806, 3239.6594044968174, 3271.9743315383716, 3288.6153892723773, 3287.9796517471555, 3303.1456265125244, 2808.5503997421483, 3316.8924650535564], [3173.2320350842083, 3172.983593779686, 3165.0644629428825, 3163.953649504869, 3150.1538120078394, 3158.7595754414106, 3177.71300159315, 3185.8309587460517, 3190.2681072042637, 3167.350492968011 … 3139.8147346888322, 3158.3465237344767, 3164.6303276948724, 3194.2642402555803, 3222.87619527425, 3236.004139119021, 3232.119086242143, 3243.7561797810104, 2755.275004446374, 3250.696108427495], [34195.564496956766, 33652.39086115777, 33321.671037247856, 32520.888160686412, 33085.92361077033, 33439.63997013184, 33744.16075066415, 33952.444816867064, 34313.93804850163, 33693.111757885716 … 33402.45441808993, 33737.904970842064, 33179.735640821695, 33037.40073883148, 32426.155679259904, 33306.0792710606, 33231.41288938983, 32649.46415516184, 30606.77529662884, 30793.450981122023], [34195.564496956766, 33618.48772114115, 33254.56494544218, 32422.697530478214, 32952.79515265774, 33271.53500719104, 33540.70023241878, 33713.72926124143, 34038.354315767065, 33388.842484467525 … 33034.148654603225, 33332.28591121312, 32747.802174034157, 32574.469904015627, 31939.579793038527, 32773.24880573064, 32666.83350838745, 32062.437777429095, 30026.19534591601, 30178.8955548096], [33097.63671130043, 32816.60182753136, 32295.595321144785, 31479.01232564183, 32017.854211180555, 32379.49979615013, 32723.83661872189, 33104.69730408135, 33250.60580922334, 32357.384335610495 … 32024.926045550532, 32297.44442185288, 31921.75323976437, 31760.39673741041, 31445.397275549483, 31790.89834488893, 32010.003750554355, 31677.559749043594, 30746.14155018635, 30204.938949129246], [33097.63671130043, 32783.5407041414, 32230.555630244602, 31383.967441156703, 31889.02336416075, 32216.72428127811, 32526.52814788399, 32871.942159249, 32983.561960987696, 32065.177492495015 … 31671.80933471913, 31909.14351679868, 31506.196175294444, 31315.359699177247, 30973.538317050738, 31282.30773533366, 31466.17529031027, 31108.00788545033, 30162.917960872684, 29602.128658590427], [29576.14777688488, 29605.9743499166, 29580.392765320783, 29617.45915449418, 29708.859927324145, 29795.847356554033, 29817.51092717103, 29833.011523092515, 29859.170131190713, 29950.78050580078 … 30391.500128699925, 30573.007118579946, 30800.10722249811, 30906.915868734934, 30984.072830394573, 30989.642564856094, 31114.621356791675, 31186.55225305229, 31243.36849021594, 31357.09878286222], [34346.71094688274, 34381.34847608994, 34339.966565483315, 34458.657692795176, 34623.621100746765, 34695.64053186395, 34573.6346612775, 34599.415280848676, 34709.551136837435, 34780.111425205454 … 35295.29958388098, 35601.28356917401, 35869.621615785254, 36033.57854870309, 36036.68452664886, 36029.467657062465, 36185.38395639184, 36259.49240692719, 36426.09612878186, 36659.978853851164], [28335.329312139656, 28363.904560528437, 28329.765336355922, 28427.683072467884, 28563.77448733406, 28623.18903508317, 28522.536704022194, 28543.805184330253, 28634.664997758737, 28692.875782784395 … 29117.89540566362, 29370.325893139623, 29591.69925635523, 29726.960350042486, 29729.522717893822, 29723.568949084653, 29852.196685622814, 29913.334631377762, 30050.779271438954, 30243.727703837863], [978.0617717704339, 979.048114923888, 977.8097740698408, 979.0733234637161, 979.5837550497721, 982.0466660987751, 979.5086777447327, 981.6277393698058, 988.3050303005668, 990.958495558384 … 992.2036948152579, 1002.7723068606733, 1009.7950117595415, 1012.0619037561681, 1012.6196577561012, 1010.5555359568218, 1015.4975337778507, 1017.08303466398, 1022.2908231805474, 1029.481885568886], [0.0019383188997990075, -0.0014918459669912565, 0.0026521490187527696, 0.0032413990059763087, 8.521616312751057e-5, 0.004902764798285553, 0.005599728385178526, 0.006283443753810847, 0.0018715307271266468, 0.0001245336723632029 … 0.001718447932520517, 0.0016173580286817923, 0.006076789545591321, 0.006458400040881607, 0.003698865359134995, 0.0074812381562470165, 0.0037037498963661264, 0.0050653503161945945, 0.00404213704482248, -0.0019250642306022359], [2.3548476e6, 2.3490325492624226e6, 2.3248934009238556e6, 2.3063709436211945e6, 2.313801571417006e6, 2.3284965535996193e6, 2.343405902494831e6, 2.3433704533652845e6, 2.362185751432836e6, 2.3565323549705953e6 … 2.3491784269261286e6, 2.357393415470629e6, 2.34697525301897e6, 2.350284658135234e6, 2.338847052478542e6, 2.3547540193141676e6, 2.3438603995149224e6, 2.3436327216850463e6, 2.3273586737926323e6, 2.3307648881833204e6], [0.0016459319014481277, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 … 0.00832833123300784, 0.008092834849547747, 0.007198459633622645, 0.006952437254172003, 0.006043941877424608, 0.006437135115298709, 0.005590532498493082, 0.00528333316131737, 0.004301944963783674, 0.004083237054661735], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.6059091613041 258.50369622511613 … 137.13538556670352 505.4138092341076; … ; 562.1409711139131 273.2744212986035 … 143.83121784313656 532.823349998427; 564.9090639178729 273.6007774286357 … 143.57975359710517 529.2314839314896], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.0834390395163 258.2432663779743 … 136.99722836422478 504.904629508617; … ; 551.4777184798164 268.0906785321416 … 141.10288333036831 522.7162233481127; 553.6349806455353 268.14043319780717 … 140.71428337956453 518.669430317399]), BeforeIT.Data{Float64, Vector{Float64}, Matrix{Float64}}([72422.0, 72493.21067018014, 72637.81546486475, 72517.54437175755, 72459.74202939455, 72705.15333867463, 73089.03121597746, 73370.79963276038, 73626.1351109501, 74063.82110226499 … 74190.9760584736, 74115.72366267513, 74404.10231097252, 74621.66268317173, 74694.89776768563, 74689.57828260258, 74753.00435665979, 75046.60889688601, 75270.72770260759, 75491.76255898866], [72422.0, 72420.17730141475, 72491.53108711843, 72298.59145301091, 72168.18439161821, 72339.65606901153, 72648.34068349907, 72854.93836575892, 73034.82538975145, 73394.97979145664 … 73372.92347649821, 73224.65617754987, 73435.51045110123, 73576.03960663687, 73574.05148430222, 73494.69483721963, 73483.00102974099, 73697.2961249372, 73842.91719476593, 73985.14765080773], [64900.92049553803, 64966.370940930254, 65104.253192426724, 64985.544069502226, 64917.97692067339, 65152.135505665996, 65522.66069247188, 65774.17037838747, 66002.567355117, 66409.2467816682 … 66489.08148759961, 66408.20423571728, 66672.42095575592, 66870.94316687969, 66933.43791901843, 66910.571195093, 66966.68965440553, 67240.68308716758, 67451.70092356867, 67656.7923554482], [64900.92049553803, 64900.920495538005, 64973.14056044651, 64789.33259166434, 64656.76522615024, 64824.608135919385, 65127.59161371176, 65311.72009793266, 65472.48439419102, 65809.53092841894 … 65755.95237037064, 65609.80156735334, 65804.48004645295, 65933.92570022508, 65929.05746777343, 65840.13626052119, 65828.97058363675, 66031.71823428878, 66172.20954239093, 66306.5426255817], [40512.94792630534, 40540.45158602109, 40549.74854791995, 40581.99279673212, 40631.86829252876, 40639.672357054864, 40652.010753000744, 40833.47122023281, 41000.964469619415, 41133.39499054222 … 41577.857740317835, 41632.60209494286, 41715.67328196085, 41834.02828421975, 41927.164744992544, 42032.112581715985, 42040.44485772693, 42100.78565667974, 42194.760071046774, 42247.7679481293], [40512.94792630534, 40499.60906127663, 40468.08592224572, 40459.46319581449, 40468.377073735755, 40435.37199312723, 40406.8993324906, 40546.3759956316, 40671.67557196271, 40761.93543830708 … 41119.40745856572, 41132.06784641006, 41172.61906431727, 41247.836235080955, 41298.01994150956, 41359.683085483804, 41326.20594125856, 41343.82769907651, 41394.36762574811, 41404.61480306554], [14866.888022051655, 14906.662556858306, 14863.279820548541, 14839.724190257624, 15033.028689854957, 15085.537880098042, 15142.722380254323, 14992.337168195147, 15161.135240873316, 14976.189325754147 … 14588.736235638435, 14851.669838219199, 14895.616853254076, 14850.385794314121, 14934.798170499329, 15058.617058306752, 15319.563257385962, 15298.982839756234, 15419.97901230257, 15447.04326164562], [14866.888022051655, 14891.644822459257, 14833.346849328198, 14794.918468373358, 14972.540007302634, 15009.701125021124, 15051.419290339107, 14886.927848879994, 15039.372409796712, 14840.945235583311 … 14427.876330844669, 14673.113393801486, 14701.705862008968, 14642.297344879413, 14710.691658237287, 14817.70938889602, 15059.294168922375, 15023.91227698274, 15127.477415248106, 15138.761339533577], [15944.236265986641, 15991.798589230666, 16324.260679459829, 16290.41438610593, 15674.460085184131, 15685.33278741133, 16055.050978156332, 16228.948142401348, 15906.351799683729, 16400.913982600116 … 16581.60459175758, 16063.206489212156, 16210.020162142357, 16500.35297850245, 16821.58714857625, 16574.86914981545, 16351.691855318031, 16325.553895979561, 16603.17037284447, 16374.460668910397], [15944.236265986641, 15975.687633283273, 16291.385457368142, 16241.228581369578, 15611.390462965446, 15606.480793511393, 15958.247000229396, 16114.844360069092, 15778.603949904755, 16252.803763017599 … 16398.770705883227, 15870.08416236912, 15998.998281765667, 16269.144650720382, 16569.16812131239, 16309.704488133098, 16073.887595332404, 16032.025931095093, 16288.224817707875, 16047.669960613906], [15944.236265986641, 15958.571038686476, 15982.468895476788, 15966.174562353946, 15956.63410354348, 15980.541023658769, 16047.560610775694, 16086.772397869374, 16139.654432694895, 16230.662610995041 … 16327.637675970753, 16328.072764469132, 16376.25689084014, 16408.595704440457, 16448.753784797496, 16471.70674850294, 16481.078648261737, 16513.48451178404, 16576.654963992998, 16620.668054596834], [15944.236265986641, 15942.493557873233, 15950.282003535433, 15917.967738033982, 15892.42909237735, 15900.20498358912, 15950.801796041298, 15973.66823609568, 16010.032871703554, 16084.089864754522 … 16147.604107631401, 16131.766042815867, 16163.070942391567, 16178.673109510608, 16201.929368445513, 16208.19247832565, 16201.076193582638, 16216.577617673156, 16262.212379672988, 16288.963701351473], [3173.2320350842083, 3174.6876697280836, 3176.114494085487, 3178.640068957601, 3182.5466353549796, 3172.102859436231, 3174.943161566246, 3165.3933380886792, 3175.5239824987507, 3186.387162636102 … 3250.4819347537823, 3263.158991351017, 3253.5876693196033, 3250.7916249396167, 3273.130493140713, 3291.0190886161886, 3288.498645120769, 3271.642305878854, 3286.498377170369, 3280.8483298489887], [3173.2320350842083, 3171.489326970808, 3169.718157281514, 3169.04277044491, 3169.7409621200263, 3156.156329087637, 3155.7998322707076, 3143.137838269713, 3150.0205631229874, 3157.612150290226 … 3214.641118516322, 3223.9271693800006, 3211.2324975750503, 3205.2404723946074, 3224.0150079080263, 3238.3693840945225, 3232.629262267009, 3212.819278250306, 3224.1567862205834, 3215.371318348979], [34195.564496956766, 34183.05626415927, 34115.91625511567, 33964.35733977123, 34814.0143564949, 35573.916459394975, 35873.40003297838, 37125.101790396395, 37708.45970253996, 38433.999352149855 … 36907.14112443652, 36263.37917182344, 36914.06782619334, 36631.903534024095, 35083.46861956182, 34667.22284954367, 34226.95813085843, 34550.07643243304, 33227.925217324795, 33897.91643387825], [34195.564496956766, 34148.618504669874, 34047.21064291237, 33861.808429196266, 34673.9325468857, 35395.082240085045, 35657.10126010738, 36864.0796652048, 37405.61372590487, 38086.91698286725 … 36500.19160450597, 35827.39721706511, 36433.520860358716, 36118.60535363909, 34557.01799728857, 34112.61681704489, 33645.465104984825, 33928.87768558304, 32597.624671187932, 33221.4041294312], [33097.63671130043, 33128.75832608901, 33215.3898381792, 33158.944341109585, 33693.62939466824, 34279.30614528483, 34634.15292841233, 35809.05868846508, 36150.77610176622, 36880.676548781455 … 35464.36363367693, 34695.13393152279, 35331.27581257821, 35195.00790788862, 34072.120915944244, 33643.24335677952, 33185.65374462965, 33228.78992796251, 32175.10697091108, 32475.42575357504], [33097.63671130043, 33095.382720274276, 33148.49778473593, 33058.82722174295, 33558.05569927144, 34106.98008273349, 34425.3261996675, 35557.289504026325, 35860.440267817576, 36547.621628318666 … 35073.322623301545, 34278.00644209619, 34871.33361734948, 34701.84397768292, 33560.84623404555, 33105.018942338414, 32621.851780757184, 32631.347467800086, 31564.77733512617, 31827.302581836593], [29576.14777688488, 29605.974349916607, 29646.55797299034, 29614.507616816798, 29585.113728472665, 29660.294096255704, 29808.24392748019, 29932.628433629954, 30068.321450524756, 30247.03783265163 … 30373.84817775491, 30347.044612647773, 30446.575281053178, 30535.820637909732, 30581.003908484465, 30568.771780419644, 30576.583509341584, 30653.491110483224, 30777.2570577481, 30866.17021169638], [34346.71094688274, 34381.34847608993, 34475.81438704004, 34389.34740672071, 34351.20637478182, 34503.68368160199, 34718.58384636735, 34843.99509565575, 34928.971632208995, 35154.59599048846 … 35103.935700676215, 35053.520427019495, 35218.46883982837, 35324.356361380516, 35342.09652592103, 35336.168662859825, 35383.58471151613, 35577.24912534347, 35664.02173307526, 35782.99128544135], [28335.329312139656, 28363.90456052843, 28441.836991953438, 28370.50351359612, 28339.03794759288, 28464.82858612184, 28642.1167971321, 28745.578495503432, 28815.682388442845, 29001.81783828478 … 28960.02414231492, 28918.432579628352, 29054.511623810555, 29141.866648804553, 29156.50191927002, 29151.611554302723, 29190.728818119762, 29350.497971862802, 29422.083586542343, 29520.231017591115], [978.0617717704339, 979.048114923888, 981.8808323963707, 981.6890459646843, 981.6568174190116, 988.1577278083281, 995.8329186244138, 997.5468491017878, 1005.2742723833555, 1007.6129585280754 … 1011.2976091684184, 1007.6391960500254, 1007.3768348743966, 1010.7661675895089, 1010.337484612978, 1005.6307518135696, 1006.5214335477881, 1009.9428513408525, 1010.4221327453922, 1007.6308583104221], [0.0019383188997990075, 0.0028001962728712027, 0.004639789987721965, 0.004766281900883795, 0.004145681865324713, 0.0008020808958211223, -0.0013943203459108044, 0.0030581559948150705, 0.0028310602253101003, 0.0019265699746104925 … 0.007879111554595308, 0.005738062625104234, 0.0046139282837207585, 0.004980752515217235, 0.0006289418425802218, 0.006668144677792975, 0.00029997867239828224, 0.0005046580306404813, 0.00031414907465920905, 0.0037269009940421594], [2.3548476e6, 2.3500013569659297e6, 2.3590273571437416e6, 2.336228250617363e6, 2.3438750992351933e6, 2.3532095058126734e6, 2.3670418168053897e6, 2.386993018439447e6, 2.421304304530047e6, 2.42862770734554e6 … 2.399199004189855e6, 2.4121454330710457e6, 2.415937009594518e6, 2.395750918679608e6, 2.377352977397641e6, 2.377675540129703e6, 2.3719676677463413e6, 2.367829929416522e6, 2.347283891041789e6, 2.3538703817790565e6], [0.0016459319014481277, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 … 0.0077117717638754465, 0.007803286877333249, 0.0074860745294011, 0.006224320056019584, 0.0050226013733591654, 0.004817128843144178, 0.004231261730649724, 0.003758006754440738, 0.0026335140316750784, 0.0028000702243317337], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.6059091613041 258.50369622511613 … 137.13538556670352 505.4138092341076; … ; 544.1503966143626 268.4128144020753 … 142.22257463758484 526.7315919943813; 552.1214222892544 271.0461381178151 … 142.71065764872407 528.3752801524754], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.0834390395163 258.2432663779743 … 136.99722836422478 504.904629508617; … ; 533.8284072056533 263.32129146161907 … 139.52475447936666 516.740019907644; 541.1025463516698 265.6367776968807 … 139.86253227608017 517.8303140898544]), BeforeIT.Data{Float64, Vector{Float64}, Matrix{Float64}}([72422.0, 72473.08240803085, 72688.31232776617, 72787.50637216559, 72876.78310092208, 72989.90856240073, 73156.47875946779, 73331.79809075437, 73697.70542156357, 74062.57121299798 … 74371.49233020113, 74837.05059783481, 75083.71183121356, 75372.45300516208, 75750.14873709856, 76032.90032215878, 76328.9847504125, 76869.13144085965, 77454.82782202146, 78313.60296969615], [72422.0, 72400.06931750641, 72541.92625502634, 72567.73835455625, 72583.54740707944, 72622.97979507862, 72715.38155182399, 72816.21103890339, 73105.820901479, 73393.74118944923 … 73551.44932014383, 73937.31085065362, 74106.27282140355, 74316.30960975353, 74613.46771583542, 74816.52641848459, 75032.20657530606, 75487.05032691782, 75985.58711686573, 76750.67162794463], [64900.92049553803, 64966.370940930254, 65156.21679580696, 65238.92832428955, 65318.07668209287, 65418.888482808514, 65559.59623877505, 65716.75988732421, 66051.45419668323, 66384.67833254772 … 66664.9325346701, 67083.89891000389, 67300.20153691815, 67568.44152327876, 67917.61883488824, 68170.84362063029, 68448.30092930717, 68961.13040251374, 69532.62533050166, 70322.52056721384], [64900.92049553803, 64900.920495538005, 65024.99951498312, 65041.95180093567, 65055.25509857409, 65090.02011479215, 65164.304457027894, 65254.71325312643, 65520.97861342781, 65785.18434732346 … 65929.86442956504, 66277.37260033448, 66424.08818628712, 66621.65048215432, 66898.47009886481, 67080.24685501639, 67285.4102782853, 67721.23248590049, 68213.66089220141, 68919.0699882896], [40512.94792630534, 40382.01764340552, 40537.1127964366, 40624.50351353848, 40680.81357800924, 40742.759073421905, 40902.106177441296, 40977.94032904613, 41077.7585382146, 41255.19746706006 … 41429.06173601948, 41665.82090705613, 41787.85225485594, 41859.541365930876, 42005.036233628896, 42190.932571396326, 42253.88593043669, 42414.11847458943, 42361.27167641441, 42687.40616207688], [40512.94792630534, 40341.33473311941, 40455.47561774244, 40501.84555960501, 40517.12541714307, 40537.94048057045, 40655.48680582087, 40689.82935951793, 40747.85288837836, 40882.63796444641 … 40972.25212489837, 41164.88728033597, 41243.85841206495, 41272.99181916966, 41374.7229170182, 41515.96227387937, 41536.020793527096, 41651.526898368495, 41557.72067230962, 41835.479006910675], [14866.888022051655, 14865.476413719154, 14927.795362233768, 14944.603623122957, 14963.37907245138, 14949.056945082033, 15042.286480841081, 15106.69493788467, 15388.59224839214, 15393.867313471173 … 15445.124387610867, 15497.34863762859, 15652.213175201903, 15752.454067918434, 15608.377142636611, 15810.948553430759, 15763.878107132796, 15829.709000021618, 16053.27653901559, 16342.410388347007], [14866.888022051655, 14850.500172347562, 14897.732463980112, 14899.481237758953, 14903.170640385102, 14873.906295553592, 14951.588969481974, 15000.48158284604, 15265.002653768863, 15254.851337261478 … 15274.821682949627, 15311.029422295931, 15448.452820603334, 15531.725543610359, 15374.163132941047, 15558.005089072029, 15496.060407851051, 15545.096159495943, 15748.761920553829, 16016.259318454366], [15944.236265986641, 15979.17424790053, 16136.88125005026, 15942.430233127501, 16061.265315654171, 16063.651863256016, 16068.351621530452, 16223.13827461152, 16033.304034447669, 16213.500575228754 … 16092.675196780378, 16596.056417214957, 16616.92158637164, 16274.489790414453, 16562.802983670263, 16759.59210275974, 16459.71666465813, 16675.861227739242, 16860.567230641504, 17032.86074522988], [15944.236265986641, 15963.076010360384, 16104.383389021237, 15894.295100289004, 15996.63929789615, 15982.898015320508, 15971.467447334457, 16109.075340760846, 15904.536599837384, 16067.082812600021 … 15915.23239719729, 16396.52782160963, 16400.602667323183, 16046.446331292682, 16314.267183749953, 16491.472244334705, 16180.077135730056, 16376.034854921374, 16540.739114256074, 16692.930121571673], [15944.236265986641, 15944.784534144908, 15988.47236091835, 16003.21514653341, 16028.174639235673, 16049.994001642048, 16072.328805826714, 16108.940973865487, 16148.850896983942, 16220.912885824575 … 16315.323071597979, 16387.436990728573, 16439.465361069062, 16489.930471775875, 16558.777415994427, 16628.848946547725, 16678.5419208122, 16770.95845643487, 16889.738423817435, 17033.661112140697], [15944.236265986641, 15928.72094256158, 15956.273378673879, 15954.896485221612, 15963.681769059727, 15969.308813366824, 15975.4206511861, 15995.680947500434, 16019.155476910768, 16074.428185526933 … 16135.425287884173, 16190.416553696366, 16225.456565387094, 16258.868187557531, 16310.302022376325, 16362.820716386592, 16395.184697783116, 16469.422267448863, 16569.356959039953, 16693.71451528649], [3173.2320350842083, 3160.901165186518, 3174.2494242925304, 3175.4072805464366, 3180.2072358368528, 3187.398147593426, 3189.3327749865575, 3196.697898695028, 3187.698981449004, 3191.375498174952 … 3228.7013414819853, 3222.068092008085, 3233.1672615395046, 3251.3229718346133, 3249.748837854033, 3269.524834981077, 3290.304454287341, 3258.260238741073, 3261.6152941902974, 3259.0892891998997], [3173.2320350842083, 3157.7167116591554, 3167.8568435290217, 3165.8197428228696, 3167.410975688095, 3171.3747260506907, 3170.1026834738254, 3174.2223002758237, 3162.0977816420855, 3162.5554381279026 … 3193.100684782915, 3183.330291582424, 3191.077922459234, 3205.7643738836077, 3200.9842098045137, 3217.2189954059054, 3234.4043919489377, 3199.6778161760917, 3199.745710466032, 3194.046530311276], [34195.564496956766, 34987.06516117056, 34910.16284200992, 34907.915392470946, 35440.371233745595, 35918.24176574239, 36263.756080091145, 36654.469352673485, 37420.44820765918, 37578.629490051375 … 37800.2783724629, 38353.33160088899, 39463.82450242239, 39575.03662871733, 40779.84327084543, 40955.44374431572, 40831.77966283877, 40322.11262761112, 41087.1086137378, 41338.19450272681], [34195.564496956766, 34951.81740198986, 34839.85770665196, 34802.5175879982, 35297.769140094235, 35737.67658303345, 36045.103654265666, 36396.756187542655, 37119.91532265217, 37239.27163040486 … 37383.48084579862, 37892.22287730254, 38950.08482967317, 39020.49830746078, 40167.91478398625, 40300.23878997484, 40138.075156082115, 39597.134612479895, 40307.72721002244, 40513.19402580159], [33097.63671130043, 33740.651058164905, 33823.639922964554, 33631.946390094505, 34269.04609893859, 34683.80108510159, 35120.021600435815, 35630.44480346162, 36222.397607149884, 36378.623632813484 … 36395.647362672644, 37275.50696495404, 38437.09968763846, 38089.06884781908, 39205.91089368253, 39684.0166497439, 38980.275614654216, 38372.66988910202, 38907.396237787936, 39087.26882868451], [33097.63671130043, 33706.65900031096, 33755.52292236948, 33530.401131094986, 34131.157088439424, 34509.44157939929, 34908.265325078704, 35379.931431764184, 35931.48656315764, 36050.10255526364 … 35994.33773070026, 36827.356550890676, 37936.72590826125, 37555.35239178005, 38617.60030185986, 39049.15197877654, 38318.026917884534, 37682.74219834813, 38169.361800276354, 38307.1908447938], [29576.14777688488, 29605.974349916607, 29689.848435640095, 29708.439520838856, 29758.593446408406, 29802.550862637414, 29860.090416021587, 29924.394944487038, 30025.1358390048, 30192.643059682778 … 30357.060992572497, 30518.188529514224, 30607.955210286884, 30692.87638993081, 30859.39920689589, 31008.865196777162, 31070.422578197005, 31365.107490428625, 31601.412126490657, 31926.045373183937], [34346.71094688274, 34381.34847608993, 34481.959151476505, 34543.5224200141, 34572.00673726998, 34625.29394218871, 34703.21031703504, 34791.606086886466, 35015.76386705232, 35183.46875313509 … 35285.06865827084, 35538.99443510406, 35666.441236150335, 35831.8576951793, 36015.42342136187, 36107.12886767698, 36311.842051811436, 36530.88998996867, 36862.14816879667, 37315.49016649347], [28335.329312139656, 28363.90456052843, 28446.9062960892, 28497.694725008707, 28521.19370023591, 28565.154547078877, 28629.433951982977, 28702.35864198936, 28887.284195085274, 29025.63727296103 … 29109.455102696043, 29318.938640101926, 29424.079626760293, 29560.54479943672, 29711.982743810757, 29787.637848751485, 29956.5220104972, 30137.232049150658, 30410.513225882463, 30784.511039403173], [978.0617717704339, 979.048114923888, 984.4092086902994, 986.9663834364895, 987.4764984145465, 991.0436779823712, 996.2955057185505, 1000.7588559506479, 1010.554490626144, 1008.5665197298969 … 1022.8028838268273, 1026.7159453856495, 1025.8050904809609, 1043.7074381686662, 1042.7962066304337, 1054.8495561761802, 1066.0362992986668, 1065.132922116448, 1069.065035214339, 1080.9850275364875], [0.0019383188997990075, -0.0010966239857789217, 0.005034610906163861, 0.0046931566426751115, 0.007662838971689068, 0.007354731635004885, 0.007159301599102719, 0.006178315684742364, 0.00514430395095733, 0.00569318439038069 … 0.000284840309280332, 0.003968614841699303, 0.005664244878882174, 0.003785026615288567, 0.005538883601115652, 0.010967038633766357, 0.004929123960702109, 0.00446281875744714, 0.007805947768631638, 0.004094742311523403], [2.3548476e6, 2.388217344705752e6, 2.391375014207863e6, 2.387101917811078e6, 2.392834983948073e6, 2.4028668465258605e6, 2.4086179386390327e6, 2.4122047514408682e6, 2.4076610082386383e6, 2.3939208835630305e6 … 2.394862944005712e6, 2.4033291911417386e6, 2.433928627535058e6, 2.43652023094345e6, 2.466712101232102e6, 2.4837019691385105e6, 2.489950845407035e6, 2.471172055209411e6, 2.492269643098401e6, 2.501505882408428e6], [0.0016459319014481277, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 … 0.008593354950531191, 0.008395952829924155, 0.00915668611469525, 0.008670378670629149, 0.009374405896761584, 0.009609530621748408, 0.009258689486092797, 0.007933838526850772, 0.008365348820006273, 0.008204519513926973], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.6059091613041 258.50369622511613 … 137.13538556670352 505.4138092341076; … ; 529.145001003365 272.9172401696278 … 145.56974071343322 533.1294358532392; 534.785664905957 276.3106551234936 … 146.43802109527303 535.8076977314864], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.0834390395163 258.2432663779743 … 136.99722836422478 504.904629508617; … ; 519.1076489587603 267.74027277235496 … 142.80842815862906 523.0165030600481; 524.1127646037661 270.79622893728566 … 143.51550745632798 525.1144003708694])])
Now, apply a shock to the model and simulate it again. A shock is simply a function that takes the model and changes some of its parameters for a specific time period.
In this case, let's define an interest rate shock that sets the interest rate for a number of epochs.
We do this by first defining a "struct" with some useful attributes
struct CustomShock
+ rate::Float64 # target rate for the first 10 epochs
+ final_time::Int # number of epochs for the shock
+end
and then by making the struct a callable function that changes the interest rate in the model, this is done in Julia using the syntax below
function (s::CustomShock)(model::Bit.Model)
+ if model.agg.t <= s.final_time
+ model.cb.r_bar = s.rate
+ end
+end
Now we define a specific shock with a rate of 0.01 for the first 10 epochs, and run a shocked simulation
custom_shock = CustomShock(0.0, 10)
+data_vec_shocked = Bit.run_n_sims(model, 4; shock = custom_shock)
BeforeIT.DataVector(BeforeIT.Data[BeforeIT.Data{Float64, Vector{Float64}, Matrix{Float64}}([72422.0, 72494.22429199198, 72639.65579159373, 72343.74956504868, 72274.86918974877, 72037.16618255888, 72189.34543105954, 72105.9574369717, 72124.23892499406, 72305.64880083727 … 72594.30539324938, 72781.9948010103, 72800.28578589183, 72711.78282043048, 72893.43006417378, 73113.74250919904, 73073.24648886012, 73149.05656704007, 73303.94916740926, 73853.15880066802], [72422.0, 72421.18990205211, 72493.36770763666, 72125.3213866324, 71984.0554283224, 71675.02696209207, 71754.07955671418, 71598.98912331036, 71544.99130394014, 71652.6848542968 … 71793.85819442988, 71906.96227262268, 71852.57239350557, 71692.92160346854, 71799.6159937039, 71944.06927548774, 71831.78111969684, 71833.86114738243, 71913.44648353472, 72379.2460677583], [64900.92049553803, 64966.370940930254, 65099.2300619872, 64822.134430350314, 64746.67986034948, 64514.85463828205, 64661.55137358504, 64574.454185807364, 64581.819407386894, 64752.34652541611 … 65009.74763400128, 65179.77926367338, 65191.76637306494, 65098.19903324595, 65263.10506174453, 65473.63356913696, 65425.57348966248, 65487.23618648827, 65630.59115590756, 66167.35126715523], [64900.92049553803, 64900.920495538005, 64968.12754602578, 64626.41633680656, 64486.157417055634, 64190.53095364365, 64271.67435604055, 64120.43896559759, 64063.14682501183, 64167.59348832696 … 64292.930108057466, 64396.14552012495, 64343.100610312664, 64186.02183559913, 64283.78905841963, 64426.18675446998, 64314.03694725025, 64309.79771878128, 64385.64440770239, 64846.826822171206], [40512.94792630534, 40547.878858604716, 40606.391984738504, 40613.38624010631, 40662.82264372573, 40649.93565363885, 40668.33224467279, 40713.82823546347, 40755.564187109616, 40815.38126628746 … 40964.038159167925, 41063.822057523364, 41124.26159094874, 41172.15200550473, 41213.093210075785, 41302.282090495806, 41377.82941214415, 41490.35118494688, 41499.280838636805, 41486.66139526196], [40512.94792630534, 40507.02885124591, 40524.615285563355, 40490.761852663396, 40499.20687332295, 40445.58369492457, 40423.12241367971, 40427.5742062972, 40428.246159883725, 40446.79357122922 … 40512.35604141472, 40570.126052921005, 40588.90636478428, 40595.23438266398, 40594.66352167895, 40641.528418279355, 40674.84788696789, 40744.36863371033, 40712.08093958092, 40658.697913815835], [14866.888022051655, 14902.05541785343, 14476.464686311781, 14655.879951271934, 14415.650723252658, 14735.36648995271, 14536.074691378337, 14626.709680822614, 14622.187872827179, 14663.434135499328 … 14769.00669643684, 14710.115611975272, 14730.787890641524, 14891.010530690988, 14750.257881463203, 14555.525704164704, 14489.978807790732, 14495.080260637518, 14965.407873852491, 14772.967925434414], [14866.888022051655, 14887.042324921897, 14447.310717197346, 14611.62931206553, 14357.64619612951, 14661.2900872186, 14448.42938551894, 14523.871044392587, 14504.753461508833, 14531.01441474797 … 14606.159073948103, 14533.261024628351, 14539.022641183263, 14682.352834199566, 14528.920518142546, 14322.666487354465, 14243.80380183251, 14234.463595692729, 14681.529037170123, 14478.138755203054], [15944.236265986641, 16061.711603414118, 16583.77452727122, 16338.710583309317, 16471.52453522221, 15823.555241134922, 16137.41695536143, 16192.379242102686, 15536.77943821899, 15928.605820376099 … 15915.527924434024, 16048.118523966894, 16523.20329468072, 15847.587955415882, 15599.283928017128, 16344.993882636585, 16092.92330703401, 15925.918755245404, 15455.28469715534, 16251.008887522994], [15944.236265986641, 16045.530213519889, 16550.376673524093, 16289.378957400548, 16405.247749664264, 15744.008386869235, 16040.116351528392, 16078.532571309806, 15411.999715582482, 15784.760830505258 … 15740.038405306612, 15855.177594465264, 16308.104399416112, 15625.526384046563, 15365.206368013476, 16083.506764161031, 15819.515350849535, 15639.576095698696, 15162.113386529794, 15926.681948622527], [15944.236265986641, 15955.363901602377, 15981.03885560566, 15942.607327627647, 15933.605001830649, 15894.898772696284, 15909.928895558853, 15912.491516262962, 15915.534190801896, 15954.038236353896 … 16003.061347550276, 16038.696391901116, 16043.584819287542, 16036.549528047948, 16070.228412821385, 16119.671753286573, 16124.953711445492, 16139.556215735995, 16184.531023587893, 16262.35416155696], [15944.236265986641, 15939.289651823092, 15948.854843603509, 15894.471660086027, 15869.492653297692, 15814.993266192121, 15813.999931663284, 15800.612702404893, 15787.712594966219, 15809.963576312295 … 15826.606657904917, 15845.868741405744, 15834.729592539607, 15811.840165490144, 15829.084019724056, 15861.789336945236, 15851.001580207248, 15849.372426546732, 15877.5266386788, 15937.800801144824], [3173.2320350842083, 3171.4805326439855, 3178.6462614622606, 3181.1036106792367, 3184.9725191101725, 3183.961786115381, 3186.716761843251, 3186.9235749152567, 3192.43969508416, 3196.920539921093 … 3208.564294297658, 3216.179619787836, 3220.282417327289, 3224.8688471586147, 3227.8790127819398, 3235.432524196527, 3241.453324264483, 3242.694036363415, 3253.2050465471284, 3246.7650786202166], [3173.2320350842083, 3168.285420920667, 3172.244825963993, 3171.4988739713467, 3172.157084800761, 3167.9556395618406, 3167.5024435895994, 3164.5166985908672, 3166.800421432217, 3168.0504047775266 … 3173.18567489093, 3177.512614409024, 3178.360813020083, 3179.680933030946, 3179.4425559044575, 3183.6720932138664, 3186.383209808202, 3184.3914888785034, 3191.494996818612, 3181.9682782144087], [34195.564496956766, 34294.92761251877, 34886.405395619586, 33503.02904586499, 33218.29681433466, 33862.82681885166, 32543.98834654128, 32777.426547845425, 33820.93699374296, 33811.757926186154 … 35084.321145253205, 34720.53560326554, 33928.31788414611, 33492.8403760607, 34981.814052192414, 34827.47629606579, 35585.816358942335, 35168.30916475029, 36098.59354926667, 34707.80875079491], [34195.564496956766, 34260.37714811033, 34816.148105082386, 33401.87302824205, 33084.63572365325, 33692.59444635797, 32347.764271398853, 32546.972404335283, 33549.31267454818, 33506.417205770704 … 34697.47060055721, 34303.10271840222, 33486.63938120018, 33023.52777249899, 34456.888823853464, 34270.30652984716, 34981.23724461813, 34535.994801431174, 35413.839292716155, 34015.13314856013], [33097.63671130043, 33312.3492003991, 33913.380802347325, 32767.256255503995, 32493.425526786486, 33034.51802101924, 31696.466806894132, 32204.386269262523, 32611.2295669045, 32913.53034751177 … 34138.588532042544, 33760.5969957209, 33506.284874525285, 32691.808047241724, 33651.01900757474, 33916.53546416394, 34473.301397051306, 33930.6027985402, 34714.617791502176, 33365.28815834625], [33097.63671130043, 33278.78863574611, 33845.08307373043, 32668.321763739114, 32362.681114447707, 32868.449653278214, 31505.352865411704, 31977.961103024438, 32349.32070758301, 32616.30116795639 … 33762.16592679682, 33354.70511779417, 33070.10039307842, 32233.71976994061, 33146.06323798443, 33373.93892415429, 33887.623164571385, 33320.54197915065, 34056.11617246228, 32699.40569844331], [29576.14777688488, 29605.974349916607, 29637.883493849557, 29604.73340802252, 29545.609061171283, 29473.21093590308, 29489.3162408985, 29484.249196502886, 29475.742421040042, 29567.69458782411 … 29674.83892264823, 29739.150004882562, 29740.92127856374, 29705.064236251, 29755.443591175444, 29876.699873721467, 29896.914233865173, 29942.291094389082, 30022.415481515225, 30188.244195662584], [34346.71094688274, 34381.34847608993, 34478.26263313867, 34237.8711541343, 34226.83269132769, 34069.34456533071, 34200.95770548395, 34123.19832008551, 34136.04739313104, 34216.546017732566 … 34354.647534825985, 34459.61050363597, 34462.30039181203, 34407.75350353568, 34521.279196762116, 34607.786311249816, 34542.930726003666, 34556.44567484292, 34625.048169258895, 34980.259205226605], [28335.329312139656, 28363.90456052843, 28443.856744573975, 28245.53872419773, 28236.432219670736, 28106.50775849664, 28215.085889130867, 28150.935997288765, 28161.536217981342, 28227.945925763433 … 28341.876833773804, 28428.4691217926, 28430.68822415146, 28385.68816447608, 28479.344523826898, 28550.711112046738, 28497.20658963342, 28508.35614414504, 28564.95178947239, 28857.993580140992], [978.0617717704339, 979.048114923888, 983.0839349989463, 979.5298681933688, 974.238107850642, 972.2991370482622, 971.2774272027543, 967.0066692188651, 970.029593215935, 968.1059198595218 … 980.2611765272447, 981.018755154745, 988.5447026893529, 985.381293459448, 986.382273806906, 989.1473841656193, 985.7285297936124, 988.4994172562356, 983.1275051333271, 998.8478662661631], [0.0019383188997990075, 0.005992644768245681, 0.0028450880695705116, 0.00513776828917778, -0.0006440601839001747, -5.2224861218919116e-5, 0.003383313257263154, 0.0052057098079996145, 0.007305272013854003, 0.003641715694780112 … 0.0007159268474499214, 0.0007105605961836847, 0.0018226669511984817, 0.004163807918107887, 0.008193174008706894, 0.008970367576934368, 0.005016031165023804, 0.009182586884939115, 0.0037627373960518185, 0.0007920038684929853], [2.3548476e6, 2.3539041283079553e6, 2.3635475526658623e6, 2.344548536930319e6, 2.3390730348351547e6, 2.35028102207495e6, 2.336292584467572e6, 2.338711839508945e6, 2.3556917127460763e6, 2.345751870091509e6 … 2.36667514605156e6, 2.3661590354055343e6, 2.340002483462181e6, 2.316304032038639e6, 2.341079890350138e6, 2.344760393757883e6, 2.368048289280749e6, 2.3518045761133716e6, 2.374870905189692e6, 2.3536878146353997e6], [0.0016459319014481277, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.00069674717768027, 0.0006400210076557496, 0.0, 0.0, 0.0012401034671212308, 0.001508782504343226, 0.0024890903252415384, 0.001840833986772618, 0.002755605719851436, 0.0016924353574704286], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.6059091613041 258.50369622511613 … 137.13538556670352 505.4138092341076; … ; 530.9144614856583 260.56518412393336 … 139.57811333112866 515.7127525645492; 524.5282370399358 260.34220895080693 … 139.81361423078772 517.0950435355169], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.0834390395163 258.2432663779743 … 136.99722836422478 504.904629508617; … ; 520.8435445434123 255.62252288993767 … 136.93045596203086 505.9301968537844; 514.0600477316015 255.14647050281297 … 137.02330614382973 506.7752010105868]), BeforeIT.Data{Float64, Vector{Float64}, Matrix{Float64}}([72422.0, 72489.63243506457, 72639.80775741568, 73119.0957965048, 73570.48554243422, 73866.98663591684, 73947.04860542322, 74279.32326441993, 74795.94698304134, 75328.63701685522 … 76161.16773738473, 76480.47095843081, 77121.91487193703, 77447.435912293, 77442.32326831117, 77562.48794294379, 77377.6123618132, 77398.33854814699, 77717.38302513803, 77924.65019211851], [72422.0, 72416.60267119629, 72493.5193674166, 72898.32660775942, 73274.45858492571, 73495.64869501586, 73501.18465452673, 73757.0742770434, 74195.24221304759, 74648.37364974897 … 75321.39121436492, 75560.97294167649, 76117.94255532397, 76362.21717960152, 76280.25005038064, 76321.64370527645, 76063.01870802896, 76006.74246851382, 76243.16191007564, 76369.48131389111], [64900.92049553803, 64966.370940930254, 65105.16513528094, 65565.6280625206, 65968.56975749183, 66230.93312777471, 66302.84360497011, 66633.43272795463, 67114.34269972947, 67603.7850466545 … 68362.26104887057, 68654.363467913, 69246.22514634517, 69537.63993619793, 69512.33799040977, 69615.43759618487, 69428.82367966507, 69441.15107585872, 69735.32361829883, 69926.96243699433], [64900.92049553803, 64900.920495538005, 64974.05066675051, 65367.66513150695, 65703.1307726528, 65897.98251679554, 65903.07041100365, 66164.94107727386, 66575.33079573065, 66993.2817869888 … 67608.47767612414, 67828.95601083044, 68344.77847982598, 68563.25584462674, 68469.25944000884, 68501.73022442727, 68249.27460580354, 68192.62254908336, 68412.51419597754, 68531.40614687461], [40512.94792630534, 40526.81634189347, 40511.772451640914, 40516.16515742793, 40710.37406893874, 40938.33541195812, 40991.944569192754, 40904.06445775153, 41038.37277843807, 41216.62874910341 … 41591.64466001473, 41719.782856917875, 41888.08449829705, 42079.321544333805, 42249.88102030911, 42366.54368776432, 42459.37903170505, 42462.76360345537, 42601.042135198484, 42677.82815701697], [40512.94792630534, 40485.98755399146, 40430.18630554661, 40393.83431053437, 40546.5669649648, 40732.53363408517, 40744.78351672028, 40616.472900588305, 40708.78344539065, 40844.417545449745 … 41133.042359434214, 41218.200464502865, 41342.7858331631, 41489.69236602794, 41615.893645933116, 41688.76396461372, 41738.02270504944, 41699.29740418809, 41792.942925024894, 41826.09215337125], [14866.888022051655, 14921.217258112823, 15169.891951974558, 15538.593280021787, 15744.056203397215, 15762.726308975705, 15816.346893395823, 16091.814240346657, 16365.097999986123, 16602.486931502597 … 16787.108605492882, 16924.442543604528, 17404.590164203502, 17126.776662088807, 17128.24270273146, 16862.29001048266, 16946.273479440875, 17017.392100755893, 17141.203339016603, 17162.337975302205], [14866.888022051655, 14906.184860563206, 15139.341498461172, 15491.677455977391, 15680.706545958208, 15683.485248833227, 15720.982182462356, 15978.674629984896, 16233.665845885092, 16452.55638570188 … 16602.008768987125, 16720.96587618213, 17178.017383485167, 16886.790681334434, 16871.22210630517, 16592.527191518242, 16658.367677085575, 16711.4251177791, 16816.051836015235, 16819.823330308547], [15944.236265986641, 16168.953447088343, 15766.400113630727, 16047.093131311662, 16222.86824990956, 16263.582046834154, 16076.007560376893, 16241.547999767618, 16327.47273518438, 16386.107764330747 … 16600.082499461787, 16717.121394035403, 16787.444786966407, 17242.14999125699, 16942.870672521673, 17535.663996680396, 17020.405473534553, 16596.65834565823, 16859.344060488165, 17000.523317848205], [15944.236265986641, 16152.664016274923, 15734.648359876008, 15998.64198877867, 16157.59198736114, 16181.823126591305, 15979.077224674684, 16127.3556293537, 16196.342758901132, 16238.131253896405 … 16417.044870478614, 16516.13727645574, 16568.90599859773, 17000.547361783512, 16688.63170586278, 17255.12854454331, 16731.24021839952, 16298.256014005312, 16539.539146418494, 16661.238063280976], [15944.236265986641, 15957.75689959195, 15964.663629494537, 16018.278017392098, 16107.652051008035, 16171.60379587647, 16198.812623660238, 16270.865058214411, 16340.380294571234, 16448.642764801923 … 16642.025790629174, 16717.010679026942, 16793.654041605518, 16883.64262106728, 16941.91270868582, 16974.87620618495, 16946.327020803023, 16952.71226002218, 17002.55267521352, 17037.7248650059], [15944.236265986641, 15941.680238984081, 15932.512595353115, 15969.913876609528, 16042.839386063531, 16090.307261008656, 16101.141834461396, 16156.466563088881, 16209.146654482589, 16300.101525312772 … 16458.52568198258, 16516.0278925352, 16575.034421222037, 16647.06351379767, 16687.688116907102, 16703.31223390681, 16658.42030881594, 16647.90819881458, 16680.031236790233, 16697.697166446702], [3173.2320350842083, 3173.87353063356, 3157.9744626884603, 3140.4447971079644, 3161.2292294048657, 3177.6629203271464, 3189.578310295959, 3189.73449832122, 3171.10898742492, 3181.3204606381796 … 3213.162603827372, 3238.3961809105012, 3219.3972297712503, 3246.2834317890492, 3302.4657396235652, 3317.3234117837637, 3324.9569542324352, 3323.6653216963896, 3328.4425149296785, 3320.9612089491106], [3173.2320350842083, 3170.6760080816557, 3151.61465786426, 3130.962821946693, 3148.5093314203937, 3161.6884389051847, 3170.346738327338, 3167.3078587324608, 3145.6410259677536, 3152.591203690208 … 3177.7332820417073, 3199.4620735691574, 3177.487148826833, 3200.795449516877, 3252.9100596389458, 3264.2528908507743, 3268.4681691985734, 3263.9069377511296, 3265.305285589445, 3254.6836510104517], [34195.564496956766, 33558.35973781152, 34722.11532870012, 34949.11720128917, 36400.705104157816, 35477.997126917784, 34742.415195293615, 34497.37343756192, 34028.65828134728, 34642.877427990206 … 35133.3969120831, 35241.36070810483, 35055.65939802773, 35881.10133601752, 36155.57322346692, 36407.51407196775, 35462.77640822514, 37050.27051348303, 36647.44234052401, 36191.40651028063], [34195.564496956766, 33524.55132955867, 34652.18889985055, 34843.59499579901, 36254.23889690499, 35299.64510525842, 34532.93569888646, 34254.826554349485, 33755.36570105911, 34330.03119342818 … 34746.005242847685, 34817.66612473284, 34599.30517452746, 35378.323640916744, 35613.03496339497, 35825.066870464565, 34860.28766000902, 36384.11911846519, 35952.27697071276, 35469.12224047258], [33097.63671130043, 32685.714349841455, 33530.3720885308, 33931.87297354598, 35507.51808396939, 34575.6542587688, 33679.665612835626, 33455.47687100786, 32963.654811914654, 33519.46385607169 … 33951.06493966775, 34122.236544231826, 34013.86397555763, 34881.91362140401, 35034.24435071788, 35609.523823951175, 34511.222031092715, 35728.74601520545, 35531.64885008936, 35107.44576832971], [33097.63671130043, 32652.785089191966, 33462.845696317854, 33829.42214333022, 35364.64581026375, 34401.83841975214, 33476.59396821682, 33220.255437233034, 32698.915538188565, 33216.76272872722 … 33576.71002738274, 33711.996800197085, 33571.07183444953, 34393.13687046102, 34508.532371115325, 35039.84286586316, 33924.89955251488, 35086.35518592377, 34857.6489680959, 34406.79447354234], [29576.14777688488, 29605.974349916603, 29630.886286468933, 29783.09555135073, 29922.902360503154, 30056.063265896442, 30079.901292574858, 30217.839119346452, 30387.036125639963, 30583.026383992332 … 30934.077374870496, 31063.687958028448, 31239.735680055535, 31381.73391064112, 31427.94215792302, 31475.358651930317, 31425.254066021353, 31426.247240831068, 31543.57433906987, 31627.674686043723], [34346.71094688274, 34381.34847608993, 34492.967619579955, 34790.300568210565, 35043.40779102009, 35168.91973554701, 35210.59991975757, 35402.663206444864, 35708.15144534813, 35994.63642131935 … 36395.53844236555, 36550.16588641404, 36952.31177509564, 37096.863223385495, 37023.733931986695, 37076.46040630774, 36940.07333807192, 36954.312877337165, 37122.96153324182, 37228.826764434685], [28335.329312139656, 28363.90456052843, 28455.988055603695, 28701.281615963144, 28910.08986315398, 29013.634633023717, 29048.01992677786, 29206.468183598507, 29458.489690510654, 29694.833896792275 … 30025.569809346292, 30153.134266816014, 30484.89634455727, 30604.14831299681, 30543.81815336805, 30587.316409013703, 30474.79988600934, 30486.547212702648, 30625.67888124869, 30713.015517155243], [978.0617717704339, 979.048114923888, 981.311229232025, 992.2319429592587, 1002.2596059685844, 1005.9501263312363, 1012.3423926376648, 1012.9304021632425, 1019.1551287414162, 1026.122241342784 … 1032.645231634517, 1040.509623470553, 1054.1776911940658, 1059.0428021713344, 1060.6619005000878, 1063.6185379467756, 1063.4962755717943, 1060.590957690513, 1068.7877459871677, 1070.46098651585], [0.0019383188997990075, 0.0013430450653866277, 0.004045572584635337, 0.00261689945733079, 0.0034122136033816197, 0.007646121374137671, 0.009857888917107926, 0.008917592679717368, 0.0036306529145668787, 0.0030964693150801192 … 0.0037374498661839617, 0.004107198322927497, 0.0031759484328175436, -0.0002893391278081525, 0.005562047561082695, 0.005116747354816598, 0.0050704690288583265, 0.003063819828414527, 0.005619394829610158, 0.0046990324362075064], [2.3548476e6, 2.34358078692985e6, 2.375067035382102e6, 2.3776112056833855e6, 2.399756832319961e6, 2.381418387708266e6, 2.362359297525128e6, 2.3512049001857177e6, 2.3540143067722265e6, 2.374148750839285e6 … 2.380257680708467e6, 2.389386915342197e6, 2.391963158030235e6, 2.3749267736969967e6, 2.3835448833978595e6, 2.397050404131077e6, 2.3713458816511114e6, 2.395831210823221e6, 2.3847195723311505e6, 2.379077611794181e6], [0.0016459319014481277, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.0010953389477594987, 0.0014857491149409617, 0.0015546881197578961, 0.0007323966887408149, 0.001162740597702544, 0.0017514005557226675, 0.0006833436618276792, 0.0017186775230679727, 0.001264208461331311, 0.001045740904859803], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.6059091613041 258.50369622511613 … 137.13538556670352 505.4138092341076; … ; 535.8601737010315 271.77580699514266 … 144.95528217495104 533.8512494682222; 538.471052735041 272.0080461332582 … 145.43769023583525 535.6300995941886], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.0834390395163 258.2432663779743 … 136.99722836422478 504.904629508617; … ; 525.6954415389164 266.62049144487787 … 142.20562528476694 523.7246245918554; 527.7246018882902 266.5794885852817 … 142.53514054176026 524.9403466202967]), BeforeIT.Data{Float64, Vector{Float64}, Matrix{Float64}}([72422.0, 72492.52701130552, 72757.55151391418, 72950.31197787513, 72936.97239716594, 73046.9923986509, 73208.30374311071, 73529.63122185406, 74207.04774381522, 74598.49799305355 … 75457.52065543176, 75855.39295429946, 76009.35513012759, 76151.2648285344, 76241.08122138468, 76427.12510396834, 76469.38845437879, 76545.513012989, 76688.33553465155, 76939.26609801746], [72422.0, 72419.49433129304, 72611.02600125327, 72730.05239973566, 72643.4945185109, 72679.77666423858, 72766.89405657274, 73012.65322905405, 73611.07256942557, 73924.82822501496 … 74625.50276213729, 74943.41003228645, 75019.86610510814, 75084.20846783475, 75097.03343389159, 75204.44439449329, 75170.22491466111, 75169.25044947007, 75233.63442244873, 75403.76286695676], [64900.92049553803, 64966.370940930254, 65208.459127082795, 65377.65184920994, 65351.718147479885, 65451.52357250142, 65602.41485599815, 65924.25451798436, 66542.81244418262, 66901.756041597 … 67678.29540533762, 68035.05390219993, 68163.51689904813, 68288.33024335293, 68360.32300418378, 68531.8255394722, 68560.56211396915, 68620.83079009123, 68748.50002383273, 68983.17276957823], [64900.92049553803, 64900.920495538005, 65077.136636088886, 65180.25647658393, 65088.76120015904, 65122.491144089974, 65206.86489927012, 65460.749013996254, 66008.39064117939, 66297.59253044809 … 66932.05364870689, 67217.09218793629, 67276.16491766548, 67331.45188667951, 67334.53119965577, 67435.45378718879, 67395.7642208337, 67387.0513459853, 67444.40965924585, 67606.45201243504], [40512.94792630534, 40536.03009401176, 40588.40040727326, 40698.32304671558, 40767.31481243867, 40809.36001707076, 40833.659163785014, 40715.4917754224, 40941.84014359404, 41083.44966851341 … 41430.465518485296, 41651.684632122226, 41770.49554894638, 41866.70283729299, 41965.44197492928, 42034.658345768934, 42119.08891273914, 42180.14446954396, 42249.076631150805, 42334.61557520483], [40512.94792630534, 40495.192023704534, 40506.659941108395, 40575.442208756045, 40603.27859491555, 40604.20661352231, 40587.45249363823, 40429.226050106714, 40613.02608803894, 40712.44115288634 … 40973.64042882584, 41150.920960903095, 41226.72765557921, 41280.05294165904, 41335.722796325594, 41362.18812241783, 41403.51388660691, 41421.75966719241, 41447.653854969896, 41489.729182363146], [14866.888022051655, 14925.635407125832, 15226.643938927478, 15378.611664454556, 15442.683908448344, 15532.25534275243, 15659.114026104802, 16036.807184447254, 16462.092129450884, 16589.294640967313 … 17120.251095226617, 17323.849986118366, 17384.335512388774, 17437.737109516165, 17540.859998516302, 17667.77361500603, 17714.007914536494, 17786.88855577473, 17837.648394027736, 17941.805799588168], [14866.888022051655, 14910.598558506888, 15195.979193305438, 15332.178874439756, 15380.546888426255, 15454.172886986968, 15564.697351215287, 15924.054322079151, 16329.880991479999, 16439.483229566707 … 16931.47792689038, 17115.57138237593, 17158.02640652521, 17193.393849547825, 17277.64780699769, 17385.12467395199, 17413.058819872742, 17467.086285501337, 17499.28602409275, 17583.735048806197], [15944.236265986641, 16040.55077483536, 16077.563470176308, 16510.68054693009, 15931.191100919568, 16027.71337989377, 15965.614975097535, 15952.109218789337, 16102.700256844797, 16151.415487584858 … 16412.955025301795, 16578.998345768494, 16678.66450953969, 17048.070859463496, 16483.59420654865, 16809.65315496641, 16993.8033341909, 16729.326086375808, 16516.965744675817, 16598.803711113505], [15944.236265986641, 16024.39070344231, 16045.185068473846, 16460.829690457198, 15867.088465245475, 15947.140198897812, 15869.350251818694, 15839.951857630102, 15973.375483989661, 16005.558391024693 … 16231.980721557498, 16379.674833404222, 16461.54182173478, 16809.187730086618, 16236.246986653146, 16540.732420114942, 16705.09003153274, 16428.53843339251, 16203.655405215686, 16267.535712044113], [15944.236265986641, 15960.084684891697, 15994.75016219186, 16029.552133229778, 16018.879405304786, 16037.390626627377, 16063.819598240892, 16112.804624043569, 16198.38630797695, 16285.479179882805 … 16452.004802681084, 16535.46606703157, 16590.752141496523, 16620.73994304127, 16629.107116243984, 16664.483681778915, 16700.829558786765, 16705.804795006094, 16733.793190995228, 16760.68462765474], [15944.236265986641, 15944.005679153839, 15962.538537162813, 15981.153952400886, 15954.423936537843, 15956.768796985529, 15966.962749892875, 15999.51743281882, 16068.293056752927, 16138.411406714898 … 16270.599924048736, 16336.665928065268, 16374.773896019711, 16387.844713845945, 16379.57637901476, 16397.885367327657, 16417.09368376065, 16405.44004692582, 16416.369851492545, 16426.185915803668], [3173.2320350842083, 3176.201315933306, 3173.9474405610727, 3183.2482432029433, 3191.784988113974, 3194.546473709978, 3193.6250190354262, 3180.953861639572, 3168.3771100506597, 3187.574499116914 … 3221.426876216792, 3233.0316767533527, 3258.776863198131, 3273.042702037345, 3276.731216591235, 3274.050867396103, 3297.2650214469813, 3299.4898900360467, 3305.036143094178, 3297.5952315782633], [3173.2320350842083, 3173.0014482514143, 3167.5554679587817, 3173.6370311854594, 3178.9421423438725, 3178.487116699692, 3174.3690474243517, 3158.5889576511654, 3142.931088977112, 3158.788764401105 … 3185.906430015131, 3194.162064973704, 3216.354138579542, 3227.179760142496, 3227.561700124574, 3221.6726203802723, 3241.246703748443, 3240.166172216098, 3242.342909244332, 3231.7839964364002], [34195.564496956766, 34049.959902359835, 34537.58812092568, 34449.899933770044, 34780.14888134422, 34783.25956334725, 35194.46552675623, 35388.497322440715, 35436.846966501485, 35944.865572098875 … 36486.42187262379, 35378.715385934185, 36498.68561045581, 36542.62733436164, 35778.29329735264, 34808.16829474084, 34855.541700604495, 36097.140594366065, 36643.033867542785, 36160.7600341186], [34195.564496956766, 34015.656230953755, 34468.03330908569, 34345.88501977409, 34640.20333688943, 34608.40006829648, 34982.26039152253, 35139.68505438025, 35152.244874209755, 35620.26159341837 … 36084.111332910514, 34953.36943519646, 36023.5460861518, 36030.580121205014, 35241.416371797764, 34251.30741781729, 34263.36946214662, 35448.12615452983, 35947.952122059956, 35439.08738651024], [33097.63671130043, 33059.6491670272, 33672.64442338866, 34087.20321399538, 33984.36630598497, 34105.59590441326, 34444.54994863284, 34563.27427924568, 34736.43175257591, 35170.52737611086 … 35992.57285620549, 35077.855395643775, 36322.82605120314, 36743.87331209992, 35527.10825596222, 34893.128306514074, 35213.05340769235, 36247.98669307165, 36558.3891027459, 36096.719022007586], [33097.63671130043, 33026.34318531452, 33604.831510720185, 33984.28339369159, 33847.622766966, 33934.14310346485, 34236.866431621995, 34320.26405514208, 34457.45486829279, 34852.9161418811 … 35595.70764804664, 34656.126579593205, 35849.97586488298, 36229.00617466371, 34994.00052788265, 34334.908239809, 34614.807285498, 35596.26009114607, 35864.91298388979, 35376.324462766905], [29576.14777688488, 29605.9743499166, 29663.662873251033, 29715.314512379085, 29689.239005909385, 29703.312039332315, 29759.741038197008, 29890.33754280053, 30066.74387969903, 30220.710187931207 … 30506.26786664596, 30644.434443357735, 30701.07286735782, 30755.269620048854, 30763.576432366102, 30820.42876733804, 30839.22998421788, 30853.351673546098, 30908.380385299613, 30999.779646251227], [34346.71094688274, 34381.34847608994, 34560.48292872903, 34671.06182790469, 34667.286521189984, 34744.94015180481, 34837.409598757215, 35026.366026080614, 35453.84956492875, 35651.907039697784 … 36126.270057105794, 36335.34779155681, 36404.43209537058, 36468.34023989768, 36527.65601895756, 36641.12850068076, 36653.36110459945, 36698.58606568733, 36766.85637458405, 36901.07074734748], [28335.329312139656, 28363.904560528437, 28511.68679547164, 28602.912110406796, 28599.797560102958, 28663.860206426132, 28740.145596161405, 28896.03075797891, 29248.6958753904, 29412.089213954616 … 29803.428935901877, 29975.91376179009, 30032.90688994988, 30085.629793278345, 30134.56408965587, 30228.176550612177, 30238.268196968565, 30275.577858657434, 30331.899457771295, 30442.623551748027], [978.0617717704339, 979.048114923888, 984.3133251027311, 991.2755089261375, 995.1926203805973, 1003.2713813642725, 1005.2642190439599, 1007.5509491031368, 1022.2189995549628, 1029.138813968014 … 1045.7574815858845, 1055.2716672854156, 1058.0119363197591, 1064.720383406327, 1069.0905528601502, 1070.2682714534649, 1067.9710251518459, 1068.893050857799, 1073.2632639490334, 1082.3223759795767], [0.0019383188997990075, 0.005988375322431905, 0.003337719900556868, 0.006262409004229141, 0.007607063572359074, 0.0009262224533410635, 0.0005590598120901458, 0.005235036041497887, 0.006923276967024217, 0.003037720563892954 … 0.008268634624712279, 0.009286477259982107, 0.005961860221508131, 0.004773465029700885, 0.0029844834367396267, 0.0011857841744971065, 0.006642348191415959, 0.005522232514147074, 0.0037026778098672164, 0.004747132006157173], [2.3548476e6, 2.351045761664578e6, 2.3668985923041827e6, 2.358942369733048e6, 2.370971048142279e6, 2.3641160939229056e6, 2.372142780948556e6, 2.3798165723104505e6, 2.386714922187349e6, 2.388827504342324e6 … 2.399555974779274e6, 2.402390450516776e6, 2.426760707206655e6, 2.433221435465674e6, 2.423932042269955e6, 2.4147498723770496e6, 2.4199144494511695e6, 2.4274833060253053e6, 2.4376838816750883e6, 2.4197782954102233e6], [0.0016459319014481277, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.0, 0.00032929406878703287, 0.0014395081531853398, 0.0017043406193198692, 0.0012711388840780488, 0.0008316437013703994, 0.001132871882628418, 0.0014833702010764575, 0.0018718410109981624, 0.0011197142287506015], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.6059091613041 258.50369622511613 … 137.13538556670352 505.4138092341076; … ; 509.54759877812114 254.03731851407844 … 142.8173333792316 531.6163464253154; 502.0279560248165 263.5020671970089 … 143.12903686100537 532.6591045950163], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.0834390395163 258.2432663779743 … 136.99722836422478 504.904629508617; … ; 499.88198987560577 249.21848436926325 … 140.10823124185728 521.5321154269697; 492.008812515222 258.24326637797407 … 140.27256175142094 522.0286447837985]), BeforeIT.Data{Float64, Vector{Float64}, Matrix{Float64}}([72422.0, 72494.701810617, 72553.57104815265, 72545.30897758268, 72629.3809724509, 72594.62559304413, 72788.81049124419, 72751.47974351875, 72913.03839926994, 73030.49981609544 … 73551.61746490841, 73852.59038816646, 73833.46165300728, 74185.21388781568, 74254.26803290859, 74727.44122947555, 75030.32722843585, 75115.31141087272, 75332.67556701817, 75554.92116267495], [72422.0, 72421.66693960047, 72407.45632917144, 72326.27222889477, 72337.14075524318, 72229.68395922522, 72349.9301405242, 72239.9728401652, 72327.45573432837, 72370.99002441822 … 72740.61464795917, 72964.6864625878, 72872.29838751494, 73145.70647415555, 73140.03368976885, 73531.95205288513, 73755.61237222348, 73764.76339084313, 73903.68997007515, 74047.04577665271], [64900.92049553803, 64966.37094093024, 65015.24018343892, 64997.76712247763, 65092.176391052446, 65040.81393648364, 65217.70830517693, 65175.00336286871, 65319.7454928721, 65429.015206247495 … 65911.02607208006, 66195.63774305375, 66173.61945300046, 66484.47452554418, 66546.78374966735, 66988.05890715349, 67251.22439034011, 67318.08842790061, 67509.56896339844, 67707.78400309304], [64900.92049553803, 64900.920495538005, 64884.30681363148, 64801.518739458385, 64830.26376681765, 64713.84619322462, 64824.47793774877, 64716.765753630694, 64795.146443391175, 64838.151439780304 … 65184.27077213065, 65399.79068746207, 65312.17193667232, 65552.8723835444, 65548.20529965138, 65916.38432460783, 66108.67126555045, 66107.731853045, 66228.97988331584, 66356.5166154856], [40512.94792630534, 40552.260817252885, 40594.93790061424, 40641.45931583577, 40594.80394491173, 40712.21705909726, 40789.32555180601, 40827.58126986486, 40894.64451944429, 40925.236282988124 … 41094.7977730438, 41198.47727028631, 41250.31122059695, 41464.00522914086, 41485.91294312643, 41625.298554278204, 41869.29217938512, 41979.35256980974, 42127.36276992594, 42219.926076427495], [40512.94792630534, 40511.40639528479, 40513.18426867422, 40518.75016708545, 40431.46186263693, 40507.552004507306, 40543.38619130547, 40540.52745679625, 40566.209503632694, 40555.65653037377 … 40641.673859462986, 40703.162353045314, 40713.31508161462, 40882.998063738385, 40863.38941441488, 40959.37726652569, 41157.96103194574, 41224.577938241426, 41328.248784098345, 41377.32858111336], [14866.888022051655, 14893.66812356584, 14989.672069774202, 15035.255187724853, 14860.14977107188, 15083.941050107467, 15107.990328851176, 15148.735079215769, 15225.231074230114, 15331.441784820712 … 15495.234541157315, 15172.479642030728, 15336.336403273115, 15263.406819049076, 15444.007462286077, 15483.010894317746, 15449.002006132938, 15421.869421846623, 15584.273726584526, 15595.636389811632], [14866.888022051655, 14878.66348042362, 14959.484558801918, 14989.859097220524, 14800.35670470269, 15008.112322480807, 15016.896655943858, 15042.22614500014, 15102.953473645459, 15192.989549068794 … 15324.379306489436, 14990.066213278753, 15136.688129332826, 15049.530984302464, 15212.259928224332, 15235.313774750291, 15186.533840281621, 15144.589399683062, 15288.655622933149, 15284.388943852176], [15944.236265986641, 16153.20954131673, 16325.338584606598, 15829.4676442203, 16168.395070357634, 15927.81427036907, 16379.359729826148, 15897.581403446095, 15942.409266347157, 16043.27320298557 … 15901.934742106589, 16490.104594070264, 16091.857587295652, 16530.046967560418, 16079.481906766776, 16340.00642171638, 16656.89046900875, 16411.576257321583, 16545.88242872565, 16662.056263997383], [15944.236265986641, 16136.935971719351, 16292.461191735367, 15781.673580412255, 16103.337992574527, 15847.743293826288, 16280.600331310336, 15785.807420797837, 15814.371830125447, 15898.392696970066 … 15726.595105599674, 16291.849820265832, 15882.37394613667, 16298.422557918431, 15838.198658880276, 16078.599092612301, 16373.901089600848, 16116.501639329897, 16232.023568657334, 16329.52591211062], [15944.236265986641, 15960.20354972512, 15969.911854321843, 15963.439284753078, 15986.05628941716, 16002.342429674896, 16025.284244063618, 16025.70436182668, 16058.415637248323, 16082.364682587486 … 16166.659925011994, 16207.874373621067, 16246.236487450573, 16320.512210831399, 16325.548437154941, 16399.184373386604, 16477.594706532986, 16514.770519550137, 16554.215475715377, 16595.97725515917], [15944.236265986641, 15944.12442423675, 15937.750250846828, 15915.24071908306, 15921.732891643907, 15921.896791399233, 15928.659744748986, 15913.029562068987, 15929.44652513827, 15937.13115675651 … 15988.401346999053, 16013.012755281281, 16034.743143313106, 16091.823870543723, 16080.572798431938, 16136.830315750805, 16197.65144168337, 16217.840503452344, 16240.198546070515, 16264.765664637343], [3173.2320350842083, 3176.3201807667306, 3180.378584837684, 3183.325061661733, 3182.3415493701063, 3188.87125235194, 3194.346520895984, 3198.137960050388, 3202.7712112328145, 3204.4697728030806 … 3197.158589021059, 3193.1037841888474, 3216.586444014297, 3233.4565523735046, 3228.14706097075, 3227.007680931695, 3252.201708440617, 3269.982630951622, 3272.7593695465516, 3286.165936351243], [3173.2320350842083, 3173.1201933343254, 3173.9736606352835, 3173.7136177055368, 3169.536701343518, 3172.840425340097, 3175.08619898729, 3175.6522367330094, 3177.048962616567, 3175.531463499173 … 3161.905732438172, 3154.7142115298593, 3174.712953850757, 3188.148304519382, 3179.706581853169, 3175.382030543359, 3196.948986157712, 3211.189443719711, 3210.6783938458857, 3220.5827995607187], [34195.564496956766, 34152.96743020938, 34135.751255257586, 34053.77648075063, 32815.37804177092, 33846.6327401742, 33294.86554827561, 32985.46798223975, 33262.202137426284, 33888.071738875304 … 34661.614733445305, 34079.44829399583, 33937.48866191337, 34750.512401621774, 35761.28543994881, 36026.6475737476, 35744.97128615692, 36215.72603264262, 36716.793627897336, 37709.49888979999], [34195.564496956766, 34118.55998375051, 34067.00569759841, 33950.95758610385, 32683.338182993648, 33676.481777199166, 33094.11405679792, 32753.55112442816, 32995.06515620766, 33582.041858357865 … 34279.42508000572, 33669.722978164, 33495.69077387455, 34263.57688742887, 35224.66372852936, 35450.29347230056, 35137.68823653588, 35564.57946653468, 36020.312733447805, 36956.91753149589], [33097.63671130043, 33257.40410172802, 33492.12876210006, 33014.64965094897, 31809.345855661217, 32975.97952670378, 32782.73066751457, 32107.8859912477, 32411.448598177678, 33157.523193574314 … 33601.964324844565, 33087.91941221676, 32782.532220071706, 33822.757529556504, 34516.41971921929, 34747.52221458437, 34689.82871224799, 34913.21287074801, 35641.63698611563, 36632.19645736154], [33097.63671130043, 33223.898891578116, 33424.67938763846, 32914.96820192729, 31681.35398766467, 32810.205438788274, 32585.067094833277, 31882.13930685709, 32151.144229282672, 32858.090610352345 … 33231.45870359863, 32690.1149021661, 32355.769543443643, 33348.82201923267, 33998.47804027988, 34191.63155330367, 34100.471826140674, 34285.485052946075, 34965.550739061815, 35901.11519191941], [29576.14777688488, 29605.974349916603, 29614.217443049056, 29582.630419695222, 29635.182055499936, 29656.937752639966, 29695.217441329067, 29675.910774589865, 29727.74450556735, 29786.09421819848 … 29990.776556106426, 30102.521191737887, 30161.769383523802, 30280.064440749495, 30324.344891904482, 30498.386977747825, 30622.72463939786, 30669.034761989584, 30765.513479739664, 30829.99628388419], [34346.71094688274, 34381.34847608993, 34419.45515479502, 34429.07416984341, 34470.95397043991, 34406.926797191096, 34539.118928934105, 34515.43354851272, 34607.31463506814, 34659.04444328411 … 34926.85106974452, 35093.06671699177, 35016.901480178494, 35205.01307450751, 35219.88361253535, 35477.18180987144, 35611.28828645602, 35631.03969896331, 35722.951829765596, 35849.712018831946], [28335.329312139656, 28363.90456052843, 28395.341785821136, 28403.277275174863, 28437.827248337177, 28385.006148764172, 28494.061935538186, 28474.521984386498, 28550.32198890895, 28592.99801553986 … 28813.932968073284, 28951.057454574046, 28888.222702490242, 29043.410894482986, 29055.67878216281, 29267.944497043427, 29378.579578894256, 29394.874087519525, 29470.699702906422, 29575.274248819092], [978.0617717704339, 979.048114923888, 981.5675855947828, 986.0625329389155, 986.0403651127124, 976.9493866526196, 983.3719349138455, 983.6590397660746, 984.6863522366477, 983.8765447648733 … 993.3984462291402, 1000.0498343240679, 994.9485892982402, 999.397010287232, 1002.5552452275931, 1012.4901195342021, 1017.211464486152, 1018.0139669477207, 1021.1036538931436, 1028.075700376977], [0.0019383188997990075, 0.00847608177264747, 0.0077643250704249045, 0.006529846626568414, 0.006939912406562998, 0.006452933948565054, 0.002880606283835574, 0.004203547082837433, 0.003289403000079405, 0.0033742248753081405 … 0.007309267290883881, 0.007029521856414478, 0.0035434249573584875, 0.0039316477743693845, 0.005849947621102025, 0.0036523582937388888, 0.004368378660495553, 0.0031609555547502666, 0.003635974820693999, 0.0011819741977778797], [2.3548476e6, 2.3625924349622033e6, 2.364771058029414e6, 2.3503376996849948e6, 2.326244438262859e6, 2.3397962900631027e6, 2.331007283565656e6, 2.3170893950703754e6, 2.3101868693135325e6, 2.3213129400393693e6 … 2.3420351003855336e6, 2.3258359649979486e6, 2.34523864091804e6, 2.351442502703695e6, 2.366246076207254e6, 2.3779867304830733e6, 2.3902523389719524e6, 2.3922574400180583e6, 2.4015478930209144e6, 2.4497038876438374e6], [0.0016459319014481277, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.002068522916658382, 0.001396372065683444, 0.002194850746544053, 0.0023827742321000157, 0.002959842489827623, 0.0033125650606751957, 0.0036749097127958693, 0.0035578930982402327, 0.00375991532307202, 0.005481000589196757], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.6059091613041 258.50369622511613 … 137.13538556670352 505.4138092341076; … ; 532.2792162247472 266.25453234334003 … 142.20135806616608 524.8543570685085; 529.6491411156939 266.04434521101103 … 142.62016769337987 526.2500481225468], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.0834390395163 258.2432663779743 … 136.99722836422478 504.904629508617; … ; 522.1824112485249 261.2039498573785 … 139.50394036511145 514.8983942529251; 519.0787521744271 260.7348072807106 … 139.7738482597034 515.7474960419414])])
Finally, we can plot baseline and shocked simulations
Te = T + 1
+StatsPlots.errorline(
+ 1:Te,
+ data_vec_baseline.real_gdp,
+ errortype = :sem,
+ label = "baseline",
+ titlefont = 10,
+ xlabel = "quarters",
+ ylabel = "GDP",
+)
+StatsPlots.errorline!(
+ 1:Te,
+ data_vec_shocked.real_gdp,
+ errortype = :sem,
+ label = "shock",
+ titlefont = 10,
+ xlabel = "quarters",
+ ylabel = "GDP",
+)
Note that, importantly, once the function central_bank_rate
has been changed, the model will use the new interest rate in all the simulations, unless the function is changed again. To restore the original interest rate, we can simply re-import the function central_bank_rate
.