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, 72474.35204292928, 72500.67749532155, 72479.97217810026, 72524.38479605025, 72944.98676292054, 73296.87194582711, 73719.31241025148, 73994.37474483742, 74224.6377515799 … 74223.36403833711, 74244.72559165639, 74243.3548214, 74652.6570142359, 74660.63317396006, 75053.3091144611, 75090.68027577705, 75122.74458543962, 75418.10648195737, 75787.19722139236], [72422.0, 72401.33767330972, 72354.66929799739, 72261.1327014391, 72232.5670539482, 72578.28382271383, 72854.92823704587, 73201.00079183122, 73400.10759996096, 73554.34416870477 … 73404.95433650722, 73352.10716134965, 73276.85557073976, 73606.59963502412, 73540.30105343927, 73852.60670531333, 73814.94006183329, 73772.06291943214, 73987.500345904, 74274.68622267427], [64900.920495538005, 64966.370940930225, 65009.76162902033, 64965.39434724502, 64997.12981187437, 65402.09094537466, 65731.2647164538, 66107.98959866511, 66346.07146921755, 66551.99108685428 … 66514.29513029265, 66521.27112465473, 66507.32551657017, 66891.63658794035, 66881.61132696056, 67255.34297325698, 67265.83763517895, 67287.65194572217, 67569.3800715236, 67907.71197340774], [64900.920495538005, 64900.920495538005, 64878.839292404366, 64769.24370765724, 64735.599628362244, 65073.30702053437, 65334.937859106605, 65643.19227542488, 65813.22974169781, 65950.98616578775 … 65780.88799966338, 65721.50909253575, 65641.5338180429, 65954.32915831967, 65878.00856796447, 66179.39238175281, 66123.0362411757, 66077.84260857242, 66287.65643447141, 66552.45455496124], [40512.94792630534, 40440.97467769727, 40333.81893759827, 40506.55871060514, 40564.61834049748, 40599.27996257108, 40699.01242453883, 40948.69124671697, 41136.25261834324, 41266.448275478106 … 41602.790825908676, 41667.16935802959, 41731.68524443336, 41843.421470098074, 41947.6684866807, 41997.274789030445, 42201.00923150865, 42242.32365512629, 42261.84527548088, 42419.06364196005], [40512.94792630534, 40400.232371078906, 40252.591169834915, 40384.25686854891, 40401.397716611464, 40395.182655912635, 40453.61760730934, 40660.78592396843, 40805.877188066006, 40893.78717122756 … 41144.06562426542, 41166.2195193535, 41188.42258322197, 41257.09780057458, 41318.21601100873, 41325.40262760551, 41484.0424341921, 41482.82089194329, 41460.18029087267, 41572.49189018559], [14866.888022051655, 14878.991589799392, 14858.77668598505, 14786.833104116473, 14982.343426806747, 15020.088808085406, 15082.61737108209, 15217.330025565983, 15328.202307959258, 15286.890659169087 … 15081.951186318534, 15030.772789962499, 15311.821172150609, 15173.428894544937, 15449.505496387625, 15347.354934566014, 15344.79309658451, 15520.853741589612, 15574.705139490825, 15688.736864173454], [14866.888022051655, 14864.001732548053, 14828.852783570454, 14742.187076796994, 14922.058687508299, 14944.581073112582, 14991.676684499533, 15110.3388085333, 15205.09771990034, 15148.840747154027 … 14915.652941374608, 14850.06305324846, 15112.49203724383, 14960.813859824108, 15217.675460692153, 15101.828038265201, 15084.095370101477, 15241.794014668876, 15279.268542377275, 15375.631380225572], [15944.236265986641, 16167.970452874444, 16341.576245128988, 16087.22330350771, 15549.423926068755, 15864.523803144848, 16071.17054003792, 16264.221251938488, 16244.473360819566, 16424.371476549586 … 16556.37011561356, 16782.917115888496, 15663.725071626024, 16687.02984982915, 16061.434198153707, 16873.207686033482, 16716.930617068727, 16246.222077341868, 16581.046236870356, 16314.177241465039], [15944.236265986641, 16151.682012379677, 16308.66615143863, 16038.650995560112, 15486.857414214073, 15784.770995148603, 15974.269369164316, 16149.869468615776, 16114.009973062788, 16276.049421542257 … 16373.814472855209, 16581.141959302342, 15459.814855274757, 16453.20574483832, 15820.421768056895, 16603.27020615803, 16432.921195878527, 15954.120471858138, 16266.520354490562, 15988.589630134456], [15944.236265986641, 15949.97169688411, 15965.760506829172, 15993.420422586925, 16005.187879800953, 16050.574126034118, 16118.649008522638, 16201.440332380795, 16271.335715364421, 16327.914191636353 … 16378.491399657665, 16385.262917577584, 16364.102454569871, 16446.531351295827, 16462.20278302087, 16507.093463149737, 16536.26871308014, 16550.88650615304, 16580.376421372628, 16639.953478746305], [15944.236265986641, 15933.902879487692, 15933.607263700364, 15945.131334579306, 15940.787501884757, 15969.886021406022, 16021.461566081198, 16087.529954152053, 16140.656589387067, 16180.463204525848 … 16197.897102477938, 16188.268618668157, 16151.074732450943, 16216.077189708782, 16215.176555566137, 16243.013076514097, 16255.328616274797, 16253.30713677036, 16265.863244723669, 16307.864239699242], [3173.2320350842083, 3166.0883279257173, 3158.3126844564517, 3169.9704633264723, 3177.040515998382, 3159.2541940342876, 3157.6985155600396, 3171.3967538551883, 3196.0910859416445, 3213.491805335185 … 3255.836671199018, 3264.4188078712277, 3262.4327555330897, 3281.678748851086, 3288.5436083875898, 3269.780849714221, 3299.2550240580645, 3307.1018439306517, 3294.659570963819, 3300.1000372092203], [3173.2320350842083, 3162.898648585268, 3151.95219849171, 3160.399341037398, 3164.256997840275, 3143.3722554224155, 3138.659162909199, 3149.099044742066, 3170.422487065618, 3184.472021595084 … 3219.936811986131, 3225.1718395657344, 3219.9624385446177, 3235.6947958514816, 3239.196839178901, 3217.470914416769, 3243.202897551968, 3247.6412657413593, 3232.1631703208855, 3234.2388128052094], [34195.564496956766, 32576.025318769858, 30947.33890374104, 31780.75423404153, 33188.19621124658, 33004.78288216836, 33507.43764681084, 33574.98879120878, 33876.71347012681, 34408.90264930789 … 33441.89627679147, 35063.34554303561, 36045.87563114741, 34774.982222564875, 35657.28464720056, 36329.3853078553, 35979.53013541196, 36977.02025036349, 37154.34311339021, 37093.33411231671], [34195.564496956766, 32543.206564461332, 30885.014449385355, 31684.79829731215, 33054.65623693248, 32838.863996431784, 33305.40445122867, 33338.92708349822, 33604.641196239594, 34098.16934917649 … 33073.15561520705, 34641.79117387993, 35576.63078262589, 34287.70382925952, 35122.22353637751, 35748.188009872436, 35368.26208851223, 36312.18587042481, 36449.56234231951, 36353.049765079115], [33097.63671130043, 31589.609996211562, 29980.83327713186, 30681.397174170786, 31760.19710856951, 31543.688693049186, 32063.36603664231, 32285.918905178743, 32591.267012411627, 33161.97530892472 … 32459.64436629527, 34299.47921525989, 34509.75229795772, 33826.205422800915, 34455.25965446269, 35493.913603024506, 35151.582804796846, 35863.67513898165, 36153.83328327487, 35728.114638523024], [33097.63671130043, 31557.785007158323, 29920.455256231977, 30588.76053677908, 31632.403001318464, 31385.11489789175, 31870.03987515589, 32058.920492784462, 32329.51847730798, 32862.50252039551 … 32101.73431719529, 33887.10854443468, 34060.50468762704, 33352.22159947221, 33938.235722696176, 34926.08217658815, 34554.38102685108, 35218.85832946296, 35468.03118415593, 35015.076442950674], [29576.147776884885, 29605.97434991661, 29629.908616463137, 29640.26839050235, 29667.018326189114, 29809.91627391501, 29968.254406745287, 30128.231937641343, 30224.37898023337, 30320.131235907873 … 30367.019683611663, 30365.716103214396, 30353.961977981508, 30481.39066276418, 30514.517290105818, 30633.979264991423, 30664.4249726064, 30675.905999122897, 30773.3841021436, 30898.472671998974], [34346.71094688275, 34381.34847608993, 34406.160942460374, 34361.42818850695, 34365.85512817582, 34617.16521740784, 34784.38437491573, 34994.83431269168, 35131.41347463892, 35236.72757841601 … 35153.88550497037, 35161.631757794385, 35152.56129968366, 35395.84469351625, 35357.67287902721, 35602.0848637505, 35578.49053568161, 35589.498699432486, 35765.675732366515, 35971.02253803006], [28335.32931213966, 28363.90456052843, 28384.374334380722, 28347.470733442944, 28351.12286751646, 28558.448516509896, 28696.400878312812, 28870.01774368962, 28982.692740050577, 29069.57470718716 … 29001.23170236167, 29007.62220144157, 29000.139260266293, 29200.843050829608, 29169.352089856322, 29370.986944666092, 29351.522109830392, 29360.60361826028, 29505.94604284182, 29675.352929302397], [978.0617717704336, 979.0481149238879, 973.692070096811, 963.6977682355973, 964.2563575095813, 975.0094540518211, 978.6259347929579, 984.9233483320202, 990.2790143452612, 995.1322725304058 … 993.3899417106869, 993.9232636459581, 1000.8022389050561, 1014.4012316599171, 1009.4211578275372, 1019.2788445150399, 1022.9221268909012, 1022.2472471667751, 1030.3202370134668, 1038.2167633786967], [0.0019383188997990075, 0.0028540605204823155, 0.001001084636563121, 0.004376684203776682, 0.0015725718980503789, 0.004313687601069649, 0.002279154218084445, 0.0030138217672484036, 0.0005527697217253547, 0.007966899899319424 … 0.0002577005024497758, 0.0024651948289349246, 0.004850400160717028, 0.008718739937380926, 0.005249933894092118, 0.005823268137937765, 0.005765342364033588, 0.005556423169326141, 0.005709202712355976, 0.007185963396163286], [2.3548476e6, 2.3182728193180757e6, 2.283460755984142e6, 2.304703905170909e6, 2.321818044823849e6, 2.3263389258442614e6, 2.3419420521651534e6, 2.3302927829362964e6, 2.3398182131665577e6, 2.3494056042543813e6 … 2.3212440057627345e6, 2.357895597789562e6, 2.3654023159422404e6, 2.338521372302773e6, 2.3472208382134833e6, 2.3598376968040806e6, 2.34904200826309e6, 2.3635173660507393e6, 2.343158631383005e6, 2.334266614630387e6], [0.0016459319014481277, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 … 0.0075177030845669434, 0.008570782451205263, 0.008360711382528814, 0.006824036119240345, 0.006805212868729497, 0.006963741638510874, 0.006130524292491828, 0.006410288654342015, 0.005219482557589373, 0.004624707024909909], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.6059091613058 258.50369622511613 … 137.13538556670355 505.4138092341076; … ; 520.7956859480452 260.91949799616356 … 142.57742519175125 527.3636605987473; 522.2404609062448 268.7704922053663 … 142.9914792174397 528.0248333553923], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.0834390395163 258.2432663779743 … 136.9972283642248 504.904629508617; … ; 510.91671206893244 255.97011578197925 … 139.87287387301976 517.3600988020241; 511.8179295281696 263.4065476277094 … 140.13774939276288 517.4868612792734]), BeforeIT.Data{Float64, Vector{Float64}, Matrix{Float64}}([72422.0, 72495.20242787163, 72546.18416075513, 72667.96763096361, 72814.31891903211, 72936.19935959915, 72855.19790791799, 72778.90140425657, 73079.34449686184, 73722.36145102949 … 74779.24236261133, 75482.22414371955, 76312.77285056228, 77050.51935488882, 77690.09403791976, 77969.2641346834, 78464.68836875899, 78847.00981026866, 79053.29847922083, 79432.51530442009], [72422.0, 72422.16705250768, 72400.08431813309, 72448.56053782468, 72521.33456350239, 72569.54059469193, 72415.91727407019, 72267.20170250449, 72492.42618647216, 73056.60372836597 … 73954.70337494959, 74574.72770011022, 75319.33393669246, 75970.86234646046, 76524.30285591753, 76721.91229383188, 77131.62602388609, 77429.36710887542, 77553.73638259593, 77847.25344676433], [64900.920495538005, 64966.370940930225, 65016.56316018585, 65124.666276464806, 65250.509102203534, 65358.20418110915, 65272.36129941637, 65190.63702675879, 65493.675192152485, 66120.00257175631 … 67098.16267650611, 67775.95861354186, 68550.18901899092, 69213.1377061242, 69786.11459462364, 70037.12802001256, 70488.87864553485, 70831.50899900917, 71026.00714532495, 71368.44928829453], [64900.920495538005, 64900.920495538005, 64885.62712605232, 64928.03474561028, 64987.95939163695, 65029.640880141866, 64878.801401595636, 64732.289499110186, 64967.679270190725, 65522.898769487045 … 66358.31764225218, 66961.11191153039, 67657.80334381759, 68243.30064564248, 68738.92784542366, 68916.67444727129, 69291.3199499205, 69557.98230468374, 69678.71474590997, 69944.12475238905], [40512.94792630534, 40551.863567466935, 40515.30444814108, 40558.26609902132, 40668.096387429854, 40781.50834956563, 40855.36289644624, 40881.0085559209, 40792.846129820566, 40787.86373389636 … 41216.888089343716, 41193.38303979386, 41476.6254640758, 41842.2324636509, 42224.80605149479, 42411.636750514605, 42618.32774113448, 42835.11204510867, 42861.62339086678, 43068.64657951385], [40512.94792630534, 40511.00954570859, 40433.71118900371, 40435.80813635024, 40504.45939696452, 40576.49495959199, 40609.02536357843, 40593.57910203028, 40465.22868208156, 40419.524538877165 … 40762.41797028363, 40698.1293687087, 40936.68316853501, 41255.92545487403, 41591.194943590104, 41733.135628804615, 41894.27098268338, 42064.95114616992, 42048.58121459821, 42209.11087903027], [14866.888022051655, 14891.090720647657, 14976.142694000531, 15092.358905722507, 15145.445911405961, 15070.761645484474, 14944.167015723504, 14984.641132712135, 15237.662748554096, 15371.945088194125 … 15593.980788855706, 15996.220612343723, 16145.322689394252, 16400.739088611306, 16256.64302269308, 16407.47980965389, 16524.59294705509, 16544.99175596019, 16568.267535375056, 16393.13835354252], [14866.888022051655, 14876.088674112989, 14945.982429666981, 15046.790401413598, 15084.504893547939, 14994.99917225907, 14854.061115972987, 14879.285923296706, 15115.28530611476, 15233.127083000114 … 15422.036747608101, 15803.903633325557, 15935.143040070821, 16170.926583145043, 16012.701355232068, 16144.993041676258, 16243.851213671198, 16247.518372202348, 16253.984052196674, 16065.974888309804], [15944.236265986641, 16118.54185800835, 16099.46864386107, 16092.152083808345, 15902.191278445085, 16472.668905189774, 16184.238646520624, 15522.923724915277, 15754.809297757041, 16067.061261880117 … 16340.752760530211, 16469.832284405456, 16678.667327281553, 16799.98012232027, 17174.509820193307, 16921.78140981283, 17105.888980899057, 17293.881453032598, 17291.768856559484, 17578.175699575793], [15944.236265986641, 16102.303214408532, 16067.046127606414, 16043.564894347011, 15838.20532990648, 16389.85888096952, 16086.655731160576, 15413.783915339998, 15628.278523333522, 15921.96593523748 … 16160.574581223911, 16271.821237506752, 16461.544602795362, 16564.57332127099, 16916.794955106143, 16651.066847782877, 16815.271418399534, 16982.943284551042, 16963.761276107776, 17227.362038987136], [15944.236265986641, 15960.212201581653, 15958.60481246474, 15969.833564202065, 15995.203219593788, 16027.029463743827, 16029.39094668504, 16024.396141672398, 16073.393898039, 16133.986062322503 … 16394.969947672107, 16491.78164823104, 16664.963092668848, 16815.538303686386, 16961.93709216138, 17064.462988951556, 17176.947114045393, 17264.2811911142, 17315.648535571243, 17394.289120639336], [15944.236265986641, 15944.133067376957, 15926.465980098299, 15921.61569222268, 15930.843017144158, 15946.459720873974, 15932.741685994624, 15911.730539853206, 15944.304491807807, 15988.286364063775 … 16214.193952940195, 16293.506711789638, 16448.018769771807, 16579.91349632526, 16707.412021280834, 16791.465807836124, 16885.122321598694, 16953.875225380336, 16987.18798146487, 17047.14534735823], [3173.2320350842083, 3176.328832623261, 3169.812505418424, 3175.79988653767, 3187.203414883235, 3193.7169953878015, 3200.0559690411083, 3202.922061047957, 3201.8820996101663, 3161.5506371240363 … 3196.480607055723, 3171.191195331479, 3187.6695546244737, 3196.118205956532, 3233.6731954358115, 3275.4021360033, 3296.388574855543, 3316.958366042016, 3323.706157919418, 3341.085307901693], [3173.2320350842083, 3173.128836474533, 3163.428860109712, 3166.211163415062, 3174.3790040762024, 3177.6618082616037, 3180.7612219977245, 3180.4027012918978, 3176.166991669497, 3132.9999136959054 … 3161.2352261110723, 3133.065070082584, 3146.1725042378603, 3151.333155190908, 3185.149793020109, 3223.002271400042, 3240.385147395822, 3257.3205709022886, 3260.658772539985, 3274.4061264419074], [34195.564496956766, 34348.875017480714, 35256.0160476186, 35938.61475516045, 35848.77498232537, 35075.17565320707, 34339.09275312866, 36162.751648593505, 36416.2773776814, 35913.58617917247 … 35224.0699607453, 35299.38662666884, 34591.307863211456, 35815.84917588855, 36256.60478187236, 36011.664075680135, 36230.681107294375, 36069.07954728127, 37229.50965492868, 38162.060955309236], [34195.564496956766, 34314.27020369691, 35185.014402864654, 35830.104950195106, 35704.52958676785, 34898.84866198973, 34132.04509059375, 35908.49569149499, 36123.80923724662, 35589.26467241761 … 34835.67850251247, 34874.99441792445, 34140.998563348156, 35313.98581533864, 35712.55047652663, 35435.5496801494, 35615.14617409933, 35420.56963562807, 36523.303049657996, 37400.44766117983], [33097.63671130043, 33415.168735732026, 34300.74767286616, 35013.424212749225, 34750.189640574165, 34463.91519384776, 33467.66340390085, 34772.42365788525, 35122.25105695135, 34418.094812113646 … 33596.4492368634, 33476.59841949259, 32579.150493400906, 33808.28149558242, 34222.4696383338, 33783.29791097826, 34014.80240762401, 33896.05499111419, 34897.87095850947, 35769.50628352131], [33097.63671130043, 33381.5045854195, 34231.66983100866, 34907.70784448132, 34610.36464368443, 34290.66108011831, 33265.87002723539, 34527.94292965742, 34840.17556230439, 34107.2785011664 … 33226.004426678424, 33074.12095735551, 32155.035438056984, 33334.548828168445, 33708.938874537394, 33242.832904581584, 33436.9137649674, 33286.61532967609, 34235.89320996502, 35055.64202074267], [29576.147776884885, 29605.974349916607, 29615.990299648598, 29630.10862521576, 29665.30818253035, 29721.56974971793, 29712.73431993542, 29700.700532182702, 29832.191883698742, 30047.48692882896 … 30558.480501890816, 30783.63920852624, 31138.58326295463, 31427.052688216176, 31686.016067169112, 31853.88331579168, 32044.470701315327, 32189.787584635174, 32289.184681153267, 32444.824938447473], [34346.71094688275, 34381.34847608993, 34418.60645464125, 34504.349224423226, 34590.03155968401, 34637.23688334656, 34564.18782929034, 34499.7750686547, 34663.90828090316, 35064.33714215768 … 35530.217294816204, 35972.89522900604, 36382.47839272967, 36752.92652699631, 37055.4971552363, 37134.32573683533, 37389.9832419812, 37580.35506525913, 37672.43840350182, 37852.07513243436], [28335.32931213966, 28363.90456052843, 28394.641625669512, 28465.377645245437, 28536.063807585757, 28575.0072276219, 28514.743262148637, 28461.604060920967, 28597.010581426286, 28927.35614689481 … 29311.697680090936, 29676.89786079777, 30014.795537310816, 30320.407620335194, 30570.022158525466, 30635.05411521768, 30845.96629282419, 31003.019127160343, 31078.985985160307, 31227.182587703435], [978.0617717704336, 979.0481149238879, 981.9664058959908, 990.2084268257204, 995.1693599892523, 999.397548044677, 995.4391501906252, 990.1614259213231, 997.5750275506274, 1008.178500769626 … 1009.464879799129, 1019.4241760096022, 1029.1273633066517, 1033.158490911722, 1044.601372218197, 1048.91896738565, 1054.4247022383618, 1061.3663491148611, 1064.3840606698516, 1071.5492174126675], [0.0019383188997990075, 0.0024203105379378975, 0.005833355382178551, 0.0022280272308012883, 0.0019675796320230976, 0.001501745967585455, 0.0034702473911871756, 0.0010822550340543469, 0.003433738363905592, -0.0005924275801507672 … 0.007843921739974613, 0.0034170053784130516, 0.005102995079565575, 0.000986351491279791, 0.0013211566671598174, 0.0032764035845953554, 0.00041887911038052117, 0.0015867627879866397, 0.0025339390114653693, 0.006166644580224201], [2.3548476e6, 2.3528300950060952e6, 2.3852989052506215e6, 2.4009903804299952e6, 2.390844258882871e6, 2.365089610515658e6, 2.337944418379484e6, 2.360462185597913e6, 2.372267610449629e6, 2.375237545415505e6 … 2.365255769520209e6, 2.385244935300158e6, 2.356426836189209e6, 2.380500387832769e6, 2.389395374279324e6, 2.3767106353966193e6, 2.374164851798615e6, 2.374943250220952e6, 2.411668256170708e6, 2.423393804407069e6], [0.0016459319014481277, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 … 0.008448725154931858, 0.008732908960778751, 0.0070151210972774665, 0.007523261785225643, 0.007364141082940806, 0.00637196785782434, 0.005804486516414908, 0.005443423710162449, 0.006619570517469309, 0.006749241942221222], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.6059091613057 258.50369622511613 … 137.13538556670355 505.4138092341076; … ; 571.082598293091 286.2689852502768 … 147.4596113318288 539.8357206223543; 571.2194431154359 285.9137343720301 … 147.931255679534 541.2157733905921], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.0834390395163 258.2432663779743 … 136.9972283642248 504.904629508617; … ; 560.2497319242387 280.8387485874332 … 144.6624498194047 529.5955763067793; 559.8194214485925 280.2076562509631 … 144.97894104760846 530.4145452155852]), BeforeIT.Data{Float64, Vector{Float64}, Matrix{Float64}}([72422.0, 72479.16835526338, 72637.95381913212, 72770.62345482089, 72941.9547118011, 73059.23885861166, 73388.62948391368, 73688.09671799063, 73857.89065861344, 74032.8647456291 … 74421.19527955227, 74525.56626754194, 74649.67283779455, 74777.82883517486, 75249.41755050291, 75463.6251954151, 75661.554078544, 76172.7545407525, 76824.81244545543, 77304.67894479225], [72422.0, 72406.14913344439, 72491.6691627559, 72550.9064119664, 72648.45678571238, 72691.96155981971, 72946.13252278218, 73170.00457334804, 73264.71965122763, 73364.30298953237 … 73600.60422944717, 73629.5713877803, 73677.8841432603, 73730.01750758171, 74120.25033147004, 74256.35855195604, 74376.11510218975, 74803.19404911705, 75367.52250259707, 75761.8830446516], [64900.920495538005, 64966.370940930225, 65105.47502242692, 65230.8743310351, 65381.092014447684, 65496.557266705655, 65795.28208904731, 66075.63573627333, 66220.35335812773, 66368.00697843758 … 66708.27509090463, 66787.74350275191, 66897.71313599695, 67036.74040243596, 67478.77052564117, 67651.75494545423, 67853.4706572401, 68369.67713350628, 68967.46674135036, 69395.69692393334], [64900.920495538005, 64900.920495538005, 64974.3599298187, 65033.92212518065, 65118.016874941575, 65167.29844867113, 65398.56923876066, 65611.06588914806, 65688.52130388662, 65768.66354567162 … 65972.7290774078, 65984.77776620894, 66026.83937534406, 66097.39973083902, 66466.2069983945, 66569.46255749093, 66700.68577294891, 67140.41334762302, 67659.22279688324, 68010.74328124234], [40512.94792630534, 40446.67433898797, 40519.2448806449, 40555.050249409556, 40688.48896565159, 40673.80356013209, 40809.82873484503, 40906.530351750436, 41091.70572058691, 41282.305132355876 … 41541.08290741968, 41705.02550883899, 41801.67374271298, 41702.70727737412, 41836.47490868108, 42114.81952262529, 42019.6202863649, 41897.25565055502, 42221.378551802, 42557.163628578004], [40512.94792630534, 40405.92629023928, 40437.64368592036, 40432.60199638415, 40524.76992118275, 40469.33161467332, 40563.76575034105, 40618.92145718323, 40761.68805747563, 40909.5008310521 … 41083.038116316035, 41203.62053887072, 41257.49997193102, 41118.35534101543, 41208.690966100105, 41441.06688122614, 41305.73516537432, 41143.95709396608, 41420.48118051532, 41707.83576816901], [14866.888022051655, 14971.465343249532, 15082.981035646268, 15079.407399134605, 15128.854901253048, 15166.469243519825, 15307.01925200293, 15267.214593485889, 15190.68631969529, 15069.361329763029 … 15194.917037765825, 15176.226183504667, 15166.773266077918, 15422.699209852093, 15289.462634022104, 15421.531049354278, 15498.584000850835, 15415.61493258115, 15391.120039353527, 15318.097154911786], [14866.888022051655, 14956.382323208549, 15052.605610927918, 15033.87799943402, 15067.980640957168, 15090.225637057534, 15214.725533607778, 15159.872644056415, 15068.686156587657, 14933.275839778269 … 15027.373196506027, 14993.76771139176, 14969.332363362028, 15206.591318169856, 15060.034147198534, 15174.817483994244, 15235.273470217113, 15138.44736402966, 15099.16586818519, 15012.388654325014], [15944.236265986641, 16143.224009137164, 15874.639597344449, 15958.603408990492, 16048.139821719185, 16024.555013770887, 16126.271322411503, 16320.909796008804, 16314.295520823825, 16408.94719109392 … 16530.29137514269, 16503.08753563427, 16343.395198928334, 16228.717536993201, 16665.383026279396, 16555.571601634758, 16516.201791563442, 16807.748188107533, 16898.308805319, 17062.959514065427], [15944.236265986641, 16126.960499475705, 15842.669861462638, 15910.419444326692, 15983.566617259994, 15943.997710249147, 16029.03792120573, 16206.159442351383, 16183.271374011829, 16260.764426757147 … 16348.023284619287, 16304.676672453394, 16130.637043656363, 16001.315453615622, 16415.30794505671, 16290.715662017545, 16235.602618274354, 16505.550532127083, 16577.76476896628, 16722.42819898984], [15944.236265986641, 15956.304400874531, 15979.538169552863, 16006.64485512596, 16041.64674101725, 16065.341795915701, 16126.276374604604, 16182.6727049168, 16237.9139810384, 16294.497527116888 … 16378.520219772592, 16410.443976421797, 16441.140716929334, 16467.5102418054, 16544.30767309427, 16620.336827941486, 16647.20852154302, 16720.484376885484, 16863.568607752488, 16984.152420815964], [15944.236265986641, 15940.22920358817, 15947.357179763376, 15958.315838462076, 15977.099662889983, 15984.579452492004, 16029.042942936618, 16068.894279619359, 16107.503273284792, 16147.348312793289 … 16197.925604813412, 16213.146934428127, 16227.110111481445, 16236.76211716203, 16296.04940752677, 16354.444774604932, 16364.383631918448, 16419.855694863236, 16543.683558241584, 16645.193885836317], [3173.2320350842083, 3172.4210319161384, 3170.356590522692, 3170.901963182559, 3175.4897526418995, 3175.9459318169766, 3181.0044655670035, 3185.0641111173018, 3200.598411853043, 3217.5006744292705 … 3236.9235352019014, 3252.3519222849127, 3264.009424893429, 3256.939364847195, 3243.6620829961607, 3272.942073586635, 3262.8744630320175, 3241.211404119942, 3258.050330500836, 3284.29765707208], [3173.2320350842083, 3169.2249726857435, 3163.971849487872, 3161.3280284070183, 3162.7124743197164, 3159.980081896143, 3161.8245896208537, 3162.6703084592136, 3174.893613526594, 3188.444688165194 … 3201.2322180592, 3213.250029934457, 3221.518582839009, 3211.302068165406, 3194.9887907240836, 3220.5815650478125, 3207.4404178182695, 3182.9355138638516, 3196.248370576281, 3218.751806169689], [34195.564496956766, 33498.53869986396, 33873.03221103654, 34039.30125059508, 33956.42404887237, 33909.586984423564, 34349.06236966598, 33708.26851372922, 33615.64171364014, 33809.598829593364 … 34666.89881279118, 35280.7795644775, 34807.766910524566, 33962.5679263053, 33819.8864229594, 34022.477856517246, 34759.03776433955, 35145.22397826064, 35615.83155788658, 35311.99449444974], [34195.564496956766, 33464.79055838485, 33804.815739937294, 33936.526061149925, 33819.79294164319, 33739.11954313402, 34141.954595298455, 33471.269732320885, 33345.66617167172, 33504.27760713216 … 34284.65089546307, 34856.61106194928, 34354.63974894768, 33486.67334710091, 33312.39668625025, 33478.18645072227, 34168.50506292995, 34513.32467882603, 34940.23481402606, 34607.26095082128], [33097.63671130043, 32580.73403597495, 32711.943905540087, 32861.73885330887, 32879.953025695126, 32715.175943234775, 33203.55219501166, 32514.826536983823, 32354.438616132793, 32537.347737177148 … 33511.99485356733, 34139.552524913524, 33469.936280449234, 32538.86311535005, 32361.789441439112, 32650.77483471632, 33131.88976457467, 33093.088208751964, 33301.82650890564, 32945.53584721264], [33097.63671130043, 32547.91053786385, 32646.065735492317, 32762.519089328336, 32747.65333533082, 32550.712945294345, 33003.35127767084, 32286.218702563907, 32094.592108519348, 32243.515715187434 … 33142.48126345754, 33729.10459688485, 33034.22498463685, 32082.917952320284, 31876.179413135647, 32128.427926004046, 32569.001214605905, 32498.08561983196, 32670.124129095744, 32288.03052765345], [29576.147776884885, 29605.97434991661, 29636.88998678263, 29699.496943366827, 29773.403175844327, 29824.680312928514, 29940.427544272665, 30056.781361623904, 30160.03334339023, 30256.405165750894 … 30410.544440268626, 30465.79587999467, 30525.02142801316, 30594.96018260858, 30767.257348560677, 30886.54546130514, 30964.318389601063, 31185.66300398519, 31496.803175662844, 31714.877903450706], [34346.71094688275, 34381.34847608993, 34488.331262615495, 34549.25195922109, 34623.58770293288, 34686.29543632627, 34863.88318564055, 35022.81053301597, 35064.82544472118, 35118.75704744281 … 35299.624656671636, 35320.42323982658, 35369.48286920612, 35437.606391965426, 35704.503275493276, 35759.86974837298, 35880.78074180786, 36166.36770262644, 36448.64548278309, 36652.05657188006], [28335.32931213966, 28363.90456052843, 28452.16315657334, 28502.421476879874, 28563.74693482529, 28615.479523685615, 28761.98576023339, 28893.097549410275, 28927.75898645526, 28972.25144821709 … 29121.463501660113, 29138.621904507847, 29179.095088579255, 29235.295592152168, 29455.48002549837, 29501.156225595794, 29600.90530555089, 29836.50866782224, 30069.382024185474, 30237.19198433616], [978.0617717704336, 979.0481149238879, 980.2537730287839, 982.1254284471187, 984.1011356705799, 985.5815174508662, 990.9713591341604, 996.0438416334068, 995.49457001638, 992.8447652439776 … 998.1059939644524, 1001.5243829306683, 1003.2088387777361, 1004.1738278619313, 1007.0099015872405, 1005.3397357761567, 1008.3715258311884, 1017.6464268947177, 1022.018082904454, 1028.7624486025907], [0.0019383188997990075, 0.003668404214827836, 0.001256999172604134, -0.0005987344696729568, -0.0026356803260687567, 0.0024380775912729025, 0.0036961082636601805, 0.003638784755598312, 0.005369794846580955, 0.004270287614935864 … 0.001686845822609806, -0.0008594111385530345, 0.001861309891668217, 0.002577048198165288, 0.0019943669381372597, 0.0038976198648799087, 0.005951729300666564, 0.004862661745621333, 0.0038180887092142957, -0.00016858591091106767], [2.3548476e6, 2.357984319675346e6, 2.3601713187344996e6, 2.3703876805778793e6, 2.3682741094139894e6, 2.374333096009323e6, 2.383499903305526e6, 2.3789693636357374e6, 2.373654210243939e6, 2.3831436073113782e6 … 2.382702279863015e6, 2.3889406911691315e6, 2.3832905008030995e6, 2.3686161227884884e6, 2.367379894382585e6, 2.356172856920746e6, 2.381155028189388e6, 2.3903663902730495e6, 2.393822204786214e6, 2.377759313633577e6], [0.0016459319014481277, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 … 0.0087110393134639, 0.008303938698170112, 0.007499249974261944, 0.00639757414658646, 0.005918372408352329, 0.005104029303479833, 0.005905638998158877, 0.005960514263642487, 0.0057490577832807165, 0.004659559015877111], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.6059091613058 258.50369622511613 … 137.13538556670355 505.4138092341076; … ; 565.5823469635296 275.1615057598491 … 143.92639607359007 531.1031026986665; 568.3001822164298 278.7917462532915 … 144.95044201381458 533.2542184775907], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.0834390395163 258.2432663779743 … 136.9972283642248 504.904629508617; … ; 554.8538148675563 269.9419668863854 … 141.19625612487482 521.0286074210744; 556.9584212371385 273.2278040833771 … 142.05761649904605 522.61188177521]), BeforeIT.Data{Float64, Vector{Float64}, Matrix{Float64}}([72422.0, 72491.34506965523, 72616.8572486508, 72706.27424685407, 72765.6895080302, 72839.34502218546, 72854.38189979833, 72871.19316389419, 72996.86544249773, 73415.76367274325 … 74740.55266740678, 75459.84952370377, 76084.34560541999, 76400.91663786885, 76766.78612612525, 77195.691255211, 77470.05991903284, 78024.3158167913, 78486.61778339028, 78816.3073416239], [72422.0, 72418.31358039126, 72470.61507839097, 72486.75149418158, 72472.9008235836, 72473.17315530752, 72415.10618607404, 72358.84456988142, 72410.60954181607, 72752.77471432764 … 73916.44028425583, 74552.62208234363, 75093.8803551431, 75330.36207458914, 75614.84978926343, 75960.71502885243, 76153.8956433556, 76621.46487653327, 76997.80505344228, 77243.34335689925], [64900.920495538005, 64966.370940930225, 65084.11883824959, 65159.24609436252, 65205.7785978623, 65263.8101552431, 65265.328483333884, 65275.29560038312, 65403.07019586164, 65819.15435136238 … 67069.55823738292, 67747.93184098444, 68288.6611438264, 68570.6241424417, 68918.49248885174, 69285.29560917999, 69568.02703668243, 70068.80565775071, 70482.79829236539, 70790.97631313166], [64900.920495538005, 64900.920495538005, 64953.04675459051, 64962.510156331446, 64943.40887027418, 64935.72138403253, 64871.81098989886, 64816.35284848654, 64877.80194505949, 65224.76739133941 … 66330.02860449604, 66933.42209508002, 67399.68003591667, 67609.79019157986, 67884.32498248757, 68176.8698470389, 68386.11299129862, 68808.99211282273, 69145.81002221679, 69378.1766027696], [40512.94792630534, 40514.85625555158, 40534.99561605159, 40619.68124994838, 40684.6514706836, 40772.69496024656, 40840.58993745727, 40916.807813341584, 40881.29700042157, 40808.931206252826 … 41085.42315577037, 41254.88011649212, 41795.86451626988, 41988.98088550205, 42068.44487840772, 42446.479880918516, 42335.219457437495, 42591.85258455617, 42847.33027719243, 42931.69516489957], [40512.94792630534, 40474.03951685235, 40453.362701120255, 40497.03785592179, 40520.947867215924, 40567.725876207056, 40594.34147818995, 40629.12665917816, 40552.969181840126, 40440.40175915628 … 40632.40260961061, 40758.88708751122, 41251.76636993975, 41400.61758997374, 41437.180073195086, 41767.421339007975, 41615.97251854175, 41826.06540885222, 42034.559227011305, 42074.892650606955], [14866.888022051655, 14893.816197932156, 14915.87476254503, 14976.230110256563, 15113.643097291955, 15186.730635672791, 15175.747982624049, 15119.41241999583, 15261.47819545435, 15306.533310010407 … 15632.2002442684, 15632.290919565703, 15619.461539849639, 15672.690419767117, 15683.449436742068, 15821.69540421272, 15864.070807918119, 16087.291460026425, 16166.69560157345, 16206.157107623332], [14866.888022051655, 14878.811405612245, 14885.835871036297, 14931.012234735996, 15052.83004502004, 15110.385172833405, 15084.245764740483, 15013.109649870183, 15138.909485264192, 15168.306012922092 … 15459.834783518783, 15444.349340261319, 15416.127545712525, 15453.079569713042, 15448.108917681695, 15568.580011796703, 15594.55090195679, 15798.047373556072, 15860.029536802456, 15882.725291024924], [15944.236265986641, 16017.839938624484, 16016.226588308371, 16314.013885250739, 16184.64269428929, 16261.849941220187, 16202.38292439611, 15749.438147973837, 15537.401473543716, 15889.046677718177 … 16286.993728326213, 16575.6212251805, 16669.356328026694, 16689.727677532203, 16810.76809966672, 16852.603268991297, 16960.470669125232, 17084.142371618796, 17187.375369808007, 17260.048989022165], [15944.236265986641, 16001.702747289586, 15983.971712176435, 16264.756826319815, 16119.520240633734, 16180.099728473888, 16104.690608058321, 15638.705742735772, 15412.616755187531, 15745.558930944415 … 16107.408312687847, 16376.338314758692, 16452.354814035632, 16455.865769699772, 16558.5114193786, 16582.9954184618, 16672.32366605457, 16776.97524123598, 16861.348029509223, 16915.584291930514], [15944.236265986641, 15955.993198124865, 15967.68604475641, 15992.783755834507, 15994.908676447314, 16012.193694251553, 16021.620974552232, 16013.135069096623, 16065.666631566693, 16115.838123438101 … 16326.538963528297, 16465.95758109455, 16635.616957444094, 16738.07568205136, 16817.074576379546, 16920.159532386355, 16979.347598932483, 17090.742129533068, 17187.57242815591, 17255.664653566833], [15944.236265986641, 15939.918314360073, 15935.528923811127, 15944.496590120933, 15930.549659156537, 15931.698532522014, 15925.018562932064, 15900.548642524245, 15936.639284925881, 15970.302312095457 … 16146.517509931131, 16267.993118401726, 16419.054662241895, 16503.53630621015, 16564.723263242384, 16649.470917142167, 16690.87988950542, 16783.45633772402, 16861.54134985713, 16911.287456156417], [3173.2320350842083, 3172.1098291664734, 3168.958009817899, 3181.6590031324145, 3187.2201214827874, 3192.255150237209, 3198.713466214704, 3204.6058529272427, 3210.093316866742, 3176.477959568255 … 3157.3910130333516, 3163.9948906327, 3217.1999068728664, 3256.337688080505, 3266.923650876273, 3285.2835017983743, 3287.808693325822, 3294.9653285740555, 3310.631432632405, 3318.523140389809], [3173.2320350842083, 3168.9140834576488, 3162.5760853670668, 3172.052589522756, 3174.395643453095, 3176.2073119767597, 3179.4268137961376, 3182.07465463302, 3184.3122626071636, 3147.792433347594 … 3122.576646007332, 3125.9552840442484, 3175.3184306559633, 3210.708822289822, 3217.9013034119034, 3232.725555161747, 3231.9510322895585, 3235.722960846521, 3247.8320617298123, 3252.294239818725], [34195.564496956766, 34813.13772180637, 35431.398672231786, 35461.204277101475, 34708.88319045346, 34383.22110618844, 35624.52113331468, 34625.680409143286, 34449.96121311535, 34717.59067150894 … 36940.07592895353, 37536.90786859335, 37706.41979136843, 37766.419706077875, 37128.097565573175, 37558.68128786886, 36688.03451998889, 37262.40494634699, 38083.288642234766, 38931.03499871195], [34195.564496956766, 34778.0651860252, 35360.04382662861, 35354.13592218129, 34569.22439911026, 34210.372651031495, 35409.7229765141, 34382.23141504684, 34173.285044665965, 34404.0697309572 … 36532.76325971144, 37085.614722673454, 37215.55799557421, 37237.2243150498, 36570.96593531228, 36957.81771984214, 36064.729459550195, 36592.43944561771, 37360.88670251401, 38154.07502676603], [33097.63671130043, 33748.30504425906, 34281.638390486114, 34664.85527570327, 33926.13094468807, 33765.15162114269, 34988.86007799359, 33540.145626560436, 33133.272440037195, 33306.33819274716 … 35204.140389912, 35539.850606128086, 35706.756570094796, 35716.90205101044, 34923.97385426452, 35483.76858678062, 34377.735535436994, 35001.37554575726, 35798.07210741861, 36512.628918633054], [33097.63671130043, 33714.30527538799, 34212.59903257067, 34560.19134497737, 33789.62172839645, 33595.41027323845, 34777.89464142863, 33304.32889694959, 32867.170925141756, 33005.561719652374 … 34815.96868127321, 35112.56738286124, 35241.926370119225, 35216.42516984729, 34399.91655630437, 34916.09946025637, 33793.680902747794, 34372.06259272883, 35119.01844239496, 35783.93390342912], [29576.147776884885, 29605.97434991661, 29645.257717275123, 29679.612523018488, 29666.610630549, 29675.465639859736, 29688.510211608693, 29678.517852359637, 29769.050549396445, 29935.238588280696 … 30476.5080720758, 30784.122714606536, 31075.7158314089, 31225.178787932935, 31384.96520976678, 31572.42806869719, 31690.89472684231, 31899.256780858504, 32088.41230189144, 32231.812683256183], [34346.71094688275, 34381.34847608993, 34454.54241060659, 34491.06342781957, 34544.52190934012, 34591.912318521834, 34582.97982005186, 34596.867531354714, 34641.929354891545, 34889.25752460169 … 35576.16792752258, 35933.934464656246, 36176.7426293888, 36307.49391661053, 36491.21247843129, 36670.26171257435, 36829.95617224512, 37116.16438090773, 37336.3691967681, 37494.53422904817], [28335.32931213966, 28363.90456052843, 28424.288049398387, 28454.41713660981, 28498.519283122594, 28537.615394901026, 28530.24626758871, 28541.703343457397, 28578.878420025754, 28782.91906740372 … 29349.606005923073, 29644.756032434303, 29845.067768775323, 29952.93488848712, 30104.49891911569, 30252.21085055437, 30383.955491579625, 30620.071370530437, 30801.73580946819, 30932.218704387935], [978.0617717704336, 979.0481149238879, 984.3187103678514, 988.5701435243803, 994.6460579733008, 996.4321968615352, 993.8384516733977, 999.9102166687564, 992.0902915737332, 994.6582384799905 … 1016.8822377846128, 1029.8746617216543, 1036.2026830287746, 1037.9514378982667, 1042.3148006537317, 1042.6058279083848, 1047.1761375949943, 1053.3844959844332, 1058.0167937058611, 1064.6294008272507], [0.0019383188997990075, 0.005308128238052712, 0.0021088541566325336, 0.006923601323287176, 0.01057633466285135, 0.008402500604969498, 0.004741980271950164, 0.006569049323305265, 0.0022985954729253244, -0.0031905630125552698 … 0.0039679164614467854, 0.008243130157091105, 0.004922016662823658, 0.006917503659251478, 0.005736168202625125, 0.003541467247938801, 0.008585740611248394, 0.0048877168301537655, 0.007482395413037191, 0.005201812639647141], [2.3548476e6, 2.3840021873592413e6, 2.3878512601016425e6, 2.398851084605381e6, 2.4004329577815593e6, 2.3928274893141e6, 2.4051904066505027e6, 2.3962041918615783e6, 2.3917846727152127e6, 2.411605637434065e6 … 2.4439064199785264e6, 2.468043488339714e6, 2.466665632276356e6, 2.4702408945817263e6, 2.457778373694759e6, 2.447189414183631e6, 2.420935822117334e6, 2.4321838408571035e6, 2.44295846814239e6, 2.4747796365824407e6], [0.0016459319014481277, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 … 0.00994740454800224, 0.010371575392789859, 0.00966177343640167, 0.009247791054075406, 0.008198549791098915, 0.007249086514876012, 0.005854228662475012, 0.005989979684488085, 0.006153965541550509, 0.007098943345674474], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.6059091613058 258.50369622511613 … 137.13538556670355 505.4138092341076; … ; 564.4844959774833 284.3466912583684 … 146.64180466629344 536.6865941342371; 565.0865714365776 285.01219253258085 … 147.32664903242076 538.5646354043912], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.0834390395163 258.2432663779743 … 136.9972283642248 504.904629508617; … ; 553.7767890179489 278.9529185921488 … 143.8601561293128 526.5061856021143; 553.8089455860217 279.3241067901476 … 144.38640074200407 527.8163168963247])])
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, 72458.63063173035, 72714.7993073847, 73025.94784345852, 73170.08974424793, 73488.94581643856, 73736.47411998946, 74215.95259231319, 74315.10367343524, 74689.18028783813 … 75172.58090642745, 75228.81699975023, 75598.1201305265, 76403.05467531475, 76935.02128673751, 77443.49876715624, 77857.59775246747, 78271.96742728617, 78684.79761409517, 78745.95566326432], [72422.0, 72385.63210066463, 72568.3598928517, 72805.4598972233, 72875.67386690396, 73119.50833074616, 73291.87982858339, 73694.1491565101, 73718.26067511964, 74014.69160357275 … 74343.70484667894, 74324.36718181372, 74613.98455861978, 75332.47015315716, 75780.56047015703, 76204.55811764165, 76534.84946933789, 76864.66379441545, 77192.22561074348, 77174.39571103048], [64900.920495538005, 64966.370940930225, 65187.0333275795, 65473.4463740019, 65604.67546210511, 65897.04291360846, 66115.53089261762, 66552.03912562672, 66627.47716100705, 66976.25803693687 … 67426.62415519402, 67485.51157561327, 67850.01019928801, 68610.97758355155, 69105.71914574139, 69561.10848322994, 69950.78346788613, 70332.03139881173, 70685.2981040959, 70730.30248547599], [64900.920495538005, 64900.920495538005, 65055.75398573217, 65275.76176804663, 65340.70068564175, 65565.77080760525, 65716.88710121115, 66084.11974357393, 66092.37539469957, 66371.42172749744 … 66683.15740338102, 66674.15681699573, 66966.73944498798, 67649.57818711115, 68068.7421797114, 68448.27026831036, 68762.36664786185, 69067.48514364476, 69344.46861481928, 69318.71366343043], [40512.94792630534, 40319.37525231505, 40466.0852258405, 40613.16803131025, 40686.46819913686, 40815.29155764575, 40944.62291154861, 41108.54017572659, 41202.548443010375, 41309.34175083407 … 41424.931067174024, 41408.0525600783, 41337.38494343024, 41470.82854183544, 41672.285344959695, 41971.28482462056, 42069.92170115199, 42257.978345198026, 42625.707394796336, 42718.4896134155], [40512.94792630534, 40278.75545117816, 40384.59108867232, 40490.54430270733, 40522.75728566462, 40610.108335552424, 40697.74718515263, 40819.51097438523, 40871.64057455023, 40936.29329243609 … 40968.16700208151, 40910.21799225321, 40799.25527959479, 40889.725765950134, 41046.96517524384, 41299.82845049775, 41355.181992915444, 41498.19411595635, 41817.14030928934, 41865.942115186626], [14866.888022051655, 14940.59628379265, 15121.746648645383, 15093.457969701507, 15163.548483205472, 15283.726403855002, 15445.043604555773, 15851.458014057147, 16037.646850636662, 16253.975224072246 … 16419.0428115477, 16578.431361915278, 16662.94762439557, 17052.59631404882, 17117.211873657856, 17202.230268219293, 17261.607399715904, 17286.713469432103, 17253.804014017638, 17056.029435014083], [14866.888022051655, 14925.54436282125, 15091.293154349374, 15047.886146978155, 15102.534625686154, 15206.893331997435, 15351.917667913744, 15740.008319411827, 15908.844537794263, 16107.191950769253 … 16238.001381994814, 16379.114666200048, 16446.029538844316, 16813.649772526293, 16860.356802108658, 16927.02908695957, 16968.34428588822, 16975.90417888339, 16926.51658870146, 16715.63642589483], [15944.236265986641, 16083.080452818574, 15860.9310910651, 16097.858896678581, 16035.852193825702, 16169.704034620892, 16229.851103281786, 16723.826857934848, 16139.715523337365, 16294.203893274376 … 16600.309713185743, 16222.566407222244, 16441.643665884276, 16678.937149425405, 16778.75724686978, 16895.9591017203, 17010.733375331292, 17096.714939558096, 17458.87384317076, 17285.02221434602], [15944.236265986641, 16066.877534852347, 15828.98896257068, 16049.2544765823, 15971.328431327865, 16088.417050074106, 16131.993167477192, 16606.24364287886, 16010.093471711894, 16147.057330642794 … 16417.269578874006, 16027.528151688824, 16227.606513051982, 16445.22644199235, 16526.98091057381, 16625.657644827246, 16721.732442647335, 16789.32175863484, 17127.696448063638, 16940.05911806081], [15944.236265986641, 15945.700682630479, 15993.931032538732, 16049.088158098912, 16089.199605644148, 16141.566892099283, 16206.551474614625, 16279.912371513741, 16304.538492096417, 16358.71070409274 … 16461.38988019368, 16493.37214681648, 16553.09925129602, 16664.409065771408, 16790.936160378144, 16900.254099385253, 17006.148913226392, 17102.169784977345, 17208.47684997033, 17245.780447864843], [15944.236265986641, 15929.6361680723, 15961.721057144538, 16000.630991962398, 16024.461188153955, 16060.421356243482, 16108.83402399082, 16165.450265816675, 16173.592706398023, 16210.981605760708 … 16279.881518802375, 16295.078088365504, 16337.611170767346, 16430.901930585074, 16538.977071439767, 16629.883931144162, 16717.225867473877, 16794.67852776921, 16882.049235673567, 16901.600512925983], [3173.2320350842083, 3161.817313672086, 3161.011066414634, 3165.04106039098, 3171.3372985736114, 3170.6204328400604, 3188.5067143995648, 3197.251739874131, 3216.892703232896, 3211.7404876888277 … 3220.176231467536, 3226.95426952854, 3215.4026966725532, 3197.974230390733, 3217.559577722389, 3231.1378148306476, 3253.0447666585583, 3263.696889845246, 3294.180137666697, 3318.5154029489545], [3173.2320350842083, 3158.631937169875, 3154.645146212599, 3155.4848214955728, 3158.5767285595957, 3154.6813548225423, 3169.281603621613, 3174.7722474642114, 3191.0570414178483, 3182.736519411302 … 3184.669575260567, 3188.1577242954277, 3173.544616520076, 3153.163172405358, 3169.2779707848986, 3179.4460905838687, 3197.7777213828763, 3205.01671812304, 3231.6928313944873, 3252.286656796616], [34195.564496956766, 32640.00069243555, 34052.497475636264, 33889.60224221749, 34042.99144932922, 33645.517403584905, 34331.01558303408, 33933.090075669395, 34616.29959950118, 33533.71544977325 … 33194.253588281106, 32983.01922076771, 34067.31502257016, 33764.073883252684, 33301.64095824034, 33448.957274669665, 33229.38448057876, 33049.64105592808, 33271.19539380034, 34746.687381732256], [34195.564496956766, 32607.117486062987, 33983.91958171077, 33787.27904042717, 33906.01201920964, 33476.377470819396, 34124.01662182047, 33694.51060090113, 34338.287526284585, 33230.88562187743 … 32828.24351135161, 32586.475889117064, 33623.827056266535, 33290.96066732159, 32801.927837074996, 32913.84104785682, 32664.839560879554, 32455.419632194364, 32640.07405564319, 34053.235865372146], [33097.63671130043, 31524.42204963123, 32786.461133802484, 32668.13929644921, 32758.77058124929, 32425.29358326801, 33214.05908243095, 33400.96253107459, 33681.10674305018, 32702.0560301157 … 32465.956273761396, 31963.252550233265, 32911.17112575374, 32563.381213247816, 31934.87413699025, 32074.93270207372, 31714.049204310675, 31419.080382830623, 31924.783031690058, 33060.272981243514], [33097.63671130043, 31492.66273425001, 32720.43289445131, 32569.504069471535, 32626.958494984265, 32262.287857697233, 33013.79481378086, 33166.12438106677, 33410.60543522122, 32406.73659215267 … 32107.976627623353, 31578.969517445305, 32482.733829137876, 32107.092494633464, 31455.67025484432, 31561.7981124999, 31175.24881299291, 30854.175891253977, 31319.201790954376, 32400.477813483845], [29576.147776884885, 29605.974349916618, 29673.37253757367, 29809.249360949187, 29886.497471319253, 29999.054087198103, 30094.731368669665, 30217.99850585117, 30213.97359534498, 30338.831796714898 … 30512.519232477014, 30583.171153001287, 30726.756718722118, 31001.07520435412, 31248.468384139127, 31447.433991263155, 31633.096202894496, 31824.132579897807, 31992.82479910257, 32033.27846867225], [34346.71094688275, 34381.34847608992, 34532.62872432414, 34679.266255959665, 34732.72335492341, 34907.82708747399, 35029.15675475091, 35330.38153751034, 35402.66141351677, 35617.09364839709 … 35891.31063670614, 35883.42351453006, 36101.28795254398, 36572.41345003055, 36814.58360745446, 37063.21260091461, 37266.536366683154, 37455.26434454815, 37637.438236541115, 37640.75547889441], [28335.32931213966, 28363.904560528426, 28488.707650372107, 28609.680594618138, 28653.781600550024, 28798.238574415114, 28898.333051669153, 29146.83729504972, 29206.46670446974, 29383.368882959803 … 29609.592252025224, 29603.085538630465, 29782.819214034647, 30171.488048709176, 30371.273442157504, 30576.387242344495, 30744.125162547272, 30899.82185826551, 31050.111568091805, 31052.8482247293], [978.0617717704336, 979.0481149238879, 981.0320656816637, 984.9307570930322, 985.4546358624658, 990.161738936401, 991.6427691971356, 1003.6590822652624, 1010.8421521453376, 1020.3325918248503 … 1022.7942860109519, 1018.9169080818388, 1021.9655280219037, 1037.4889291669324, 1042.6671541477833, 1050.4618910521606, 1051.1508983085075, 1052.6344743657646, 1055.0350684522741, 1056.2685379092702], [0.0019383188997990075, 0.002318069620665719, 0.003049541140922596, 0.002224369592188191, -0.0022251584479866526, 0.004366924925378823, 0.006068540028211, 0.002763470029782056, 0.0021042695860895577, 0.006527435992621067 … 0.0016670645613094948, 0.0056211649437434286, 0.004403830502085482, 0.0033734120185084926, 0.010405043693178406, 0.0034987674088711174, 0.009835632205891676, 0.005539796592840762, 0.004137709755095864, 0.007862292319288144], [2.3548476e6, 2.328642066464245e6, 2.367136786703873e6, 2.3785683790057097e6, 2.3853441679808004e6, 2.361219699143722e6, 2.3811604460283155e6, 2.3742624887050353e6, 2.3831894560849294e6, 2.3628660285500544e6 … 2.354728150940062e6, 2.367293693829456e6, 2.395702092902069e6, 2.3763293025443605e6, 2.3710765337988767e6, 2.3591676693399525e6, 2.3625614890307123e6, 2.3635673623363497e6, 2.3803493785910932e6, 2.4021938404081287e6], [0.0016459319014481277, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.0, 0.0006538730501113249, 0.0018868794777280042, 0.0010292157403429853, 0.0009743747837785542, 0.000488510365717588, 0.0008195501302721295, 0.0009278809694580809, 0.0016525234320153488, 0.0026132549358040356], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.6059091613058 258.50369622511613 … 137.13538556670355 505.4138092341076; … ; 575.4194435292623 279.69747214608435 … 145.5520215884953 537.3581543186674; 575.9997351272681 280.97917111355696 … 146.15790453342944 538.914856855408], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.0834390395163 258.2432663779743 … 136.9972283642248 504.904629508617; … ; 564.5043115388589 274.39189052177954 … 142.79104514778925 527.1650069607444; 564.5043115388592 275.3715737580535 … 143.24098127645127 528.159548858138]), BeforeIT.Data{Float64, Vector{Float64}, Matrix{Float64}}([72422.0, 72493.85075968767, 72417.55656866034, 72507.8207808218, 72478.6040433599, 72611.16320000871, 72761.62834931223, 73034.45077637117, 73146.85475810623, 73190.84660272078 … 73360.97294699746, 73603.74775187737, 73844.82900888959, 74070.90125414853, 74528.88728996839, 74981.9120458045, 75440.02724381795, 75997.91578722364, 76272.09831019101, 76632.45155768651], [72422.0, 72420.8167460634, 72271.71576751892, 72288.89722060681, 72186.97051014043, 72246.13842971431, 72322.9118933984, 72520.95433772191, 72559.39425609284, 72529.88878212262 … 72552.07223529615, 72718.83557448874, 72883.51776327213, 73032.99562639641, 73410.53210346708, 73782.35184655289, 74158.35185957013, 74631.49883753706, 74825.29280230863, 75103.07152927545], [64900.920495538005, 64966.370940930225, 64881.93501873867, 64960.895494976765, 64935.73948592265, 65063.900988683075, 65191.5100891974, 65445.10906422269, 65543.2286607931, 65580.79444821177 … 65726.29563841161, 65957.73447525573, 66186.7217213428, 66425.03870665304, 66857.20319614936, 67291.06220811843, 67688.65513012966, 68198.36385590868, 68456.96457154857, 68803.22778611373], [64900.920495538005, 64900.920495538005, 64751.270110516234, 64764.758438816956, 64674.45631982898, 64736.81718412491, 64798.43768399093, 64984.97237428725, 65016.834762655184, 64988.56002295819 … 65001.57723319344, 65164.74764764365, 65325.10363981647, 65494.26939873367, 65853.96669728041, 66214.54018050042, 66538.67035092563, 66972.18022510347, 67158.40434324302, 67430.09825251023], [40512.94792630534, 40552.638029447255, 40588.382508019604, 40599.6919466688, 40617.796937594176, 40672.15389340288, 40779.51509040722, 40849.56167784617, 40943.70484983592, 40981.94205363264 … 41111.9326718379, 41134.770773190496, 41189.69321356018, 41029.30554365212, 41161.02313563171, 41275.6289338923, 41624.4278719947, 41868.79733564938, 41945.063952438046, 41980.37402914137], [40512.94792630534, 40511.7832274563, 40506.64207790183, 40477.108906537745, 40454.36233797883, 40467.69024101069, 40533.63488211301, 40562.353323172836, 40614.87581836335, 40611.850213451056 … 40658.61982357872, 40640.22177693566, 40653.48619918732, 40454.38953202696, 40543.37479309933, 40615.301658723205, 40917.256804644574, 41116.01044998533, 41149.40799305878, 41142.55735591296], [14866.888022051655, 14900.2916735275, 15033.203978149442, 14996.975221685181, 14780.30972912565, 14907.279078461826, 15131.762434209306, 15166.157698772913, 15237.079907003548, 15279.153038623861 … 15346.255614516302, 15365.583848180642, 15412.774648068182, 15498.955952313097, 15499.490055459488, 15376.17261982661, 15550.806191352216, 15560.390667904887, 15398.142661655422, 15571.44850066224], [14866.888022051655, 14885.280357482226, 15002.928798817537, 14951.694710250282, 14720.837916646957, 14832.33845113236, 15040.525427321569, 15059.526268214797, 15114.707145509052, 15141.173002024318 … 15177.043067437598, 15180.8487949361, 15212.131301821528, 15281.779526283228, 15266.909968436219, 15130.184698362309, 15286.608440783426, 15280.62008035485, 15106.055278357817, 15260.683780673873], [15944.236265986641, 16583.178904209766, 16344.953849972942, 15916.720779815592, 15610.781054444404, 15910.971271389073, 15753.818760150283, 16114.03689274958, 16141.720941512309, 16140.504932160555 … 15937.490383057784, 16000.25487725652, 16224.092711215864, 16200.951472743875, 16344.50837755799, 16532.008306648833, 16445.264275026744, 16718.87575947478, 16861.48154824455, 16662.62706072532], [15944.236265986641, 16566.472161481444, 16312.036954166917, 15868.663271776619, 15547.967658749014, 15830.984966562888, 15658.831062783414, 16000.741037591795, 16012.082783876967, 15994.746364545925 … 15761.75869908866, 15807.889395678918, 16012.88763453602, 15973.938456514943, 16099.248232404636, 16267.529332489858, 16165.870282489726, 16418.275999852278, 16541.6360881676, 16330.085317253197], [15944.236265986641, 15960.271184500985, 15936.930157099692, 15942.055413670609, 15938.970882806178, 15980.260170457288, 16016.718983437442, 16063.76840379867, 16083.899130785714, 16096.338382971022 … 16150.403524514415, 16178.496717602075, 16222.654595777529, 16247.2319770908, 16339.701688763045, 16421.579120221515, 16557.21088413881, 16666.969479003812, 16734.38637541181, 16817.78643427251], [15944.236265986641, 15944.191990873882, 15904.834975047524, 15893.921412528125, 15874.836943476223, 15899.925542269351, 15920.14612838738, 15950.825980340283, 15954.725354429227, 15950.978666134195 … 15972.324194586734, 15983.988296570169, 16011.46824047008, 16019.57046333985, 16094.51367115029, 16158.866791554226, 16275.914993915765, 16367.302976835756, 16416.951783793364, 16482.148122149632], [3173.2320350842083, 3176.387815542594, 3179.151896475605, 3180.0263790744316, 3179.0534991691793, 3185.7029355505124, 3194.478345262231, 3200.5322900389037, 3199.6727270725196, 3200.4563683803226 … 3220.6588606739633, 3212.7214985063383, 3210.716899030684, 3184.946436038387, 3197.9702358224463, 3183.8371213737546, 3221.129159911762, 3242.2602790503215, 3247.7726470374405, 3258.75780276747], [3173.2320350842083, 3173.187759971456, 3172.7494426853814, 3170.4248948622853, 3166.2618813325257, 3169.6880360360606, 3175.217228518124, 3178.0297324753683, 3173.9753631497547, 3171.554302557169 … 3185.1468828485226, 3174.096068913127, 3168.9198185450527, 3140.317927756694, 3149.9825799006053, 3132.9021133498627, 3166.4043393546485, 3183.96553037598, 3186.1656445006347, 3193.721659466875], [34195.564496956766, 33824.20053060592, 34072.58741446132, 34870.901404813165, 35583.47016504347, 34861.93587256541, 35043.28065694434, 34756.26199373036, 34152.47487221296, 33378.02155145942 … 34849.937940914526, 34797.362001584064, 34334.450352642794, 35393.88725355603, 35146.63174844114, 34357.57279479318, 36036.997880068135, 35892.73198296672, 36674.44822145825, 37979.42997580978], [34195.564496956766, 33790.12430073953, 34003.96906166213, 34765.61535702915, 35440.29228150927, 34686.68086254925, 34831.987091335715, 34511.89489621929, 33878.18789022613, 33076.597734075774 … 34465.67177771192, 34379.005459740496, 33887.48482128356, 34897.93656109119, 34619.233321694344, 33807.92054209594, 35424.75349479243, 35247.3927411723, 35978.77057706518, 37221.46151056086], [33097.63671130043, 33366.458378102565, 33621.57118194306, 33876.46857216108, 34113.75384284742, 33741.17691581043, 33946.74859239856, 33851.567486727836, 33328.12581245853, 32588.77497315582 … 33884.643663329, 33694.22374833428, 33316.181916597576, 34052.198968116456, 33622.76602712206, 32559.47060935635, 34217.46897462387, 34042.879958772, 34607.038073605785, 35561.42800865234], [33097.63671130043, 33332.84330109606, 33553.861125029485, 33774.185024987, 33976.48968474333, 33571.55609154088, 33742.066570155155, 33613.56118747666, 33060.45938188268, 32294.478531974593 … 33511.02113252073, 33289.129852802354, 32882.47219355647, 33575.04844951975, 33118.23421216751, 32038.58438511833, 33636.13716314003, 33430.800433827586, 33950.57713434124, 34851.716435125636], [29576.147776884885, 29605.974349916607, 29543.04891432024, 29540.675826771752, 29553.691210451867, 29660.501470190462, 29704.713060190825, 29786.152135079643, 29830.83158092893, 29843.182370753497 … 29932.978329420752, 30008.335910015398, 30113.26478406185, 30216.35640235909, 30417.92614688064, 30633.713252801826, 30858.097335158334, 31062.838687145446, 31212.376446467104, 31403.740896227457], [34346.71094688275, 34381.34847608993, 34357.54497734817, 34434.70140669193, 34392.519901679574, 34419.08127448162, 34500.00983161686, 34666.22857128488, 34718.16066893402, 34744.14854393934 … 34800.969787470975, 34951.27821892308, 35072.745248092666, 35206.822834176055, 35429.4509701756, 35644.33344647184, 35816.47052677426, 36113.49649173745, 36220.720571061196, 36370.547157727065], [28335.32931213966, 28363.90456052843, 28344.267164194556, 28407.919629706765, 28373.12075661364, 28395.033342260995, 28461.79773553084, 28598.92477321506, 28641.767684463077, 28663.207146236786 … 28710.083502167465, 28834.08486317618, 28934.292661163316, 29044.903908945522, 29228.567537100505, 29405.841155487968, 29547.85070233344, 29792.89100748824, 29881.348665123292, 30004.952514104833], [978.0617717704336, 979.0481149238879, 981.3411270702462, 985.5182615130244, 989.5283737913029, 984.3182440110619, 986.7871973899012, 992.7283578580688, 994.2364109301864, 993.463533518988 … 992.3475215199541, 998.1203463172297, 1000.7116891883217, 1001.8594701178567, 1009.8260790930674, 1013.0155088447548, 1014.0872681970775, 1022.028677025807, 1023.8675540202197, 1028.9397321592878], [0.0019383188997990075, 0.007334852166847261, 0.007227192998082499, 0.0063674479719377786, 0.003446090841553895, 0.0032265409708780446, 0.004191283899704468, 0.003501817474909741, 0.004415694838464823, 0.0046011977677848925 … 0.002086119804288522, 0.006859705088374524, 0.008520942457468372, 0.004944710234454197, 0.004168679591690649, 0.0022241218191243473, 0.004868606894425476, 0.006639637258123665, 0.004286522959381589, 0.004377407679346135], [2.3548476e6, 2.356405005831464e6, 2.365298482338747e6, 2.3716322680014824e6, 2.3787332008662736e6, 2.362896213451429e6, 2.369694317142983e6, 2.373800261204282e6, 2.3834952447609566e6, 2.3920620330929896e6 … 2.3912146652818676e6, 2.3829984989281846e6, 2.371252574860364e6, 2.3939898499252107e6, 2.3817141689064708e6, 2.3613617196600707e6, 2.3985788113046456e6, 2.390330330322664e6, 2.397856469942553e6, 2.4212965359402793e6], [0.0016459319014481277, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.00012203427994020283, 0.0, 0.0, 0.0010566170841607668, 0.0005696944214650553, 0.0, 0.0016619619797324792, 0.0013530380463096917, 0.0016609294841850044, 0.002599928627965536], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.6059091613058 258.50369622511613 … 137.13538556670355 505.4138092341076; … ; 552.4170182477764 274.31944109496715 … 143.1976227942744 526.6241123245321; 553.8992060451629 275.54076932849296 … 143.83576018760857 527.9502176588696], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.0834390395163 258.2432663779743 … 136.9972283642248 504.904629508617; … ; 541.9382192851673 269.1158753469619 … 140.48130694661234 516.6345790197564; 542.8448502695214 270.04170801623934 … 140.96518075904015 517.4137347137171]), BeforeIT.Data{Float64, Vector{Float64}, Matrix{Float64}}([72422.0, 72471.48547557522, 72659.66132674892, 72782.26820482507, 73314.99324853392, 73791.49697545379, 74099.86403964799, 74407.78021309954, 74915.74285060994, 75465.19426916225 … 76706.69449860377, 77138.16929479428, 77511.67199300523, 77707.63738956318, 77907.54721424257, 78252.95009649772, 78845.89268304282, 79393.7054463342, 79944.03307890503, 80623.14486458048], [72422.0, 72398.47399388226, 72513.33295389768, 72562.51600286494, 73019.99432021253, 73420.5385298642, 73653.07868763371, 73884.62806036828, 74314.07597034199, 74783.6977070866 … 75860.90282927844, 76210.76400042625, 76502.62582208758, 76618.77262890358, 76738.49300368334, 77001.05984925466, 77506.3539329534, 77966.23334138824, 78427.57463678236, 79014.12120583994], [64900.920495538005, 64966.370940930225, 65146.025314054816, 65251.369137512185, 65758.27213955988, 66183.76975404056, 66463.33920233867, 66748.26055519706, 67247.61528152751, 67757.10644188913 … 68920.48643223509, 69303.30466832304, 69636.37061121882, 69835.13132065766, 70048.381645569, 70376.90122161311, 70927.19720025655, 71428.44884719889, 71948.39746520469, 72529.9574680292], [64900.920495538005, 64900.920495538005, 65014.82855772722, 65054.35505149155, 65493.67933323341, 65851.05623883184, 66062.59829968773, 66278.96156387504, 66707.53303242565, 67145.21859685628 … 68160.54789425919, 68470.09521761675, 68729.84503493927, 68856.5786827761, 68997.25940601989, 69251.01195913956, 69722.19176684845, 70144.18937529583, 70583.6082429044, 71082.4523163817], [40512.94792630534, 40394.87765857896, 40413.42554772843, 40528.04295752655, 40609.711513182054, 40854.04993879914, 40965.78482886412, 41070.93017870433, 40970.7267344307, 41211.908005385885 … 41511.442200879355, 41811.80723267429, 42038.7669884936, 42001.84086041937, 41936.419032309335, 42028.760872619765, 42221.85208411046, 42426.63234267407, 42510.073697215885, 43067.64740545475], [40512.94792630534, 40354.181792455725, 40332.037461219894, 40405.67624787712, 40446.309447042295, 40648.671873811785, 40718.78150662433, 40782.16540872828, 40641.68068351225, 40839.739432916875 … 41053.724237347174, 41309.118463298844, 41491.50674020912, 41413.29736672815, 41307.13536213191, 41356.384997010486, 41504.53118073038, 41663.81577131624, 41703.700067432, 42208.1316458293], [14866.888022051655, 14873.219880073675, 14605.525492164083, 14941.634492409063, 14985.82272516104, 15186.096004322288, 15342.137133245571, 15437.516995250355, 15816.807121730875, 15844.99065600498 … 16009.715268713906, 16070.26011154719, 16127.921611806072, 15870.717948215099, 15841.703336974364, 16067.567816513536, 16212.656115261107, 16362.86700292542, 16626.68864436795, 16847.05072690098], [14866.888022051655, 14858.235837537972, 14576.111609125268, 14896.521071770005, 14925.52398614389, 15109.753731848643, 15249.631671480318, 15328.977670118478, 15689.77842743217, 15701.900761878775 … 15833.187210881924, 15877.052981463983, 15917.968489536686, 15648.332271842695, 15603.988113600786, 15810.518958654453, 15937.213979098473, 16068.668160935293, 16311.296971115602, 16510.82837728763], [15944.236265986641, 15957.472650343298, 16260.401414111237, 15817.627209170827, 15981.312013121891, 16246.476720089706, 16209.00776567574, 16296.358043915636, 16317.574185055646, 16476.252367574365 … 16859.259416899637, 16793.773934706198, 16951.525934947414, 17147.000107018812, 17107.738715872638, 16938.30829624002, 17120.25213715727, 17296.702703979172, 17457.412592704717, 17660.78717569343], [15944.236265986641, 15941.396276102661, 16227.65479738626, 15769.868895302183, 15917.007704983167, 16164.803790315727, 16111.275504837626, 16181.780310674063, 16186.523706479456, 16327.461796594785 … 16673.364023296563, 16591.868250375715, 16730.851139835104, 16906.730748757942, 16851.025795313864, 16667.32933717574, 16829.39055428174, 16985.713810355064, 17126.2629160591, 17308.324809639576], [15944.236265986641, 15949.636037963875, 15982.853134285011, 16014.826123208924, 16060.064405485584, 16177.462832096257, 16227.703034148592, 16301.320492436815, 16367.834937419764, 16465.293766147846 … 16721.942462434934, 16836.924731688152, 16931.287514237927, 16974.99183683914, 17038.548934091006, 17121.394065867586, 17245.7563892782, 17346.1348505769, 17457.859496183573, 17579.597487195482], [15944.236265986641, 15933.567558727425, 15950.665468529982, 15966.472404763683, 15995.44321985263, 16096.136843171338, 16129.858050133264, 16186.707868816584, 16236.380802296575, 16316.602157998348 … 16537.561167919328, 16634.50026038174, 16710.87618268404, 16737.132714563206, 16782.874251913643, 16847.48610170991, 16952.76257346959, 17034.257183592745, 17126.701342225424, 17228.755451505305], [3173.2320350842083, 3165.752669005484, 3159.0661767088777, 3167.4860179985003, 3138.5219603503165, 3170.4352760017086, 3171.630615554556, 3201.9995447450538, 3176.290815203691, 3170.751084126718 … 3199.0852981978583, 3231.5406318782657, 3259.4173089463075, 3262.9659235218237, 3267.8337769098803, 3263.614926810635, 3267.541244205691, 3270.1684886956614, 3290.3091694448076, 3306.834508712618], [3173.2320350842083, 3162.5633278250007, 3152.704173295621, 3157.9223970190883, 3125.89343003486, 3154.497128789171, 3152.507259265105, 3179.4866710901683, 3150.781237204602, 3142.1172750713413 … 3163.8111971254098, 3192.688946410905, 3216.9862470113826, 3217.244180734246, 3218.79777240317, 3211.403633912503, 3212.0279135148435, 3211.3719598040625, 3227.895291572602, 3240.8388821590343], [34195.564496956766, 33707.05710795776, 35150.48261182413, 36466.01777860536, 36403.36389237194, 36827.28087194863, 37793.024727432385, 37664.695583183915, 37682.64396626672, 36925.16321850511 … 39071.25641832181, 39529.892014344994, 39482.61412776561, 39077.99523020997, 37831.04150154524, 36877.51312568266, 36718.1618751157, 37843.40623497858, 37992.730154747296, 38572.36795119657], [34195.564496956766, 33673.0988943677, 35079.6934995216, 36355.915580622066, 36256.886986902675, 36642.145843828854, 37565.151571720526, 37399.879638938866, 37380.005322201716, 36591.70655638162 … 38640.444695763545, 39054.63791543326, 38968.62985186155, 38530.42161514708, 37263.36173317051, 36287.5468820115, 36094.3449711522, 37162.99452660853, 37272.04601906467, 37802.566020108854], [33097.63671130043, 32461.141821378216, 33770.17373907909, 34971.0542328869, 34665.21689530321, 35322.406559705916, 36210.09041556983, 36061.720587954806, 35872.009156873966, 34993.11997830811 … 36744.97880621105, 37067.563998478494, 37089.15667000751, 36389.91675630021, 34809.35537245922, 33659.200014558155, 33427.029528601735, 34535.90283822311, 34642.872010131054, 35524.70839466567], [33097.63671130043, 32428.438806581737, 33702.16441335545, 34865.46579270648, 34525.73380485979, 35144.836709940806, 35991.76156702922, 35808.174968091516, 35583.91216928356, 34677.110840685506 … 36339.817338010944, 36621.913610145624, 36606.33039935487, 35880.00937357244, 34287.01800053403, 33120.72032559737, 32859.12675230944, 33914.95892782698, 33985.731336889236, 34815.72964702583], [29576.147776884885, 29605.97434991661, 29688.187302257807, 29791.055310887376, 29954.246542021996, 30135.157648167857, 30237.949564347276, 30355.461039819496, 30526.54883081404, 30769.00208946214 … 31277.586533389265, 31490.360110839578, 31641.064299887224, 31730.092009694246, 31883.38008935013, 32062.952875230047, 32300.546113342, 32506.365203852954, 32716.537770648494, 32945.21931032319], [34346.71094688275, 34381.34847608993, 34478.93838258168, 34478.81101039637, 34808.564495569015, 35047.12431190442, 35215.61027708442, 35374.41522947689, 35695.93188619647, 35954.09574486552 … 36593.92689673031, 36758.48726269108, 36934.50657148024, 37040.05588431696, 37100.87776135359, 37255.6309534618, 37569.72430004793, 37860.0508221554, 38159.307483044475, 38502.23822803649], [28335.32931213966, 28363.90456052843, 28444.414223950378, 28444.30914452017, 28716.34897996883, 28913.155916358206, 29052.153368406292, 29183.164184242432, 29448.408805818475, 29661.388673474303 … 30189.236199261915, 30324.99511278455, 30470.20741819421, 30557.28342796189, 30607.460224158785, 30735.12842118855, 30994.248964754825, 31233.76236749914, 31480.642950861456, 31763.553754333545], [978.0617717704336, 979.0481149238879, 978.8996292153163, 981.5028162283588, 995.461101968945, 1001.4877939683074, 1009.7793609070602, 1018.3842859006885, 1025.1345645169856, 1034.0086075614827 … 1048.9730021155597, 1054.4572947923173, 1060.7997398513148, 1064.9834266464186, 1064.1237948653104, 1058.3173929212023, 1056.9267868666032, 1062.0328211905166, 1072.5522115117042, 1082.4999296695164], [0.0019383188997990075, 0.004913747016755732, 0.003475849536142883, 0.0026785353155975855, 0.002833027790142051, 0.0025062456441373726, 0.004504269256856652, 0.0063516469931883535, 0.007394206434488071, 0.000928360706036635 … 0.00651752878883971, 0.009269265471895327, 0.008849266521555155, 0.007489719597350231, 0.009643965971925184, 0.005367699029979356, 0.0064210984598085385, 0.004673907961617374, 0.006709721766567256, 0.006254234915375356], [2.3548476e6, 2.3548701560200085e6, 2.3778266031949264e6, 2.4114834942277633e6, 2.396827286594168e6, 2.3989050663318974e6, 2.426610592082712e6, 2.4108659601624985e6, 2.4271672169272183e6, 2.4088805031362944e6 … 2.471264799995176e6, 2.46480577043819e6, 2.46402585516802e6, 2.4630982825571825e6, 2.444932898058688e6, 2.432077377648159e6, 2.415443275837942e6, 2.4274013369837604e6, 2.4343751376155578e6, 2.4377205902182804e6], [0.0016459319014481277, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.0013727024444591957, 0.0012267096395511992, 0.001307842635981478, 0.0013458660793440607, 0.0007421316099707973, 0.0002931883833720881, 0.0, 0.0005942044740219506, 0.0009867716391267288, 0.0011924118659388365], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.6059091613058 258.50369622511613 … 137.13538556670355 505.4138092341076; … ; 584.9573093762568 296.346810347612 … 147.94948213271226 537.2722953290793; 588.2006670853754 298.0307208785496 … 149.0509162237135 540.7551038593715], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.0834390395163 258.2432663779743 … 136.9972283642248 504.904629508617; … ; 573.8612535992181 290.72540741058197 … 145.1430282605842 527.0807766304139; 576.4617453276471 292.0828199162323 … 146.076256143612 529.9630694236535]), BeforeIT.Data{Float64, Vector{Float64}, Matrix{Float64}}([72422.0, 72494.0405607391, 72357.91577714065, 72322.93237771772, 72468.55308273868, 72480.45348912213, 72562.35382239977, 72637.48240819099, 73011.56515318483, 73428.25435216863 … 74133.80870296348, 74305.61570004578, 74470.98248938756, 74585.15866763094, 74793.01398061299, 75096.13296462584, 75444.24554443605, 75821.50623310808, 76146.90411583566, 76397.50759971752], [72422.0, 72421.00635589953, 72212.1950858349, 72104.5670528353, 72176.95999175994, 72116.0858117605, 72124.8388928424, 72126.7770063901, 72425.19119548677, 72765.15259532766 … 73316.3864658801, 73412.26520921232, 73501.5199840224, 73540.04709726809, 73670.6953986404, 73894.74545976949, 74162.49849409465, 74458.26106783624, 74702.47341674949, 74872.81642817895], [64900.920495538005, 64966.370940930225, 64831.16510870328, 64792.20433976117, 64927.14592650012, 64932.13791856583, 65002.759643073776, 65072.154036281834, 65417.79342529473, 65817.11447828253 … 66458.22166755683, 66617.78551176711, 66763.45101614413, 66858.73439229552, 67047.80930424923, 67335.1440423188, 67657.35935791042, 68010.50219704185, 68307.0453451691, 68532.4208014713], [64900.920495538005, 64900.920495538005, 64700.60244536048, 64596.57661442768, 64665.897338474366, 64605.71650229994, 64610.82530924718, 64614.63954828794, 64892.406928591336, 65222.745939553075 … 65725.43282022077, 65816.86312084831, 65894.32507842523, 65921.88799897238, 66041.71263481671, 66257.91679376994, 66507.9062728529, 66787.69625564072, 67011.32893481651, 67164.6958554214], [40512.94792630534, 40552.78995030874, 40574.55285485206, 40587.34351239799, 40651.889453834236, 40696.37853851351, 40739.14474300169, 40747.65594985953, 40819.27180291464, 40808.76105047472 … 41169.42922116927, 41253.459661982226, 41397.36676297503, 41493.675501986196, 41577.82515644044, 41601.32619338799, 41750.353971855955, 41881.91553328958, 42045.055248982404, 42193.49043301612], [40512.94792630534, 40511.93499526494, 40492.84027609788, 40464.797756013206, 40488.31767551489, 40491.793106010286, 40493.507947838, 40461.16408210222, 40491.44212405198, 40440.23313998825 … 40715.482398225715, 40757.483710630426, 40858.456256412595, 40912.252587043375, 40953.92242425241, 40935.788415327814, 41041.04350466312, 41128.89278684686, 41247.50255460079, 41351.42052287345], [14866.888022051655, 14710.633616338231, 14702.583132922538, 14729.338084027991, 14677.191018675243, 14950.487227792604, 14987.365454862878, 15168.908385380175, 15501.716487237869, 15738.419498428288 … 15733.437505225531, 15655.432694518675, 15632.846234513703, 15667.700043977557, 15892.182987819795, 15780.424525002705, 15809.899033257356, 15817.91069446376, 15815.690173350615, 16022.39477695487], [14866.888022051655, 14695.813371521584, 14672.973786728713, 14684.865651975291, 14618.134126906807, 14875.329388066457, 14896.999089994313, 15062.257615075392, 15377.218363842432, 15596.292006614913 … 15559.955771215828, 15467.212889728728, 15429.33799855534, 15448.159120696766, 15653.710283939141, 15527.969383875828, 15541.299469356392, 15533.50998350145, 15515.68233089293, 15702.63036799895], [15944.236265986641, 16414.244302179748, 16264.714412360883, 15736.369282579799, 16165.546747811182, 15999.714502575014, 16213.599082644834, 15748.540587013707, 15617.989739588791, 15741.808388304682 … 16313.22948368928, 16283.204421191822, 16400.771514163665, 16302.544241077647, 16376.835640603973, 16395.41747925414, 16526.129817153105, 16533.671912941885, 16744.08409756225, 16621.41009174018], [15944.236265986641, 16397.707752811235, 16231.959109743288, 15688.856311549924, 16100.501130877507, 15919.282075194777, 16115.83913844732, 15637.814492418778, 15492.557796914005, 15599.650292756407 … 16133.354784521429, 16087.437135974307, 16187.266434593777, 16074.107673842758, 16131.0904035137, 16133.123684369162, 16245.361973378735, 16236.402056152016, 16426.465549842855, 16289.690929405986], [15944.236265986641, 15960.296579453752, 15932.819048566264, 15913.384741194568, 15943.226313488869, 15945.45114858631, 15947.050396215765, 15970.042606920735, 16045.90881122171, 16121.856629034188 … 16248.352558090091, 16285.793651618535, 16334.036054334729, 16377.975355271092, 16398.64245846233, 16444.834785914267, 16517.195661700913, 16593.121535242037, 16668.280256359827, 16741.788981532227], [15944.236265986641, 15944.217360242474, 15900.732145823567, 15865.33730568906, 15879.075251501774, 15865.291509403536, 15850.897608120878, 15857.759158266635, 15917.040144528182, 15976.26646692876 … 16069.193211911466, 16089.995236987033, 16121.399736313568, 16148.48182266109, 16152.56999566482, 16181.750413240505, 16236.579603225944, 16294.78279425025, 16352.099631778776, 16407.667376549412], [3173.2320350842083, 3176.4132104953596, 3177.335989511194, 3176.861123723722, 3184.2983091492765, 3187.6007566812573, 3191.144164220242, 3192.9489479695267, 3198.0539542124566, 3192.844756389898 … 3204.8109037410413, 3214.1055060402637, 3221.8964886667995, 3238.389812723393, 3229.159035703299, 3243.1010703496268, 3241.5494927276095, 3250.2279835772492, 3260.236169008886, 3287.535726904672], [3173.2320350842083, 3173.213129340048, 3170.9371927530356, 3167.2691963974776, 3171.4855876712654, 3171.5763165990465, 3171.9031509307083, 3170.4997079719383, 3172.3695910553447, 3164.0114280483535 … 3169.4736703761423, 3175.4634370073854, 3179.9538723950814, 3193.0124384161995, 3180.7033712363714, 3191.217958009614, 3186.477744433799, 3191.789978256957, 3198.392745911555, 3221.925252735906], [34195.564496956766, 34465.99272237795, 35262.01843278985, 36192.63254971931, 36093.84865392906, 35785.33764380507, 34796.297569824805, 34283.37706758425, 34143.958721784074, 35446.852429035986 … 36310.75315928286, 35671.004758242845, 35093.29118627509, 36070.91596259129, 36808.13263108753, 37677.40409713934, 38197.43048854454, 37756.251863760306, 37672.1863287131, 36786.25581618433], [34195.564496956766, 34431.26991822715, 35191.00469990834, 36083.355786385255, 35948.617150792736, 35605.440585588854, 34586.49318947923, 34042.33476710918, 33869.74013510996, 35126.74581166435 … 35910.37959697783, 35242.1447143676, 34636.44707253179, 35565.478523032005, 36255.802286032966, 37074.6412022903, 37548.481804572664, 37077.40716165411, 36957.58258918205, 36052.09993546156], [33097.63671130043, 33649.620030465245, 34445.95305578486, 34922.75105100759, 35119.922791510835, 34951.46442356405, 34174.0530279341, 33310.9995816467, 33071.3715983404, 34307.58701407485 … 35393.0406664035, 34557.48583588952, 34053.2932085399, 34949.67708200191, 35861.96243533898, 36358.439330158566, 36839.56776637499, 36168.24377134747, 36130.111732772784, 35226.04351817794], [33097.63671130043, 33615.71968192523, 34376.58278664343, 34817.308453088444, 34978.61009233188, 34775.75934309975, 33968.00047291629, 33076.79395031535, 32805.767224431474, 33997.7686556961 … 35002.78608506078, 34142.01324148849, 33609.98777807117, 34459.95080734698, 35323.82999909814, 35776.77722609382, 36213.68825787633, 35517.95092031819, 35444.759607769236, 34523.02532756096], [29576.147776884885, 29605.97434991661, 29563.24311325228, 29537.92787075053, 29595.964354160835, 29604.875692169273, 29575.560547597222, 29596.54861242116, 29713.849391836357, 29874.5205808665 … 30168.592266972384, 30245.81008557569, 30338.588467894722, 30396.71823027157, 30478.236002690825, 30555.218859610326, 30744.50396483407, 30912.203704695796, 31053.802168045197, 31164.475415074365], [34346.71094688275, 34381.34847608993, 34287.979105266, 34268.14610045285, 34338.590320835036, 34335.6382106215, 34431.89933282723, 34481.940933560385, 34711.284233565966, 34944.24421578349 … 35273.92484344359, 35352.50425326331, 35407.827313533184, 35448.211856442984, 35550.65413178743, 35750.52860632675, 35877.994296479024, 36060.94306779688, 36211.27934902259, 36324.948763017295], [28335.32931213966, 28363.90456052843, 28286.876752129112, 28270.51493153152, 28328.629962858773, 28326.194532718306, 28405.607976464747, 28446.89126668352, 28636.094766874292, 28828.281955420298 … 29100.261684921286, 29165.08808002616, 29210.728465614353, 29244.044881973383, 29328.557649785675, 29493.449975747284, 29598.606545529154, 29749.535514843268, 29873.55985134177, 29967.33477736712], [978.0617717704336, 979.0481149238879, 979.9428901849948, 986.1303685577066, 992.5912515043683, 991.6240157749926, 995.2997626494996, 993.664490300186, 992.6597998924836, 998.349681632556 … 1015.7045571409152, 1019.4711729281863, 1017.0352347162537, 1013.80430558097, 1018.919169771012, 1029.3965763817207, 1034.86109659735, 1037.3554245491675, 1041.9638281013008, 1042.9966233796792], [0.0019383188997990075, 0.0059337629210785, 0.003943337011621528, 0.004535312137140979, 0.00623670731643422, 0.0057231191671611725, 0.00904737445662529, 0.006121017831568709, 0.007029923195770005, 0.0019599562491985356 … 0.0020302158278751037, 0.00401685895213677, 0.005091218389326357, 0.007001375159919165, 0.006856659645657626, 0.008684781054133506, 0.005709028050161713, 0.008313107337827086, 0.00784404480625156, 0.0024787722012944435], [2.3548476e6, 2.34915898809926e6, 2.3567542943364447e6, 2.3702216865586527e6, 2.380602603509879e6, 2.3697841881565345e6, 2.3564159198731207e6, 2.3465596353763165e6, 2.359921057995423e6, 2.3950357205390623e6 … 2.4185775943704867e6, 2.4129792043594285e6, 2.396628844506011e6, 2.415444703729562e6, 2.417570320801106e6, 2.4357073661518255e6, 2.4409909022970395e6, 2.425077891673508e6, 2.412809984563572e6, 2.382180876097404e6], [0.0016459319014481277, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.0001453196167151053, 0.0, 0.0, 0.0009328885408478772, 0.001107728512764879, 0.0019629323123390805, 0.0021619835756051483, 0.0015514785613892816, 0.001119043065576464, 0.0], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.6059091613057 258.50369622511613 … 137.13538556670355 505.4138092341076; … ; 530.1915929097995 268.8320363764925 … 143.19514965207782 525.8481628264552; 536.5777766986058 271.4109900780944 … 143.75991903588113 527.7953497136106], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.90462950861706; 518.0834390395163 258.2432663779743 … 136.9972283642248 504.904629508617; … ; 520.1343880622946 263.7325612139914 … 140.47888071745302 515.8733485084738; 525.8691106088339 265.99434818188473 … 140.8908531951007 517.2619575209776])])
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
.