Chapter 9 Common Functions
9.1 FFY_TAUCHEN AR1 Shock Discretization Example
Go back to fan’s MEconTools Toolbox (bookdown), Matlab Code Examples Repository (bookdown), or Math for Econ with Matlab Repository (bookdown).
Examples](https://fanwangecon.github.io/M4Econ/), or** Dynamic Asset This is the example vignette for function: ffy_tauchen from the MEconTools Package. : See also the ffy_rouwenhorst function from the MEconTools Package. This function discretize a mean zero AR1 process, uses Tauchen (1986). See AR 1 Example for some details on how the AR1 process works. And See Kopecky and Suen (2010).
9.1.1 Test FFY_TAUCHEN Defaults
Call the function with defaults. Default sd bounds arer plus and minus 4. This is used in the following examples, unless otherwise specified as the 5th parameter.
ffy_tauchen();
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx ndim numel rowN colN sum mean std coefvari min max
_ ___ ____ _____ ____ ____ ___ ____ _______ ________ __________ ______
ar_disc_ar1 1 1 2 5 5 1 0 0 0.79057 Inf -1 1
mt_disc_ar1_trans 2 6 2 25 5 5 5 0.2 0.27623 1.3812 7.3923e-12 0.7887
xxx TABLE:ar_disc_ar1 xxxxxxxxxxxxxxxxxx
c1
____
r1 -1
r2 -0.5
r3 0
r4 0.5
r5 1
xxx TABLE:mt_disc_ar1_trans xxxxxxxxxxxxxxxxxx
c1 c2 c3 c4 c5
__________ __________ ________ __________ __________
r1 0.22663 0.73331 0.040048 1.0689e-05 7.3923e-12
r2 0.012224 0.58648 0.39831 0.0029797 7.605e-08
r3 8.8417e-05 0.10556 0.7887 0.10556 8.8417e-05
r4 7.605e-08 0.0029797 0.39831 0.58648 0.012224
r5 7.3923e-12 1.0689e-05 0.040048 0.73331 0.22663
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map Scalars
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx value
_ ___ _____
fl_ar1_persistence 1 2 0.6
fl_ar1_step 2 3 0.5
fl_shk_std 3 4 0.2
it_std_bound 4 5 4
9.1.2 Test FFY_TAUCHEN Specify Parameters
With a grid of 10 points, the sd bounds on Tauchen and Rouwenhorst are identical. With the not extremely persistent shock process here, the Tauchen and Rouwenhorst Results are very similar.
[fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose, it_std_bound] = ...
deal(0.60, 0.10, 10, true, 3);
ffy_tauchen(fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose, it_std_bound);
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx ndim numel rowN colN sum mean std coefvari min max
_ ___ ____ _____ ____ ____ ___________ ___________ _______ ___________ __________ _______
ar_disc_ar1 1 1 2 10 10 1 -7.2164e-16 -7.2164e-17 0.2523 -3.4962e+15 -0.375 0.375
mt_disc_ar1_trans 2 6 2 100 10 10 10 0.1 0.11456 1.1456 1.1798e-08 0.32308
xxx TABLE:ar_disc_ar1 xxxxxxxxxxxxxxxxxx
c1
_________
r1 -0.375
r2 -0.29167
r3 -0.20833
r4 -0.125
r5 -0.041667
r6 0.041667
r7 0.125
r8 0.20833
r9 0.29167
r10 0.375
xxx TABLE:mt_disc_ar1_trans xxxxxxxxxxxxxxxxxx
c1 c2 c3 c4 c5 c6 c7 c8 c9 c10
__________ __________ __________ __________ ________ ________ __________ __________ __________ __________
r1 0.13933 0.26196 0.31887 0.20154 0.066066 0.011201 0.00097859 4.3874e-05 1.0053e-06 1.1798e-08
r2 0.056673 0.16995 0.30658 0.28713 0.1396 0.035167 0.0045756 0.00030628 1.0503e-05 1.8543e-07
r3 0.01861 0.087039 0.23281 0.32308 0.23281 0.087039 0.016841 0.0016806 8.6129e-05 2.2881e-06
r4 0.0048925 0.035167 0.1396 0.28713 0.30658 0.16995 0.048841 0.0072547 0.00055483 2.2197e-05
r5 0.0010235 0.011201 0.066066 0.20154 0.31887 0.26196 0.11169 0.02466 0.0028101 0.00016962
r6 0.00016962 0.0028101 0.02466 0.11169 0.26196 0.31887 0.20154 0.066066 0.011201 0.0010235
r7 2.2197e-05 0.00055483 0.0072547 0.048841 0.16995 0.30658 0.28713 0.1396 0.035167 0.0048925
r8 2.2881e-06 8.6129e-05 0.0016806 0.016841 0.087039 0.23281 0.32308 0.23281 0.087039 0.01861
r9 1.8543e-07 1.0503e-05 0.00030628 0.0045756 0.035167 0.1396 0.28713 0.30658 0.16995 0.056673
r10 1.1798e-08 1.0053e-06 4.3874e-05 0.00097859 0.011201 0.066066 0.20154 0.31887 0.26196 0.13933
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map Scalars
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx value
_ ___ ________
fl_ar1_persistence 1 2 0.6
fl_ar1_step 2 3 0.083333
fl_shk_std 3 4 0.1
it_std_bound 4 5 3
9.1.3 Test FFY_TAUCHEN High Persistence, Low SD
[fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose] = ...
deal(0.99, 0.01, 7, true);
ffy_tauchen(fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose);
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx ndim numel rowN colN sum mean std coefvari min max
_ ___ ____ _____ ____ ____ ___ _______ _______ ________ ________ _______
ar_disc_ar1 1 1 2 7 7 1 0 0 0.15314 Inf -0.21266 0.21266
mt_disc_ar1_trans 2 6 2 49 7 7 7 0.14286 0.35338 2.4737 0 0.99961
xxx TABLE:ar_disc_ar1 xxxxxxxxxxxxxxxxxx
c1
_________
r1 -0.21266
r2 -0.14178
r3 -0.070888
r4 0
r5 0.070888
r6 0.14178
r7 0.21266
xxx TABLE:mt_disc_ar1_trans xxxxxxxxxxxxxxxxxx
c1 c2 c3 c4 c5 c6 c7
___________ ___________ ___________ __________ __________ __________ __________
r1 0.99957 0.00043152 0 0 0 0 0
r2 0.00011382 0.99955 0.0003337 0 0 0 0
r3 4.8683e-27 0.00015 0.99959 0.00025684 0 0 0
r4 1.4175e-70 1.0439e-26 0.00019675 0.99961 0.00019675 0 0
r5 1.9884e-135 4.986e-70 2.2273e-26 0.00025684 0.99959 0.00015 0
r6 1.2359e-221 1.149e-134 1.7451e-69 4.7287e-26 0.0003337 0.99955 0.00011382
r7 0 1.1738e-220 6.6059e-134 6.077e-69 9.9893e-26 0.00043152 0.99957
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map Scalars
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx value
_ ___ ________
fl_ar1_persistence 1 2 0.99
fl_ar1_step 2 3 0.070888
fl_shk_std 3 4 0.01
it_std_bound 4 5 3
9.1.4 Test FFY_TAUCHEN Low Persistence, Low SD
[fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose] = ...
deal(0.01, 0.01, 7, true);
ffy_tauchen(fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose);
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx ndim numel rowN colN sum mean std coefvari min max
_ ___ ____ _____ ____ ____ __________ __________ ________ __________ _________ ________
ar_disc_ar1 1 1 2 7 7 1 3.4694e-18 4.9564e-19 0.021604 4.3588e+16 -0.030002 0.030002
mt_disc_ar1_trans 2 6 2 49 7 7 7 0.14286 0.13667 0.95666 0.0057011 0.38294
xxx TABLE:ar_disc_ar1 xxxxxxxxxxxxxxxxxx
c1
_________
r1 -0.030002
r2 -0.020001
r3 -0.010001
r4 0
r5 0.010001
r6 0.020001
r7 0.030002
xxx TABLE:mt_disc_ar1_trans xxxxxxxxxxxxxxxxxx
c1 c2 c3 c4 c5 c6 c7
_________ ________ _______ _______ _______ ________ _________
r1 0.0067533 0.064018 0.2484 0.38278 0.23505 0.057298 0.0057011
r2 0.0065668 0.06286 0.24618 0.38287 0.23728 0.05838 0.0058656
r3 0.0063849 0.061717 0.24396 0.38292 0.2395 0.059478 0.0060344
r4 0.0062075 0.06059 0.24173 0.38294 0.24173 0.06059 0.0062075
r5 0.0060344 0.059478 0.2395 0.38292 0.24396 0.061717 0.0063849
r6 0.0058656 0.05838 0.23728 0.38287 0.24618 0.06286 0.0065668
r7 0.0057011 0.057298 0.23505 0.38278 0.2484 0.064018 0.0067533
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map Scalars
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx value
_ ___ ________
fl_ar1_persistence 1 2 0.01
fl_ar1_step 2 3 0.010001
fl_shk_std 3 4 0.01
it_std_bound 4 5 3
9.1.5 Test FFY_TAUCHEN High Persistence, High SD
[fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose] = ...
deal(0.99, 0.99, 7, true);
ffy_tauchen(fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose);
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx ndim numel rowN colN sum mean std coefvari min max
_ ___ ____ _____ ____ ____ ___________ ___________ _______ ___________ _______ _______
ar_disc_ar1 1 1 2 7 7 1 -7.1054e-15 -1.0151e-15 15.16 -1.4936e+16 -21.054 21.054
mt_disc_ar1_trans 2 6 2 49 7 7 7 0.14286 0.35338 2.4737 0 0.99961
xxx TABLE:ar_disc_ar1 xxxxxxxxxxxxxxxxxx
c1
___________
r1 -21.054
r2 -14.036
r3 -7.0179
r4 -1.7764e-15
r5 7.0179
r6 14.036
r7 21.054
xxx TABLE:mt_disc_ar1_trans xxxxxxxxxxxxxxxxxx
c1 c2 c3 c4 c5 c6 c7
___________ ___________ ___________ __________ __________ __________ __________
r1 0.99957 0.00043152 0 0 0 0 0
r2 0.00011382 0.99955 0.0003337 0 0 0 0
r3 4.8683e-27 0.00015 0.99959 0.00025684 0 0 0
r4 1.4175e-70 1.0439e-26 0.00019675 0.99961 0.00019675 0 0
r5 1.9884e-135 4.986e-70 2.2273e-26 0.00025684 0.99959 0.00015 0
r6 1.2359e-221 1.149e-134 1.7451e-69 4.7287e-26 0.0003337 0.99955 0.00011382
r7 0 1.1738e-220 6.6059e-134 6.077e-69 9.9893e-26 0.00043152 0.99957
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map Scalars
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx value
_ ___ ______
fl_ar1_persistence 1 2 0.99
fl_ar1_step 2 3 7.0179
fl_shk_std 3 4 0.99
it_std_bound 4 5 3
9.1.6 Test FFY_TAUCHEN Low Persistence, Low SD
[fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose] = ...
deal(0.01, 0.01, 7, true);
ffy_tauchen(fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose);
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx ndim numel rowN colN sum mean std coefvari min max
_ ___ ____ _____ ____ ____ __________ __________ ________ __________ _________ ________
ar_disc_ar1 1 1 2 7 7 1 3.4694e-18 4.9564e-19 0.021604 4.3588e+16 -0.030002 0.030002
mt_disc_ar1_trans 2 6 2 49 7 7 7 0.14286 0.13667 0.95666 0.0057011 0.38294
xxx TABLE:ar_disc_ar1 xxxxxxxxxxxxxxxxxx
c1
_________
r1 -0.030002
r2 -0.020001
r3 -0.010001
r4 0
r5 0.010001
r6 0.020001
r7 0.030002
xxx TABLE:mt_disc_ar1_trans xxxxxxxxxxxxxxxxxx
c1 c2 c3 c4 c5 c6 c7
_________ ________ _______ _______ _______ ________ _________
r1 0.0067533 0.064018 0.2484 0.38278 0.23505 0.057298 0.0057011
r2 0.0065668 0.06286 0.24618 0.38287 0.23728 0.05838 0.0058656
r3 0.0063849 0.061717 0.24396 0.38292 0.2395 0.059478 0.0060344
r4 0.0062075 0.06059 0.24173 0.38294 0.24173 0.06059 0.0062075
r5 0.0060344 0.059478 0.2395 0.38292 0.24396 0.061717 0.0063849
r6 0.0058656 0.05838 0.23728 0.38287 0.24618 0.06286 0.0065668
r7 0.0057011 0.057298 0.23505 0.38278 0.2484 0.064018 0.0067533
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map Scalars
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx value
_ ___ ________
fl_ar1_persistence 1 2 0.01
fl_ar1_step 2 3 0.010001
fl_shk_std 3 4 0.01
it_std_bound 4 5 3
9.2 FFY_ROUWENHORST AR1 Shock Discretization Example
Go back to fan’s MEconTools Toolbox (bookdown), Matlab Code Examples Repository (bookdown), or Math for Econ with Matlab Repository (bookdown).
Examples](https://fanwangecon.github.io/M4Econ/), or** Dynamic Asset This is the example vignette for function: ffy_rouwenhorst from the MEconTools Package. See also ffy_tauchen function from the MEconTools Package. This function discretize a mean zero AR1 process, uses Rouwenhorst (1995). See AR 1 Example for some details on how the AR1 process works. And See Kopecky and Suen (2010).
9.2.1 Test FFY_ROUWENHORST Defaults
Call the function with defaults.
ffy_rouwenhorst();
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx ndim numel rowN colN sum mean std coefvari min max
_ ___ ____ _____ ____ ____ ___ ____ _______ ________ ______ ______
ar_disc_ar1 1 1 2 5 5 1 0 0 0.39528 Inf -0.5 0.5
mt_disc_ar1_trans 2 11 2 25 5 5 5 0.2 0.18246 0.91229 0.0016 0.5136
xxx TABLE:ar_disc_ar1 xxxxxxxxxxxxxxxxxx
c1
_____
r1 -0.5
r2 -0.25
r3 0
r4 0.25
r5 0.5
xxx TABLE:mt_disc_ar1_trans xxxxxxxxxxxxxxxxxx
c1 c2 c3 c4 c5
______ ______ ______ ______ ______
r1 0.4096 0.4096 0.1536 0.0256 0.0016
r2 0.1024 0.4864 0.3264 0.0784 0.0064
r3 0.0256 0.2176 0.5136 0.2176 0.0256
r4 0.0064 0.0784 0.3264 0.4864 0.1024
r5 0.0016 0.0256 0.1536 0.4096 0.4096
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map Scalars
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx value
_ ___ _____
fl_ar1_beg 1 2 -0.5
fl_ar1_end 2 3 0.5
fl_ar1_persistence 3 4 0.6
fl_ar1_step 4 5 0.25
fl_p0 5 6 0.8
fl_q0 6 7 0.8
fl_shk_std 7 8 0.2
fl_sig_ar1 8 9 0.25
it_std_bound 9 10 0
9.2.2 Test FFY_ROUWENHORST Specify Parameters
With a grid of 10 points, the Rwouenhorst bounds on standard deviations are equall to Tauchen bounds of 3. With the not extremely persistent shock process here, the Tauchen and Rouwenhorst Results are very similar.
[fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose] = ...
deal(0.60, 0.10, 10, true);
ffy_rouwenhorst(fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose);
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx ndim numel rowN colN sum mean std coefvari min max
_ ___ ____ _____ ____ ____ __________ __________ _______ __________ ________ _______
ar_disc_ar1 1 1 2 10 10 1 5.5511e-17 5.5511e-18 0.2523 4.5451e+16 -0.375 0.375
mt_disc_ar1_trans 2 11 2 100 10 10 10 0.1 0.11724 1.1724 5.12e-07 0.33477
xxx TABLE:ar_disc_ar1 xxxxxxxxxxxxxxxxxx
c1
_________
r1 -0.375
r2 -0.29167
r3 -0.20833
r4 -0.125
r5 -0.041667
r6 0.041667
r7 0.125
r8 0.20833
r9 0.29167
r10 0.375
xxx TABLE:mt_disc_ar1_trans xxxxxxxxxxxxxxxxxx
c1 c2 c3 c4 c5 c6 c7 c8 c9 c10
__________ __________ __________ _________ ________ ________ _________ __________ __________ __________
r1 0.13422 0.30199 0.30199 0.17616 0.06606 0.016515 0.0027525 0.00029491 1.8432e-05 5.12e-07
r2 0.033554 0.20133 0.32716 0.26424 0.12662 0.038535 0.0075694 0.00093389 6.6048e-05 2.048e-06
r3 0.0083886 0.081789 0.26267 0.32755 0.21401 0.082747 0.019741 0.0028677 0.00023347 8.192e-06
r4 0.0020972 0.028312 0.14038 0.30946 0.30369 0.15877 0.047989 0.0084603 0.00081101 3.2768e-05
r5 0.00052429 0.009044 0.061145 0.20246 0.33477 0.25969 0.10585 0.023642 0.0027525 0.00013107
r6 0.00013107 0.0027525 0.023642 0.10585 0.25969 0.33477 0.20246 0.061145 0.009044 0.00052429
r7 3.2768e-05 0.00081101 0.0084603 0.047989 0.15877 0.30369 0.30946 0.14038 0.028312 0.0020972
r8 8.192e-06 0.00023347 0.0028677 0.019741 0.082747 0.21401 0.32755 0.26267 0.081789 0.0083886
r9 2.048e-06 6.6048e-05 0.00093389 0.0075694 0.038535 0.12662 0.26424 0.32716 0.20133 0.033554
r10 5.12e-07 1.8432e-05 0.00029491 0.0027525 0.016515 0.06606 0.17616 0.30199 0.30199 0.13422
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map Scalars
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx value
_ ___ ________
fl_ar1_beg 1 2 -0.375
fl_ar1_end 2 3 0.375
fl_ar1_persistence 3 4 0.6
fl_ar1_step 4 5 0.083333
fl_p0 5 6 0.8
fl_q0 6 7 0.8
fl_shk_std 7 8 0.1
fl_sig_ar1 8 9 0.125
it_std_bound 9 10 0
9.2.3 Test FFY_ROUWENHORST High Persistence, Low SD
[fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose] = ...
deal(0.90, 0.02, 7, true);
[ar_z, mt_z_trans] = ffy_tauchen(fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose);
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx ndim numel rowN colN sum mean std coefvari min max
_ ___ ____ _____ ____ ____ __________ __________ ________ __________ ________ _______
ar_disc_ar1 1 1 2 7 7 1 2.7756e-17 3.9651e-18 0.099119 2.4998e+16 -0.13765 0.13765
mt_disc_ar1_trans 2 6 2 49 7 7 7 0.14286 0.24922 1.7445 0 0.74865
xxx TABLE:ar_disc_ar1 xxxxxxxxxxxxxxxxxx
c1
__________
r1 -0.13765
r2 -0.091766
r3 -0.045883
r4 1.3878e-17
r5 0.045883
r6 0.091766
r7 0.13765
xxx TABLE:mt_disc_ar1_trans xxxxxxxxxxxxxxxxxx
c1 c2 c3 c4 c5 c6 c7
__________ __________ __________ __________ __________ __________ __________
r1 0.67682 0.32022 0.0029525 2.2423e-07 1.058e-13 0 0
r2 0.054147 0.7002 0.24422 0.0014299 6.5815e-08 1.8541e-14 0
r3 0.00012097 0.084213 0.73627 0.17874 0.00065947 1.8356e-08 3.1086e-15
r4 4.8643e-09 0.00028953 0.12539 0.74865 0.12539 0.00028953 4.8643e-09
r5 3.0921e-15 1.8356e-08 0.00065947 0.17874 0.73627 0.084213 0.00012097
r6 2.9554e-23 1.8558e-14 6.5815e-08 0.0014299 0.24422 0.7002 0.054147
r7 4.1477e-33 2.8319e-22 1.0576e-13 2.2423e-07 0.0029525 0.32022 0.67682
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map Scalars
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx value
_ ___ ________
fl_ar1_persistence 1 2 0.9
fl_ar1_step 2 3 0.045883
fl_shk_std 3 4 0.02
it_std_bound 4 5 3
ar_z_stationary = mt_z_trans^1000;
ar_z_stationary = ar_z_stationary(1,:);
fl_labor_agg = ar_z_stationary*exp(ar_z);
ar_z = exp(ar_z')/fl_labor_agg;
9.2.4 Test FFY_ROUWENHORST Low Persistence, Low SD
[fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose] = ...
deal(0.01, 0.01, 7, true);
ffy_rouwenhorst(fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose);
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx ndim numel rowN colN sum mean std coefvari min max
_ ___ ____ _____ ____ ____ ___ _______ ________ ________ _________ ________
ar_disc_ar1 1 1 2 7 7 1 0 0 0.017639 Inf -0.024496 0.024496
mt_disc_ar1_trans 2 11 2 49 7 7 7 0.14286 0.10985 0.76893 0.014711 0.31252
xxx TABLE:ar_disc_ar1 xxxxxxxxxxxxxxxxxx
c1
__________
r1 -0.024496
r2 -0.016331
r3 -0.0081654
r4 0
r5 0.0081654
r6 0.016331
r7 0.024496
xxx TABLE:mt_disc_ar1_trans xxxxxxxxxxxxxxxxxx
c1 c2 c3 c4 c5 c6 c7
________ ________ _______ _______ _______ ________ ________
r1 0.016586 0.097547 0.23904 0.31241 0.22966 0.090047 0.014711
r2 0.016258 0.096266 0.23749 0.31247 0.23124 0.091266 0.015008
r3 0.015936 0.094997 0.23594 0.31251 0.23281 0.092497 0.015311
r4 0.01562 0.093741 0.23438 0.31252 0.23438 0.093741 0.01562
r5 0.015311 0.092497 0.23281 0.31251 0.23594 0.094997 0.015936
r6 0.015008 0.091266 0.23124 0.31247 0.23749 0.096266 0.016258
r7 0.014711 0.090047 0.22966 0.31241 0.23904 0.097547 0.016586
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map Scalars
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx value
_ ___ _________
fl_ar1_beg 1 2 -0.024496
fl_ar1_end 2 3 0.024496
fl_ar1_persistence 3 4 0.01
fl_ar1_step 4 5 0.0081654
fl_p0 5 6 0.505
fl_q0 6 7 0.505
fl_shk_std 7 8 0.01
fl_sig_ar1 8 9 0.010001
it_std_bound 9 10 0
9.2.5 Test FFY_ROUWENHORST High Persistence, High SD
[fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose] = ...
deal(0.99, 0.99, 7, true);
ffy_rouwenhorst(fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose);
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx ndim numel rowN colN sum mean std coefvari min max
_ ___ ____ _____ ____ ____ __________ __________ _______ _________ __________ _______
ar_disc_ar1 1 1 2 7 7 1 3.5527e-15 5.0753e-16 12.378 2.439e+16 -17.19 17.19
mt_disc_ar1_trans 2 11 2 49 7 7 7 0.14286 0.34148 2.3904 1.5625e-14 0.97059
xxx TABLE:ar_disc_ar1 xxxxxxxxxxxxxxxxxx
c1
_______
r1 -17.19
r2 -11.46
r3 -5.7301
r4 0
r5 5.7301
r6 11.46
r7 17.19
xxx TABLE:mt_disc_ar1_trans xxxxxxxxxxxxxxxxxx
c1 c2 c3 c4 c5 c6 c7
__________ __________ __________ __________ __________ __________ __________
r1 0.97037 0.029257 0.00036756 2.4627e-06 9.2815e-09 1.8656e-11 1.5625e-14
r2 0.0048762 0.9705 0.024382 0.00024504 1.2314e-06 3.0938e-09 3.1094e-12
r3 2.4504e-05 0.009753 0.97057 0.019506 0.00014703 4.9254e-07 6.1877e-10
r4 1.2313e-07 7.3513e-05 0.01463 0.97059 0.01463 7.3513e-05 1.2313e-07
r5 6.1877e-10 4.9254e-07 0.00014703 0.019506 0.97057 0.009753 2.4504e-05
r6 3.1094e-12 3.0938e-09 1.2314e-06 0.00024504 0.024382 0.9705 0.0048762
r7 1.5625e-14 1.8656e-11 9.2815e-09 2.4627e-06 0.00036756 0.029257 0.97037
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map Scalars
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx value
_ ___ ______
fl_ar1_beg 1 2 -17.19
fl_ar1_end 2 3 17.19
fl_ar1_persistence 3 4 0.99
fl_ar1_step 4 5 5.7301
fl_p0 5 6 0.995
fl_q0 6 7 0.995
fl_shk_std 7 8 0.99
fl_sig_ar1 8 9 7.0179
it_std_bound 9 10 0
9.2.6 Test FFY_ROUWENHORST Low Persistence, Low SD
[fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose] = ...
deal(0.01, 0.01, 7, true);
ffy_rouwenhorst(fl_ar1_persistence, fl_shk_std, it_disc_points, bl_verbose);
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx ndim numel rowN colN sum mean std coefvari min max
_ ___ ____ _____ ____ ____ ___ _______ ________ ________ _________ ________
ar_disc_ar1 1 1 2 7 7 1 0 0 0.017639 Inf -0.024496 0.024496
mt_disc_ar1_trans 2 11 2 49 7 7 7 0.14286 0.10985 0.76893 0.014711 0.31252
xxx TABLE:ar_disc_ar1 xxxxxxxxxxxxxxxxxx
c1
__________
r1 -0.024496
r2 -0.016331
r3 -0.0081654
r4 0
r5 0.0081654
r6 0.016331
r7 0.024496
xxx TABLE:mt_disc_ar1_trans xxxxxxxxxxxxxxxxxx
c1 c2 c3 c4 c5 c6 c7
________ ________ _______ _______ _______ ________ ________
r1 0.016586 0.097547 0.23904 0.31241 0.22966 0.090047 0.014711
r2 0.016258 0.096266 0.23749 0.31247 0.23124 0.091266 0.015008
r3 0.015936 0.094997 0.23594 0.31251 0.23281 0.092497 0.015311
r4 0.01562 0.093741 0.23438 0.31252 0.23438 0.093741 0.01562
r5 0.015311 0.092497 0.23281 0.31251 0.23594 0.094997 0.015936
r6 0.015008 0.091266 0.23124 0.31247 0.23749 0.096266 0.016258
r7 0.014711 0.090047 0.22966 0.31241 0.23904 0.097547 0.016586
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_container_map Scalars
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx value
_ ___ _________
fl_ar1_beg 1 2 -0.024496
fl_ar1_end 2 3 0.024496
fl_ar1_persistence 3 4 0.01
fl_ar1_step 4 5 0.0081654
fl_p0 5 6 0.505
fl_q0 6 7 0.505
fl_shk_std 7 8 0.01
fl_sig_ar1 8 9 0.010001
it_std_bound 9 10 0