Changing expectations via function overloading
In this tutorial we will illustrate how to experiment with different expectations of the agents in the model.
import BeforeIT as Bit
using Random, Plots
Import standard parameters and initial conditions
par = Bit.AUSTRIA2010Q1.parameters
init = 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
⋮ => ⋮
Set the seed, initialise the model and run one simulation
Random.seed!(1234)
T = 40
model = Bit.init_model(par, init, T)
data = Bit.run!(model)
BeforeIT.Data{Float64, Vector{Float64}, Matrix{Float64}}([72421.99999999997, 72317.15814504564, 74007.03073675784, 74929.79038171521, 76964.05078463048, 76745.71570794475, 76898.39958485053, 77773.55063023673, 77938.7980076462, 79522.71435941223 … 90038.56480945727, 91038.38236847312, 92000.73066102534, 93060.76082892239, 94134.41056442978, 94325.1147338447, 94283.18838732237, 93352.76607408191, 93199.48796444442, 91925.98868787859], [72421.99999999997, 72374.72225438412, 73689.76049724416, 74305.22430514175, 75338.94698073059, 74975.39159216381, 74281.602508388, 74860.96833101544, 74784.84681695756, 75642.06995990749 … 80796.9984019707, 81114.42382754607, 82038.37286302527, 82120.71585029642, 83254.3217215746, 83441.49422817545, 83091.8778362033, 82672.52265299296, 82240.87724671683, 81075.08678412552], [64900.920495538034, 64822.27522027363, 66507.22467346229, 67326.15807204095, 69162.71255573993, 68921.04688798341, 69012.68796952805, 69805.04764599986, 69941.612037235, 71444.42169967119 … 80729.9608028636, 81667.41714613243, 82523.57135638037, 83457.93049912958, 84407.32016311774, 84565.50388119344, 84501.78673524137, 83653.85932905963, 83510.80007434572, 82301.49447286894], [64900.920495538034, 64873.873438926865, 66222.10631522692, 66764.97093694282, 67702.33480643346, 67331.21753705278, 66664.23597192549, 67190.88197499096, 67111.28316121259, 67957.99147431925 … 72443.83034962598, 72764.9735743376, 73587.45379824738, 73646.77587981599, 74651.49190801354, 74807.9875006343, 74471.51778004257, 74083.24221377372, 73691.40762135427, 72586.66348976598], [40512.94792630534, 40340.45199288648, 40360.79564537339, 40839.441114257155, 41848.25388312623, 42027.44125504281, 42330.19840504895, 42746.157297272686, 42916.46741321401, 43252.61010376722 … 50090.994460779526, 50511.30221609159, 51072.85995208717, 51759.51856005769, 52508.21191930011, 52731.487795817935, 52856.64427184138, 52356.60560381333, 52268.32174413649, 51872.064990111634], [40512.94792630534, 40372.56279824504, 40187.7677698609, 40499.030052431845, 40964.62372230807, 41057.97746032752, 40889.73228312157, 41145.3341370226, 41179.76570677022, 41141.917573774634 … 44949.65027447466, 45005.14035337464, 45542.4027377361, 45674.76859589158, 46439.2940046292, 46647.11139735395, 46582.61885061636, 46366.6246309204, 46122.491939991574, 45749.11002615789], [14866.888022051655, 14850.382665230743, 14890.943984962865, 15128.956219174526, 15657.508267428098, 15715.438807680437, 15916.591347812231, 16254.186152488654, 16247.012527034607, 16404.14523402758 … 18515.96877594203, 18819.686376027075, 18921.445917458117, 19522.699168524727, 19276.522908860927, 18950.507991959363, 19223.311320634293, 19390.178792543826, 19643.46544890804, 19738.93743110351], [14866.888022051655, 14862.20349825829, 14827.106085811114, 15002.85106419776, 15326.898378972564, 15352.924495908437, 15374.961223764625, 15645.474649768852, 15589.544285097563, 15603.636161319386 … 16615.488071879958, 16768.18037943525, 16872.525078125243, 17227.64800941723, 17048.535496264416, 16763.920273978732, 16941.52545308095, 17171.799646515494, 17333.741482572095, 17408.96223250698], [15944.236265986641, 15914.498524222605, 18599.097522015, 18260.897855073094, 18343.328712272152, 17616.920338029195, 17012.865711983977, 17766.64969172317, 16993.68551599565, 18692.689566894845 … 20602.335841262724, 21506.383676686713, 22297.317793318845, 22063.05127003847, 23378.676015166428, 22668.043397565278, 22904.691603080275, 22638.45026829365, 22300.824781695243, 22242.78696250633], [15944.236265986641, 15927.16638834521, 18519.36266349139, 18108.68686836204, 17956.007450428508, 17210.54379137104, 16433.930161989254, 17101.297152341227, 16306.001640474431, 17780.501374328887 … 18487.71023356564, 19162.004806806657, 19882.83851476614, 19469.36117864029, 20676.56027929275, 20052.511122398893, 20185.929953287057, 20048.44496143729, 19678.642377001306, 19617.258503783774], [15944.236265986641, 15914.49852422261, 17735.705316788397, 18273.686210168453, 18706.9357760714, 16822.16523679847, 16898.348849526283, 17090.711369353707, 17138.275638969895, 19358.048786797033 … 21511.92651124939, 21620.594252402167, 21808.062745999687, 22154.004910153584, 22206.774999151934, 22362.098322259575, 20770.412806996843, 22553.078587417505, 20479.09825434436, 20217.694123602472], [15944.236265986641, 15927.166388345213, 17659.671845133296, 18121.368628033513, 18311.936913887326, 16434.121623892646, 16323.310225768033, 16450.67239707967, 16444.740631507026, 18413.391600294293 … 19303.94043520076, 19263.765457678892, 19446.562762294423, 19549.622482856084, 19640.108001872555, 19781.86725085638, 18304.987698088466, 19972.84042910285, 18071.11865573249, 17831.206702725576], [3173.2320350842083, 3158.969869559669, 2646.305773143414, 3063.661977187671, 3243.8251564438838, 3297.0394226937296, 3319.56566320649, 3349.0948366380126, 3359.855719644192, 3393.101805423237 … 3903.2329088798515, 3799.972683746809, 3913.7062651811766, 3977.2064222325243, 3966.063220781148, 4013.5965817735823, 4138.6990786365795, 4100.902715164161, 4093.987761154467, 4062.95040913858], [3173.2320350842083, 3161.4843943506366, 2634.9609852480858, 3038.1252803506445, 3175.331456499805, 3220.985295804264, 3206.60323785693, 3223.672835706336, 3223.8923584120307, 3227.5211707047924 … 3502.604731302418, 3385.7433181861793, 3489.9080860812046, 3509.6536453055046, 3507.6642151492483, 3550.49126584438, 3647.440059304555, 3631.7292660410712, 3612.607239249144, 3583.3615903654045], [34195.564496956766, 34190.11831748914, 33850.5350481832, 34220.71171766003, 34454.345136868, 34343.542448829954, 34538.34409472843, 33498.074127821026, 32841.6900558153, 32513.113538283313 … 39204.715400596164, 39627.75165109404, 39805.91470515528, 39975.194968443175, 39220.43946080486, 39492.75839497814, 39358.43976410293, 38900.15569955993, 39808.60309606364, 41388.040808865786], [34195.564496956766, 34217.33348688468, 33705.41684447357, 33935.47008617845, 33726.83811544719, 33551.32622076223, 33363.02915526447, 32243.587262144072, 31512.68460405552, 30926.49978925368 … 35180.73987824126, 35307.989434055795, 35495.50584296323, 35275.78753733398, 34687.327039632226, 34935.921159149126, 34686.63634143871, 34449.69162161431, 35127.81574331859, 36502.61529192764], [33097.63671130043, 32978.29335478363, 33694.34146377729, 33520.216524449395, 33339.38521506472, 32957.627141637575, 32899.599974723475, 32491.516639068606, 31060.05750441362, 31339.84408356041 … 38375.44966912361, 39426.741551426676, 40096.807706994055, 40259.70313814174, 40249.43973970221, 39517.68284647587, 40059.898572335835, 39932.62429012826, 40821.72710635898, 43315.841504707445], [33097.63671130043, 33004.543917349474, 33549.89286639347, 33240.81376602822, 32635.42068642653, 32197.38037620525, 31780.050315752353, 31274.724870261107, 29803.149419440422, 29810.48493876877 … 34436.59005619127, 35128.89114612664, 35754.89931056537, 35526.84947098674, 35597.39509824373, 34957.96972470515, 35304.832762219194, 35364.03820749405, 36021.81429616672, 38202.859270249624], [29576.147776884864, 29540.30815757877, 30292.943432081607, 30659.752129799897, 31470.43102338082, 31343.133705093118, 31387.02640205149, 31736.348121683142, 31793.391333121475, 32501.159588540366 … 36712.64006874383, 37172.31883509497, 37523.73899824494, 37944.49242007238, 38338.4724381756, 38501.540003118294, 38525.968110767135, 38119.66981037679, 37972.47865890076, 37372.14202925547], [34346.71094688274, 34305.090481160245, 35211.75075073366, 35650.37993372928, 36648.67733439142, 36539.43462458365, 36586.55960188689, 37018.22876469332, 37099.11053622822, 37874.48536845477 … 42796.25434483112, 43261.55611500028, 43748.390628986905, 44243.5975115139, 44784.66846081228, 44784.33623000669, 44699.7193514847, 44264.68958310676, 44269.65844257435, 43675.88723090872], [28335.329312139656, 28300.993284908534, 29048.96933863684, 29410.829382974618, 30234.40418298853, 30144.281196768952, 30183.158332713047, 30539.27650370566, 30606.002299818563, 31245.670570980295 … 35306.02863436434, 35689.893013915986, 36091.521463745135, 36500.05694522808, 36946.42933742925, 36946.15525385545, 36876.34807138626, 36517.457469994, 36521.556676743014, 36031.707653218364], [978.0617717704339, 976.8765815346229, 1002.5304906469918, 1016.0260085118274, 1043.6041979677732, 1038.4785583065247, 1039.1019655897114, 1050.470759623419, 1049.1101678853386, 1068.7767426760688 … 1221.0663892886755, 1233.5421960371611, 1251.4417291484717, 1269.8405675432552, 1284.1792641298557, 1279.6276480684621, 1276.0992729895574, 1269.4999355760315, 1268.6629728705543, 1253.4652127047414], [0.0019383188997990075, -0.003952295097048086, 0.004956948059654076, 0.007114732025734094, 0.0035391752262126097, -0.0003608070994732815, 0.0017794524471583806, 0.0002442073299642189, 9.177357428868937e-5, 0.0018888992087409129 … 0.005383681618703839, 0.004883052145744804, 0.006695749772000603, 0.007423681534728832, 0.008973362968299314, 0.001955892169429152, 0.004048164862117121, 0.005927619485927238, -0.00013296480254920695, 0.001287084675797745], [2.3548476e6, 2.3588626485893e6, 2.3686528332620063e6, 2.371686113212186e6, 2.357060225202081e6, 2.358614034745582e6, 2.368561899028043e6, 2.354970445382262e6, 2.348058708273566e6, 2.3396666060391376e6 … 2.422412850829009e6, 2.4211672653116006e6, 2.4173995616164864e6, 2.4207180069083306e6, 2.4051012465298795e6, 2.4192692432369734e6, 2.396204684560901e6, 2.3926891306042643e6, 2.4159713703492098e6, 2.428836735410318e6], [0.0016459319014481277, 0.0016010860580926674, 0.0020045362540946406, 0.002145362270381164, 0.0014611782662367872, 0.0014095631765680236, 0.0017608937880558586, 0.001071717309308333, 0.0007057985760453944, 0.000345348357775852 … 0.0024861636122284216, 0.0023635856605183176, 0.0021891933109979477, 0.0023325013108871184, 0.0017311912814285504, 0.0022273293558820887, 0.0012175977280879187, 0.001119175141481578, 0.0019903663875925886, 0.0023963289034279636], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.9046295086171; 517.4556387808753 257.93033379374606 … 136.83121862733822 504.29279899424546; … ; 649.4452152787419 326.6898114613495 … 177.2921431793251 651.9444842923218; 646.2872705741617 315.4458886853067 … 175.7060468876137 647.9140835530511], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.9046295086171; 517.8675309753778 258.13564509630606 … 136.94013561788393 504.69421363171887; … ; 573.081949211812 288.27687006602196 … 156.4457241393938 575.2873484113309; 569.9998150379971 278.21079942574687 … 154.96578501077704 571.4345997526095])
Now we can experiment with changing expectations of the agents in the model. We will change the function estimate_next_value
to make the agents expect the last value of the time series (so to represent backward looking expectations)
function Bit.estimate_next_value(data)
return data[end]
end
Run the model again, with the same seed
Random.seed!(1234)
model = Bit.init_model(par, init, T)
data_back = Bit.run!(model)
BeforeIT.Data{Float64, Vector{Float64}, Matrix{Float64}}([72421.99999999997, 72487.15720268336, 72588.9859929605, 72760.55065828687, 72862.39108440242, 73117.75995158694, 73347.91764563385, 73336.73940769253, 73416.44757987179, 73455.87933682224 … 79908.35020369886, 80254.76553029781, 80629.29738282178, 81065.09974811536, 81630.94331641759, 82101.4466536077, 82311.4658279318, 82760.59607213446, 82932.59412381802, 83039.08963526484], [72421.99999999997, 72414.1299324907, 72442.79995226984, 72540.86402832363, 72569.21329998954, 72750.18846044765, 72905.66615665257, 72821.11761403612, 72826.82191115391, 72792.52810958224 … 77450.08213018041, 77707.47504141096, 77991.46740145641, 78334.01498284892, 78801.32672223875, 79175.67468735752, 79298.23993718246, 79650.60358133283, 79735.72739882988, 79757.68474171181], [64900.920495538034, 64966.370940930356, 65052.463080422065, 65223.23238242176, 65317.56928331891, 65555.73522577029, 65747.94950168808, 65724.42947186915, 65790.96215077116, 65827.83828456838 … 71731.08287485935, 72051.27417899562, 72386.31576926842, 72782.11377019306, 73298.47116224813, 73700.81052565602, 73882.87397451198, 74298.44787342481, 74441.35923385191, 74549.89625136931], [64900.920495538034, 64900.92049553802, 64921.454747893134, 65026.303249976125, 65054.7497414302, 65226.17891324617, 65351.52204337812, 65262.328913744605, 65262.57864363486, 65233.37290335098 … 69524.37693661048, 69764.36293807939, 70018.15927808413, 70330.08296138271, 70757.68746059852, 71074.40412095955, 71178.19867194406, 71506.44750209874, 71571.81069492296, 71603.95361823592], [40512.94792630534, 40504.855519081226, 40568.96366966951, 40576.36746549506, 40616.49293489363, 40710.71064571137, 40932.556299143864, 41019.78992325869, 41114.124340279865, 41143.7606302783 … 43685.81656825279, 43832.18958046235, 44080.381242434305, 44248.44184332816, 44477.48175990843, 44918.776080610325, 45040.88288204748, 45171.88957273917, 45338.047171015816, 45292.37378790962], [40512.94792630534, 40464.04885563548, 40487.262346904594, 40453.85484919408, 40453.06358221869, 40506.05316403674, 40685.75332842334, 40731.384714267086, 40783.92662768261, 40772.20747001708 … 42341.88382703658, 42440.95357238697, 42638.268325596604, 42757.71098898288, 42935.73526841816, 43318.047942781035, 43392.04388887355, 43474.41222199491, 43590.36646829268, 43502.58276730617], [14866.888022051655, 14914.412839498767, 14975.692652925489, 14953.187686835156, 15005.22813685588, 15051.891343529052, 14960.040689476866, 14953.494004809463, 14955.200010346452, 14968.267041605939 … 17128.17270430469, 17054.801950897152, 17217.71681229949, 17313.674228476997, 17506.417805496476, 17531.04486946254, 17624.66891023052, 17815.484433069665, 17833.603291293693, 17876.18623685406], [14866.888022051655, 14899.38729706853, 14945.533294923955, 14908.03938352507, 14944.851315915743, 14976.223733508314, 14869.839079362915, 14848.357787103807, 14835.091096096441, 14833.09449447495 … 16601.248546699506, 16513.481637862682, 16654.430127528984, 16730.37621165959, 16899.583579227048, 16906.307526714467, 16979.47193624865, 17146.01097061963, 17146.15761868567, 17169.783923758758], [15944.236265986641, 16069.165265288759, 15876.03150309954, 16070.727600807086, 15966.803651695871, 16166.300250931892, 16342.558683508234, 16239.502572383877, 16214.820689247004, 16114.063029947514 … 17519.826091438605, 17616.74467536471, 17529.254858282024, 17740.25018908835, 17833.419495958213, 18005.985018229094, 17937.585184876512, 18196.333547896873, 18307.287418839056, 17960.391095514908], [15944.236265986641, 16052.97636619428, 15844.058964076301, 16022.205098493163, 15902.557721126046, 16085.030377601872, 16244.021177011264, 16125.3245831238, 16084.59544943766, 15968.543248777596 … 16980.853267892726, 17057.588270630546, 16955.776042056787, 17142.580819976618, 17215.250237015345, 17364.3226804956, 17280.93309451546, 17512.54846924956, 17601.58227850903, 17250.6613105448], [15944.236265986641, 15956.894253937371, 15975.290551103222, 15995.242115506864, 16025.262363496295, 16077.849434072503, 16125.347491099246, 16165.57323563215, 16174.48913194592, 16183.60988774581 … 17455.938357222592, 17547.74428896111, 17645.937278574518, 17728.826531950937, 17813.08975785321, 17932.2307905329, 18023.780894133073, 18094.9176141039, 18146.041563527026, 18160.99774092782], [15944.236265986641, 15940.818462402867, 15943.118115538768, 15946.947527244261, 15960.781211499472, 15997.024213295666, 16028.11966013704, 16051.915034646378, 16044.587804859515, 16037.462056188533 … 16918.930950018217, 16990.77796012903, 17068.64113544037, 17131.542026067258, 17195.62519938249, 17293.196762781525, 17363.973385019715, 17414.943561566994, 17446.55209165444, 17443.340705902006], [3173.2320350842083, 3173.010884978986, 3173.6943494578736, 3164.1175957895816, 3164.1843102383536, 3168.3289749056844, 3172.5036888525374, 3211.884161136667, 3216.4345308353195, 3215.489953993725 … 3363.4628329896564, 3388.0318757186665, 3413.9417876877346, 3417.4546435162433, 3418.3448660234067, 3453.4375246917552, 3513.7922521137557, 3502.8273808890604, 3530.7318489446657, 3526.2260412216747], [3173.2320350842083, 3169.814231500442, 3167.302886552549, 3154.5641451197116, 3151.4525218391077, 3152.401416313943, 3153.37506836501, 3189.301789932854, 3190.602548716216, 3186.452125757009 … 3259.9906266717016, 3280.495565369526, 3302.2528818618243, 3302.32053103261, 3299.852968655112, 3330.3706225996502, 3385.1607220798073, 3371.19750667157, 3394.6300028370233, 3386.882324446083], [34195.564496956766, 33751.528998769754, 34569.95644716177, 33703.4234344634, 33728.34322462739, 32958.953782453515, 33631.30822091187, 34503.0090460788, 34191.5830805822, 33369.47677866404 … 37554.195095249524, 37815.82187075543, 37436.083257622064, 38754.756135371026, 38985.56780798001, 38867.0228684277, 39261.372105459064, 39399.56273987626, 39961.30568843665, 40637.66180367982], [34195.564496956766, 33717.52598192198, 34500.33644915898, 33601.66236413677, 33592.629850534875, 32793.26528493628, 33428.528147332356, 34260.4225395806, 33916.98201089031, 33068.13012577077 … 36398.893069941754, 36615.54569096338, 36211.34205303245, 37449.10765789053, 37634.190436590994, 37481.955362859524, 37824.1071783367, 37918.99891992641, 38420.88639018447, 39031.80818834203], [33097.63671130043, 32752.805419954726, 33401.65827989574, 32543.155529313684, 32454.476863670152, 31770.096071039003, 32518.54624740699, 33379.05613883806, 33059.28054058376, 32139.688143673524 … 35979.660255546565, 36064.79254718173, 35634.13878781588, 36992.02264814908, 37171.94355292535, 37221.38218312187, 37553.04325468158, 37822.67422144753, 38507.64944576708, 38727.52328869353], [33097.63671130043, 32719.808568329216, 33334.39110279383, 32444.897667025358, 32323.8891698056, 31610.384099635594, 32322.47557547731, 33144.372010038904, 32793.773272953185, 31849.447229458117 … 34872.796581390045, 34920.09413043252, 34468.34914675837, 35745.76069566068, 35883.43279901268, 35894.95882549304, 36178.31616079182, 36401.36700045779, 37023.26535684193, 37197.15144823997], [29576.147776884864, 29605.974349916603, 29632.489755699513, 29711.169775955394, 29770.11928322126, 29875.72474905089, 29952.269971374113, 29981.998581151907, 30006.311784726746, 30027.59576072079 … 32523.275263887463, 32691.04396638387, 32870.38187045533, 33030.475204297196, 33219.94466824486, 33433.189159988804, 33511.25195305636, 33670.26722327924, 33738.46039093027, 33790.40720342477], [34346.71094688274, 34381.34847608993, 34440.67812819331, 34528.594323724596, 34566.596806034504, 34697.21610172567, 34811.258712117386, 34758.7128265803, 34795.6205540742, 34810.27157749574 … 38122.85306262314, 38270.50678702313, 38422.069324873686, 38652.73106676094, 38967.21507888629, 39150.21440403827, 39251.69611327525, 39499.22474205198, 39570.172045736894, 39621.08608761451], [28335.329312139656, 28363.90456052843, 28412.850301881183, 28485.379352948174, 28516.730618360314, 28624.488847777182, 28718.571653145726, 28675.222379528404, 28705.670494759004, 28717.757287408553 … 31450.568804631872, 31572.380086984587, 31697.416059949242, 31887.70724754489, 32147.150082136992, 32298.120757323322, 32381.841077875582, 32586.047099855903, 32644.577164549126, 32686.580200747998], [978.0617717704339, 979.0481149238877, 979.2951965291289, 983.4682827417945, 980.853194063137, 982.7943749937023, 984.420818196592, 983.7180641369315, 989.0298119702568, 989.9709463518589 … 1084.9545483487664, 1089.7234255885255, 1093.8645739394494, 1098.9074991349305, 1111.3114151169912, 1117.4069616289157, 1119.9259081804157, 1128.9559080936135, 1132.7267971847361, 1138.4029603300612], [0.0019383188997990075, 0.004220038374121549, 0.007005984606115234, 0.002346933044874655, 0.0036516744035737236, 0.006506860457373476, 0.010954032805192915, 0.008916604604359835, 0.006836631711282237, 0.007798941998575337 … 0.0015015719683397766, 0.008179623587014184, 0.00190366245196949, 0.0035121839063618765, -0.002731861288506554, -0.00032007216549834183, 0.00765950772805013, 0.004414981215902669, 0.00413254546412567, -0.000615861188655753], [2.3548476e6, 2.352396197078055e6, 2.3687608750522775e6, 2.3489358910521604e6, 2.3325667268239697e6, 2.323771457244648e6, 2.331462532341804e6, 2.35042648756668e6, 2.347090348513485e6, 2.323260814353414e6 … 2.406649015473945e6, 2.4302095839785803e6, 2.434717668651892e6, 2.4524625837059407e6, 2.4645160695100487e6, 2.451635163427777e6, 2.44657916097215e6, 2.4448572880382375e6, 2.4593268857702897e6, 2.47002678994776e6], [0.0016459319014481277, 0.0015185270190031042, 0.002251129865149383, 0.0013151207058681102, 0.0006161104840447192, 0.0003489376678451245, 0.0009000238344603896, 0.0018380636299575467, 0.001719263539904509, 0.0007723229917119014 … 0.002990572669784612, 0.0039197996592207985, 0.003855749404926428, 0.0043677689988356385, 0.004465142773470529, 0.00361314654343514, 0.0033185771129730546, 0.0031049830316457333, 0.0035520767233054675, 0.00370291147466435], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.9046295086171; 518.6059091613045 258.50369622511613 … 137.13538556670355 505.41380923410765; … ; 580.9669663982805 293.2221597837535 … 154.720305117898 568.029148464828; 576.6894871207411 293.5178646953359 … 155.21082677437812 569.5449065545222], [518.0834390395164 258.24326637797435 … 136.99722836422484 504.9046295086171; 518.0834390395163 258.2432663779743 … 136.9972283642248 504.90462950861695; … ; 558.5719842707092 281.9190988395567 … 148.75618208114645 546.1328903924056; 553.9008015341049 281.91909883955645 … 149.07745550613674 547.0385489863567])
Plot the results, comparing the two cases as different lines
p1 = plot(data.real_gdp, title = "gdp", titlefont = 10, label = "forward looking")
plot!(p1, data_back.real_gdp, titlefont = 10, label = "backward looking")
p2 = plot(data.real_household_consumption, title = "consumption", titlefont = 10)
plot!(p2, data_back.real_household_consumption, titlefont = 10, label = "backward looking")
plot(p1, p2, layout = (2, 1), legend = true)
Plot all time series
p1 = plot(data.real_gdp, title = "gdp", titlefont = 10)
plot!(p1, data_back.real_gdp, titlefont = 10)
p2 = plot(data.real_household_consumption, title = "household cons.", titlefont = 10)
plot!(p2, data_back.real_household_consumption, titlefont = 10)
p3 = plot(data.real_government_consumption, title = "gov. cons.", titlefont = 10)
plot!(p3, data_back.real_government_consumption, titlefont = 10)
p4 = plot(data.real_capitalformation, title = "capital form.", titlefont = 10)
plot!(p4, data_back.real_capitalformation, titlefont = 10)
p5 = plot(data.real_exports, title = "exports", titlefont = 10)
plot!(p5, data_back.real_exports, titlefont = 10)
p6 = plot(data.real_imports, title = "imports", titlefont = 10)
plot!(p6, data_back.real_imports, titlefont = 10)
p7 = plot(data.wages, title = "wages", titlefont = 10)
plot!(p7, data_back.wages, titlefont = 10)
p8 = plot(data.euribor, title = "euribor", titlefont = 10)
plot!(p8, data_back.euribor, titlefont = 10)
p9 = plot(data.nominal_gdp ./ data.real_gdp, title = "gdp deflator", titlefont = 10)
plot!(p9, data_back.nominal_gdp ./ data_back.real_gdp, titlefont = 10)
plot(p1, p2, p3, p4, p5, p6, p7, p8, p9, layout = (3, 3), legend = false)
Note that, importantly, once the function estimate_next_value
has been changed, the model will use the new expectations in all the simulations, unless the function is changed again. To restore the original expectations you could close the Julia session.