Question One E-Garch library(fGarch) ## NOTE: Packages ‘fBasics’, ‘timeDate’, and ‘timeSeries’ are no longer ## attached to the search() path when ‘fGarch’ is attached. ## ## If needed attach them yourself in your R script by e.g., ## require(“timeSeries”) library(rugarch) ## Loading required package: parallel ## ## Attaching package: ‘rugarch’ ## The following object is masked from ‘package:stats’: ## ## sigma library(fitdistrplus) ## Loading required package: MASS ## Loading required package: survival ## ## Attaching package: ‘fitdistrplus’ ## The following object is masked from ‘package:rugarch’: ## ## fitdist #Loading the file D1 = read.csv(“DATA25.CSV”);D1 ## Year Month STOCK GDP CPI PENSION INFLATION CLAIMS INTEREST ## 1 2025 April 3.74 4.11 6.12 13.50 5.58 4.59 4.12 ## 2 2025 March 3.81 3.62 6.33 13.59 5.53 4.53 3.97 ## 3 2025 February 3.98 3.45 6.47 13.49 5.70 4.53 4.07 ## 4 2025 January 4.21 3.28 6.48 13.47 4.04 4.63 4.20 ## 5 2024 December 4.50 2.99 6.51 13.70 4.35 4.95 4.44 ## 6 2024 November 4.81 2.75 6.56 13.73 4.28 5.20 4.62 ## 7 2024 October 5.14 2.72 6.57 13.71 3.95 5.61 4.45 ## 8 2024 September 5.50 3.56 6.64 13.83 3.73 6.24 4.38 ## 9 2024 August 5.77 4.36 6.66 13.85 4.18 6.89 4.42 ## 10 2024 July 5.97 4.31 6.68 13.76 4.46 7.40 4.40 ## 11 2024 June 4.64 6.22 6.68 13.66 4.83 7.79 4.37 ## 12 2024 May 6.49 5.10 6.81 13.65 4.50 7.98 4.50 ## 13 2024 April 6.73 5.00 7.06 13.61 4.73 8.15 4.21 ## 14 2024 March 6.97 5.70 7.16 13.61 5.72 8.33 4.22 ## 15 2024 February 7.26 6.31 7.19 13.81 7.06 8.40 4.30 ## 16 2024 January 7.50 6.85 7.19 14.23 8.04 8.36 4.59 ## 17 2023 December 7.67 6.63 7.20 14.29 7.47 8.21 4.73 ## 18 2023 November 7.87 6.80 7.25 14.39 9.21 8.13 4.96 ## 19 2023 October 8.10 6.92 7.23 14.24 11.70 7.84 4.78 ## 20 2023 September 8.32 6.78 7.25 14.25 11.48 7.20 4.56 ## 21 2023 August 8.52 6.73 7.27 14.45 10.28 6.76 4.56 ## 22 2023 July 8.68 7.28 7.33 15.32 9.04 6.43 4.55 ## 23 2023 June 8.77 7.88 7.36 15.49 6.99 6.26 4.57 ## 24 2023 May 8.78 8.03 7.46 17.28 6.35 6.30 4.57 ## 25 2023 April 8.71 7.90 7.62 18.47 6.68 6.43 5.70 ## 26 2023 March 8.59 9.19 7.72 22.51 6.47 6.48 5.75 ## 27 2023 February 8.30 9.23 7.75 23.03 6.34 6.50 5.52 ## 28 2023 January 7.95 8.98 7.77 23.04 6.26 6.47 5.27 ## 29 2022 December 7.66 9.06 7.78 23.43 6.40 6.44 5.53 ## 30 2022 November 7.38 9.48 7.86 22.36 5.80 6.46 5.79 ## 31 2022 October 7.48 9.59 7.87 23.27 5.00 6.59 5.04 ## 32 2022 September 6.81 9.18 7.88 20.84 5.27 6.72 4.87 ## 33 2022 August 6.61 8.53 7.95 19.98 6.45 6.88 4.71 ## 34 2022 July 6.45 8.32 8.02 18.61 6.84 6.87 4.76 ## 35 2022 June 6.29 7.91 8.06 17.76 7.78 6.77 4.91 ## 36 2022 May 6.16 7.08 8.21 17.42 8.01 6.58 4.94 ## 37 2022 April 6.05 6.47 8.41 16.69 7.32 6.42 4.83 ## 38 2022 March 6.29 5.56 8.43 16.67 6.72 6.31 4.59 ## 39 2022 February 6.23 5.08 8.60 16.76 5.97 6.29 4.53 ## 40 2022 January 6.08 5.39 8.66 15.11 5.84 6.34 5.20 ## 41 2021 December 5.62 5.73 8.69 14.05 6.62 6.54 4.74 ## 42 2021 November 6.10 5.80 8.83 13.05 7.03 6.63 5.50 ## 43 2021 October 6.07 6.45 8.84 12.20 6.87 6.65 5.04 ## 44 2021 September 5.35 6.91 8.96 12.08 7.08 6.69 5.68 ## 45 2021 August 5.71 6.57 9.13 11.30 6.31 6.63 6.57 ## 46 2021 July 5.53 6.55 9.16 10.83 5.61 6.63 6.92 ## 47 2021 June 5.35 6.32 9.19 9.81 5.53 6.74 9.25 ## 48 2021 May 5.20 5.87 9.28 10.13 6.02 6.88 9.06 ## 49 2021 April 4.66 5.76 9.57 10.32 6.09 6.97 9.15 ## 50 2021 March 5.17 5.90 9.60 11.90 6.43 7.08 9.29 ## 51 2021 February 5.16 5.78 9.76 11.80 6.60 7.19 10.22 ## 52 2021 January 5.74 5.69 9.85 11.97 8.36 7.33 10.47 ## 53 2020 December 5.41 5.62 9.92 12.46 7.67 7.19 11.03 ## 54 2020 November 5.53 5.33 10.06 12.77 7.39 7.05 11.70 ## 55 2020 October 5.67 4.84 10.16 13.33 7.30 6.85 10.85 ## 56 2020 September 5.79 4.20 10.11 13.62 6.41 6.58 8.63 ## 57 2020 August 5.87 4.36 10.23 13.89 6.27 6.39 7.64 ## 58 2020 July 6.01 4.36 10.28 14.23 6.86 6.21 8.15 ## 59 2020 June 6.16 4.59 10.34 14.19 7.21 6.01 9.32 ## 60 2020 May 6.18 5.33 10.54 14.17 7.15 5.72 8.48 ## 61 2020 April 6.03 6.01 10.92 14.05 7.36 5.39 7.29 ## 62 2020 March 5.84 5.84 10.96 13.90 7.76 5.05 7.01 ## 63 2020 February 5.72 7.17 11.17 14.28 8.29 4.75 6.84 ## 64 2020 January 5.29 5.78 11.32 14.19 6.67 4.50 6.82 ## 65 2019 December 5.20 5.82 11.28 14.29 6.03 4.44 7.23 ## 66 2019 November 5.19 5.56 11.43 14.65 4.91 4.56 6.33 ## 67 2019 October 5.19 4.95 11.46 14.54 4.05 4.96 5.98 ## 68 2019 September 5.24 3.83 11.49 14.47 4.14 5.61 5.86 ## 69 2019 August 5.40 5.00 11.77 14.33 4.11 6.33 5.00 ## 70 2019 July 5.32 6.27 12.18 14.24 4.45 7.24 4.66 ## 71 2019 June 5.16 5.70 12.47 14.95 3.67 8.20 4.43 ## 72 2019 May 5.04 4.49 12.79 13.89 3.20 9.38 4.45 ## 73 2019 April 4.91 6.58 12.73 14.11 3.25 10.67 4.06 ## 74 2019 April 4.91 6.58 13.07 14.06 4.14 12.04 3.77 ## 75 2019 March 4.67 4.35 13.31 14.53 5.32 13.29 4.22 ## 76 2019 February 4.65 4.14 13.32 15.21 6.09 14.33 3.52 ## 77 2019 January 4.68 4.70 13.67 15.88 7.74 15.27 3.85 ## 78 2018 December 4.69 5.71 13.79 16.02 10.05 15.97 4.07 ## 79 2018 November 4.59 5.58 13.96 15.94 12.22 16.40 3.88 ## 80 2018 October 4.53 5.53 14.01 15.88 13.06 16.50 4.19 ## 81 2018 September 4.53 5.70 14.38 15.89 15.61 16.45 3.88 ## 82 2018 August 4.63 4.04 14.40 18.37 16.69 15.93 3.50 ## 83 2018 July 4.95 4.35 14.48 17.85 18.31 15.10 3.53 ## 84 2018 June 5.20 4.28 14.56 16.87 18.93 14.02 3.47 ## 85 2018 May 5.61 3.95 14.83 16.67 19.72 12.82 3.31 ## 86 2018 April 6.24 3.73 14.97 16.35 18.91 11.49 3.10 ## 87 2018 March 6.89 4.18 16.27 15.96 17.32 10.18 3.01 ## 88 2018 February 7.40 4.46 16.40 15.39 16.67 9.00 2.82 ## 89 2018 January 7.79 4.83 16.94 14.67 15.53 7.88 2.59 ## 90 2017 December 7.98 4.50 18.68 12.99 14.48 6.88 2.36 ## 91 2017 November 8.15 4.73 18.46 11.25 12.95 5.96 2.21 ## 92 2017 October 8.33 5.72 18.54 9.66 12.05 5.20 1.78 ## 93 2017 September 8.40 7.06 18.85 8.93 9.19 4.49 1.65 ## 94 2017 August 8.36 8.04 18.62 8.18 6.54 4.05 1.71 ## 95 2017 July 8.21 7.47 18.92 7.55 5.42 3.93 1.38 ## 96 2017 June 8.13 9.21 19.46 7.83 4.51 3.96 1.25 ## 97 2017 May 7.84 11.70 19.59 7.65 3.84 4.02 1.16 ## 98 2017 April 7.20 11.48 21.16 7.79 3.18 4.12 0.86 ## 99 2017 March 6.76 10.28 21.83 8.44 3.21 4.40 0.75 ## 100 2017 February 6.43 9.04 23.31 9.10 3.22 4.69 0.93 ## 101 2017 January 6.26 6.99 24.16 9.48 3.57 5.03 1.26 ## 102 2016 December 6.30 6.35 25.99 9.74 3.49 5.43 1.26 ## 103 2016 November 6.43 6.68 26.47 10.38 3.88 5.85 1.18 ## 104 2016 October 6.48 6.47 27.38 9.17 3.66 6.32 1.46 ## 105 2016 September 6.50 6.34 29.02 8.01 3.97 7.03 1.24 ## 106 2016 August 6.47 6.26 29.32 7.61 5.18 7.88 1.11 ## 107 2016 July 6.44 6.40 29.63 7.21 5.95 8.64 1.00 ## 108 2016 June 6.46 5.80 30.11 7.01 5.32 9.24 1.15 ## 109 2016 May 6.59 5.00 31.64 6.67 5.00 10.24 0.96 ## 110 2016 April 6.72 5.27 32.65 6.26 6.62 11.42 0.88 ## 111 2016 March 6.88 6.45 33.54 6.22 6.74 12.41 0.73 ## 112 2016 February 6.87 6.84 34.44 6.22 7.36 13.42 0.96 ## 113 2016 January 6.77 7.78 34.09 6.20 8.44 14.35 0.76 ## 114 2015 December 6.58 8.01 33.46 6.22 8.60 15.11 0.52 ## 115 2015 November 6.42 7.32 33.70 6.54 9.61 15.93 0.43 ## 116 2015 October 6.31 6.72 33.26 6.55 12.42 16.72 0.43 ## 117 2015 September 6.29 5.97 32.75 6.92 14.60 17.07 0.32 ## 118 2015 August 6.34 5.84 32.92 6.58 14.69 16.87 0.64 ## 119 2015 July 6.54 6.62 32.12 6.44 13.22 16.56 0.88 #Loading the bonds D2 = D1$STOCK;D2 ## [1] 3.74 3.81 3.98 4.21 4.50 4.81 5.14 5.50 5.77 5.97 4.64 6.49 6.73 6.97 7.26 ## [16] 7.50 7.67 7.87 8.10 8.32 8.52 8.68 8.77 8.78 8.71 8.59 8.30 7.95 7.66 7.38 ## [31] 7.48 6.81 6.61 6.45 6.29 6.16 6.05 6.29 6.23 6.08 5.62 6.10 6.07 5.35 5.71 ## [46] 5.53 5.35 5.20 4.66 5.17 5.16 5.74 5.41 5.53 5.67 5.79 5.87 6.01 6.16 6.18 ## [61] 6.03 5.84 5.72 5.29 5.20 5.19 5.19 5.24 5.40 5.32 5.16 5.04 4.91 4.91 4.67 ## [76] 4.65 4.68 4.69 4.59 4.53 4.53 4.63 4.95 5.20 5.61 6.24 6.89 7.40 7.79 7.98 ## [91] 8.15 8.33 8.40 8.36 8.21 8.13 7.84 7.20 6.76 6.43 6.26 6.30 6.43 6.48 6.50 ## [106] 6.47 6.44 6.46 6.59 6.72 6.88 6.87 6.77 6.58 6.42 6.31 6.29 6.34 6.54 #Model Fit M1 = ugarchspec(variance.model = list(model = “eGARCH”, garchOrder =c(1,2)),mean.model = list(armaOrder = c(1,2), include.mean = FALSE),distribution.model = “norm”);M1 ## ## ——————————— ## * GARCH Model Spec ## ———————————* ## ## Conditional Variance Dynamics
## ———————————— ## GARCH Model : eGARCH(1,2) ## Variance Targeting : FALSE ## ## Conditional Mean Dynamics ## ———————————— ## Mean Model : ARFIMA(1,0,2) ## Include Mean : FALSE ## GARCH-in-Mean : FALSE ## ## Conditional Distribution ## ———————————— ## Distribution : norm ## Includes Skew : FALSE ## Includes Shape : FALSE ## Includes Lambda : FALSE #Model summary summary(M1) ## Length Class Mode ## 1 uGARCHspec S4 #Log returns log.D2 = diff(D2);log.D2 ## [1] 0.07 0.17 0.23 0.29 0.31 0.33 0.36 0.27 0.20 -1.33 1.85 0.24 ## [13] 0.24 0.29 0.24 0.17 0.20 0.23 0.22 0.20 0.16 0.09 0.01 -0.07 ## [25] -0.12 -0.29 -0.35 -0.29 -0.28 0.10 -0.67 -0.20 -0.16 -0.16 -0.13 -0.11 ## [37] 0.24 -0.06 -0.15 -0.46 0.48 -0.03 -0.72 0.36 -0.18 -0.18 -0.15 -0.54 ## [49] 0.51 -0.01 0.58 -0.33 0.12 0.14 0.12 0.08 0.14 0.15 0.02 -0.15 ## [61] -0.19 -0.12 -0.43 -0.09 -0.01 0.00 0.05 0.16 -0.08 -0.16 -0.12 -0.13 ## [73] 0.00 -0.24 -0.02 0.03 0.01 -0.10 -0.06 0.00 0.10 0.32 0.25 0.41 ## [85] 0.63 0.65 0.51 0.39 0.19 0.17 0.18 0.07 -0.04 -0.15 -0.08 -0.29 ## [97] -0.64 -0.44 -0.33 -0.17 0.04 0.13 0.05 0.02 -0.03 -0.03 0.02 0.13 ## [109] 0.13 0.16 -0.01 -0.10 -0.19 -0.16 -0.11 -0.02 0.05 0.20 #Plot logs plot(log.D2)

ts.plot(log.D2)

#Removing negatives s = log.D2^2;s ## [1] 0.0049 0.0289 0.0529 0.0841 0.0961 0.1089 0.1296 0.0729 0.0400 1.7689 ## [11] 3.4225 0.0576 0.0576 0.0841 0.0576 0.0289 0.0400 0.0529 0.0484 0.0400 ## [21] 0.0256 0.0081 0.0001 0.0049 0.0144 0.0841 0.1225 0.0841 0.0784 0.0100 ## [31] 0.4489 0.0400 0.0256 0.0256 0.0169 0.0121 0.0576 0.0036 0.0225 0.2116 ## [41] 0.2304 0.0009 0.5184 0.1296 0.0324 0.0324 0.0225 0.2916 0.2601 0.0001 ## [51] 0.3364 0.1089 0.0144 0.0196 0.0144 0.0064 0.0196 0.0225 0.0004 0.0225 ## [61] 0.0361 0.0144 0.1849 0.0081 0.0001 0.0000 0.0025 0.0256 0.0064 0.0256 ## [71] 0.0144 0.0169 0.0000 0.0576 0.0004 0.0009 0.0001 0.0100 0.0036 0.0000 ## [81] 0.0100 0.1024 0.0625 0.1681 0.3969 0.4225 0.2601 0.1521 0.0361 0.0289 ## [91] 0.0324 0.0049 0.0016 0.0225 0.0064 0.0841 0.4096 0.1936 0.1089 0.0289 ## [101] 0.0016 0.0169 0.0025 0.0004 0.0009 0.0009 0.0004 0.0169 0.0169 0.0256 ## [111] 0.0001 0.0100 0.0361 0.0256 0.0121 0.0004 0.0025 0.0400 #Log Returns log.D2 = diff(D2);log.D2 ## [1] 0.07 0.17 0.23 0.29 0.31 0.33 0.36 0.27 0.20 -1.33 1.85 0.24 ## [13] 0.24 0.29 0.24 0.17 0.20 0.23 0.22 0.20 0.16 0.09 0.01 -0.07 ## [25] -0.12 -0.29 -0.35 -0.29 -0.28 0.10 -0.67 -0.20 -0.16 -0.16 -0.13 -0.11 ## [37] 0.24 -0.06 -0.15 -0.46 0.48 -0.03 -0.72 0.36 -0.18 -0.18 -0.15 -0.54 ## [49] 0.51 -0.01 0.58 -0.33 0.12 0.14 0.12 0.08 0.14 0.15 0.02 -0.15 ## [61] -0.19 -0.12 -0.43 -0.09 -0.01 0.00 0.05 0.16 -0.08 -0.16 -0.12 -0.13 ## [73] 0.00 -0.24 -0.02 0.03 0.01 -0.10 -0.06 0.00 0.10 0.32 0.25 0.41 ## [85] 0.63 0.65 0.51 0.39 0.19 0.17 0.18 0.07 -0.04 -0.15 -0.08 -0.29 ## [97] -0.64 -0.44 -0.33 -0.17 0.04 0.13 0.05 0.02 -0.03 -0.03 0.02 0.13 ## [109] 0.13 0.16 -0.01 -0.10 -0.19 -0.16 -0.11 -0.02 0.05 0.20 #Plotting Log Returns plot(log.D2)

ts.plot(log.D2)

#Model Fitting M1fit = ugarchfit(data = log.D2, spec = M1);M1fit ## ## ——————————— ## * GARCH Model Fit ## ———————————* ## ## Conditional Variance Dynamics
## ———————————– ## GARCH Model : eGARCH(1,2) ## Mean Model : ARFIMA(1,0,2) ## Distribution : norm ## ## Optimal Parameters ## ———————————— ## Estimate Std. Error t value Pr(>|t|) ## ar1 0.311434 0.042572 7.3154 0.000000 ## ma1 0.010609 0.018537 0.5723 0.567121 ## ma2 0.073935 0.012835 5.7607 0.000000 ## omega -0.527684 0.313081 -1.6855 0.091901 ## alpha1 0.299353 0.160045 1.8704 0.061424 ## beta1 0.425412 0.122959 3.4598 0.000541 ## beta2 0.338834 0.125646 2.6967 0.007002 ## gamma1 1.196180 0.261571 4.5731 0.000005 ## ## Robust Standard Errors: ## Estimate Std. Error t value Pr(>|t|) ## ar1 0.311434 0.044898 6.93644 0.000000 ## ma1 0.010609 0.001744 6.08321 0.000000 ## ma2 0.073935 0.001853 39.89242 0.000000 ## omega -0.527684 0.561063 -0.94051 0.346957 ## alpha1 0.299353 0.231491 1.29315 0.195959 ## beta1 0.425412 0.116389 3.65509 0.000257 ## beta2 0.338834 0.135398 2.50250 0.012332 ## gamma1 1.196180 0.301857 3.96273 0.000074 ## ## LogLikelihood : -0.1537826 ## ## Information Criteria ## ———————————— ##
## Akaike 0.13820 ## Bayes 0.32604 ## Shibata 0.12976 ## Hannan-Quinn 0.21447 ## ## Weighted Ljung-Box Test on Standardized Residuals ## ———————————— ## statistic p-value ## Lag[1] 0.2713 0.6025 ## Lag[2*(p+q)+(p+q)-1][8] 4.5994 0.4182 ## Lag[4*(p+q)+(p+q)-1][14] 8.5612 0.2816 ## d.o.f=3 ## H0 : No serial correlation ## ## Weighted Ljung-Box Test on Standardized Squared Residuals ## ———————————— ## statistic p-value ## Lag[1] 0.004073 0.9491 ## Lag[2*(p+q)+(p+q)-1][8] 0.457946 0.9971 ## Lag[4*(p+q)+(p+q)-1][14] 0.884533 0.9998 ## d.o.f=3 ## ## Weighted ARCH LM Tests ## ———————————— ## Statistic Shape Scale P-Value ## ARCH Lag[4] 0.1196 0.500 2.000 0.7295 ## ARCH Lag[6] 0.2442 1.461 1.711 0.9587 ## ARCH Lag[8] 0.4800 2.368 1.583 0.9834 ## ## Nyblom stability test ## ———————————— ## Joint Statistic: 2.06 ## Individual Statistics:
## ar1 0.3068 ## ma1 0.4813 ## ma2 0.1811 ## omega 0.2880 ## alpha1 0.1142 ## beta1 0.3859 ## beta2 0.3969 ## gamma1 0.2344 ## ## Asymptotic Critical Values (10% 5% 1%) ## Joint Statistic: 1.89 2.11 2.59 ## Individual Statistic: 0.35 0.47 0.75 ## ## Sign Bias Test ## ———————————— ## t-value prob sig ## Sign Bias 0.1323865 0.8949
## Negative Sign Bias 0.0001613 0.9999
## Positive Sign Bias 0.5647460 0.5734
## Joint Effect 0.3264686 0.9550
## ## ## Adjusted Pearson Goodness-of-Fit Test: ## ———————————— ## group statistic p-value(g-1) ## 1 20 32.17 0.02991 ## 2 30 41.15 0.06678 ## 3 40 55.56 0.04147 ## 4 50 68.62 0.03351 ## ## ## Elapsed time : 0.909817 #Plotting M1 plot(M1fit, which=9)

plot(M1fit, which=12)

plot(M1fit, which=7)

#Summary M1fit ## ## ——————————— ## * GARCH Model Fit ## ———————————* ## ## Conditional Variance Dynamics
## ———————————– ## GARCH Model : eGARCH(1,2) ## Mean Model : ARFIMA(1,0,2) ## Distribution : norm ## ## Optimal Parameters ## ———————————— ## Estimate Std. Error t value Pr(>|t|) ## ar1 0.311434 0.042572 7.3154 0.000000 ## ma1 0.010609 0.018537 0.5723 0.567121 ## ma2 0.073935 0.012835 5.7607 0.000000 ## omega -0.527684 0.313081 -1.6855 0.091901 ## alpha1 0.299353 0.160045 1.8704 0.061424 ## beta1 0.425412 0.122959 3.4598 0.000541 ## beta2 0.338834 0.125646 2.6967 0.007002 ## gamma1 1.196180 0.261571 4.5731 0.000005 ## ## Robust Standard Errors: ## Estimate Std. Error t value Pr(>|t|) ## ar1 0.311434 0.044898 6.93644 0.000000 ## ma1 0.010609 0.001744 6.08321 0.000000 ## ma2 0.073935 0.001853 39.89242 0.000000 ## omega -0.527684 0.561063 -0.94051 0.346957 ## alpha1 0.299353 0.231491 1.29315 0.195959 ## beta1 0.425412 0.116389 3.65509 0.000257 ## beta2 0.338834 0.135398 2.50250 0.012332 ## gamma1 1.196180 0.301857 3.96273 0.000074 ## ## LogLikelihood : -0.1537826 ## ## Information Criteria ## ———————————— ##
## Akaike 0.13820 ## Bayes 0.32604 ## Shibata 0.12976 ## Hannan-Quinn 0.21447 ## ## Weighted Ljung-Box Test on Standardized Residuals ## ———————————— ## statistic p-value ## Lag[1] 0.2713 0.6025 ## Lag[2*(p+q)+(p+q)-1][8] 4.5994 0.4182 ## Lag[4*(p+q)+(p+q)-1][14] 8.5612 0.2816 ## d.o.f=3 ## H0 : No serial correlation ## ## Weighted Ljung-Box Test on Standardized Squared Residuals ## ———————————— ## statistic p-value ## Lag[1] 0.004073 0.9491 ## Lag[2*(p+q)+(p+q)-1][8] 0.457946 0.9971 ## Lag[4*(p+q)+(p+q)-1][14] 0.884533 0.9998 ## d.o.f=3 ## ## Weighted ARCH LM Tests ## ———————————— ## Statistic Shape Scale P-Value ## ARCH Lag[4] 0.1196 0.500 2.000 0.7295 ## ARCH Lag[6] 0.2442 1.461 1.711 0.9587 ## ARCH Lag[8] 0.4800 2.368 1.583 0.9834 ## ## Nyblom stability test ## ———————————— ## Joint Statistic: 2.06 ## Individual Statistics:
## ar1 0.3068 ## ma1 0.4813 ## ma2 0.1811 ## omega 0.2880 ## alpha1 0.1142 ## beta1 0.3859 ## beta2 0.3969 ## gamma1 0.2344 ## ## Asymptotic Critical Values (10% 5% 1%) ## Joint Statistic: 1.89 2.11 2.59 ## Individual Statistic: 0.35 0.47 0.75 ## ## Sign Bias Test ## ———————————— ## t-value prob sig ## Sign Bias 0.1323865 0.8949
## Negative Sign Bias 0.0001613 0.9999
## Positive Sign Bias 0.5647460 0.5734
## Joint Effect 0.3264686 0.9550
## ## ## Adjusted Pearson Goodness-of-Fit Test: ## ———————————— ## group statistic p-value(g-1) ## 1 20 32.17 0.02991 ## 2 30 41.15 0.06678 ## 3 40 55.56 0.04147 ## 4 50 68.62 0.03351 ## ## ## Elapsed time : 0.909817 #Question Three

library(fGarch) library(rugarch) library(fitdistrplus) data = read.csv(“DATA25.csv”);data ## Year Month STOCK GDP CPI PENSION INFLATION CLAIMS INTEREST ## 1 2025 April 3.74 4.11 6.12 13.50 5.58 4.59 4.12 ## 2 2025 March 3.81 3.62 6.33 13.59 5.53 4.53 3.97 ## 3 2025 February 3.98 3.45 6.47 13.49 5.70 4.53 4.07 ## 4 2025 January 4.21 3.28 6.48 13.47 4.04 4.63 4.20 ## 5 2024 December 4.50 2.99 6.51 13.70 4.35 4.95 4.44 ## 6 2024 November 4.81 2.75 6.56 13.73 4.28 5.20 4.62 ## 7 2024 October 5.14 2.72 6.57 13.71 3.95 5.61 4.45 ## 8 2024 September 5.50 3.56 6.64 13.83 3.73 6.24 4.38 ## 9 2024 August 5.77 4.36 6.66 13.85 4.18 6.89 4.42 ## 10 2024 July 5.97 4.31 6.68 13.76 4.46 7.40 4.40 ## 11 2024 June 4.64 6.22 6.68 13.66 4.83 7.79 4.37 ## 12 2024 May 6.49 5.10 6.81 13.65 4.50 7.98 4.50 ## 13 2024 April 6.73 5.00 7.06 13.61 4.73 8.15 4.21 ## 14 2024 March 6.97 5.70 7.16 13.61 5.72 8.33 4.22 ## 15 2024 February 7.26 6.31 7.19 13.81 7.06 8.40 4.30 ## 16 2024 January 7.50 6.85 7.19 14.23 8.04 8.36 4.59 ## 17 2023 December 7.67 6.63 7.20 14.29 7.47 8.21 4.73 ## 18 2023 November 7.87 6.80 7.25 14.39 9.21 8.13 4.96 ## 19 2023 October 8.10 6.92 7.23 14.24 11.70 7.84 4.78 ## 20 2023 September 8.32 6.78 7.25 14.25 11.48 7.20 4.56 ## 21 2023 August 8.52 6.73 7.27 14.45 10.28 6.76 4.56 ## 22 2023 July 8.68 7.28 7.33 15.32 9.04 6.43 4.55 ## 23 2023 June 8.77 7.88 7.36 15.49 6.99 6.26 4.57 ## 24 2023 May 8.78 8.03 7.46 17.28 6.35 6.30 4.57 ## 25 2023 April 8.71 7.90 7.62 18.47 6.68 6.43 5.70 ## 26 2023 March 8.59 9.19 7.72 22.51 6.47 6.48 5.75 ## 27 2023 February 8.30 9.23 7.75 23.03 6.34 6.50 5.52 ## 28 2023 January 7.95 8.98 7.77 23.04 6.26 6.47 5.27 ## 29 2022 December 7.66 9.06 7.78 23.43 6.40 6.44 5.53 ## 30 2022 November 7.38 9.48 7.86 22.36 5.80 6.46 5.79 ## 31 2022 October 7.48 9.59 7.87 23.27 5.00 6.59 5.04 ## 32 2022 September 6.81 9.18 7.88 20.84 5.27 6.72 4.87 ## 33 2022 August 6.61 8.53 7.95 19.98 6.45 6.88 4.71 ## 34 2022 July 6.45 8.32 8.02 18.61 6.84 6.87 4.76 ## 35 2022 June 6.29 7.91 8.06 17.76 7.78 6.77 4.91 ## 36 2022 May 6.16 7.08 8.21 17.42 8.01 6.58 4.94 ## 37 2022 April 6.05 6.47 8.41 16.69 7.32 6.42 4.83 ## 38 2022 March 6.29 5.56 8.43 16.67 6.72 6.31 4.59 ## 39 2022 February 6.23 5.08 8.60 16.76 5.97 6.29 4.53 ## 40 2022 January 6.08 5.39 8.66 15.11 5.84 6.34 5.20 ## 41 2021 December 5.62 5.73 8.69 14.05 6.62 6.54 4.74 ## 42 2021 November 6.10 5.80 8.83 13.05 7.03 6.63 5.50 ## 43 2021 October 6.07 6.45 8.84 12.20 6.87 6.65 5.04 ## 44 2021 September 5.35 6.91 8.96 12.08 7.08 6.69 5.68 ## 45 2021 August 5.71 6.57 9.13 11.30 6.31 6.63 6.57 ## 46 2021 July 5.53 6.55 9.16 10.83 5.61 6.63 6.92 ## 47 2021 June 5.35 6.32 9.19 9.81 5.53 6.74 9.25 ## 48 2021 May 5.20 5.87 9.28 10.13 6.02 6.88 9.06 ## 49 2021 April 4.66 5.76 9.57 10.32 6.09 6.97 9.15 ## 50 2021 March 5.17 5.90 9.60 11.90 6.43 7.08 9.29 ## 51 2021 February 5.16 5.78 9.76 11.80 6.60 7.19 10.22 ## 52 2021 January 5.74 5.69 9.85 11.97 8.36 7.33 10.47 ## 53 2020 December 5.41 5.62 9.92 12.46 7.67 7.19 11.03 ## 54 2020 November 5.53 5.33 10.06 12.77 7.39 7.05 11.70 ## 55 2020 October 5.67 4.84 10.16 13.33 7.30 6.85 10.85 ## 56 2020 September 5.79 4.20 10.11 13.62 6.41 6.58 8.63 ## 57 2020 August 5.87 4.36 10.23 13.89 6.27 6.39 7.64 ## 58 2020 July 6.01 4.36 10.28 14.23 6.86 6.21 8.15 ## 59 2020 June 6.16 4.59 10.34 14.19 7.21 6.01 9.32 ## 60 2020 May 6.18 5.33 10.54 14.17 7.15 5.72 8.48 ## 61 2020 April 6.03 6.01 10.92 14.05 7.36 5.39 7.29 ## 62 2020 March 5.84 5.84 10.96 13.90 7.76 5.05 7.01 ## 63 2020 February 5.72 7.17 11.17 14.28 8.29 4.75 6.84 ## 64 2020 January 5.29 5.78 11.32 14.19 6.67 4.50 6.82 ## 65 2019 December 5.20 5.82 11.28 14.29 6.03 4.44 7.23 ## 66 2019 November 5.19 5.56 11.43 14.65 4.91 4.56 6.33 ## 67 2019 October 5.19 4.95 11.46 14.54 4.05 4.96 5.98 ## 68 2019 September 5.24 3.83 11.49 14.47 4.14 5.61 5.86 ## 69 2019 August 5.40 5.00 11.77 14.33 4.11 6.33 5.00 ## 70 2019 July 5.32 6.27 12.18 14.24 4.45 7.24 4.66 ## 71 2019 June 5.16 5.70 12.47 14.95 3.67 8.20 4.43 ## 72 2019 May 5.04 4.49 12.79 13.89 3.20 9.38 4.45 ## 73 2019 April 4.91 6.58 12.73 14.11 3.25 10.67 4.06 ## 74 2019 April 4.91 6.58 13.07 14.06 4.14 12.04 3.77 ## 75 2019 March 4.67 4.35 13.31 14.53 5.32 13.29 4.22 ## 76 2019 February 4.65 4.14 13.32 15.21 6.09 14.33 3.52 ## 77 2019 January 4.68 4.70 13.67 15.88 7.74 15.27 3.85 ## 78 2018 December 4.69 5.71 13.79 16.02 10.05 15.97 4.07 ## 79 2018 November 4.59 5.58 13.96 15.94 12.22 16.40 3.88 ## 80 2018 October 4.53 5.53 14.01 15.88 13.06 16.50 4.19 ## 81 2018 September 4.53 5.70 14.38 15.89 15.61 16.45 3.88 ## 82 2018 August 4.63 4.04 14.40 18.37 16.69 15.93 3.50 ## 83 2018 July 4.95 4.35 14.48 17.85 18.31 15.10 3.53 ## 84 2018 June 5.20 4.28 14.56 16.87 18.93 14.02 3.47 ## 85 2018 May 5.61 3.95 14.83 16.67 19.72 12.82 3.31 ## 86 2018 April 6.24 3.73 14.97 16.35 18.91 11.49 3.10 ## 87 2018 March 6.89 4.18 16.27 15.96 17.32 10.18 3.01 ## 88 2018 February 7.40 4.46 16.40 15.39 16.67 9.00 2.82 ## 89 2018 January 7.79 4.83 16.94 14.67 15.53 7.88 2.59 ## 90 2017 December 7.98 4.50 18.68 12.99 14.48 6.88 2.36 ## 91 2017 November 8.15 4.73 18.46 11.25 12.95 5.96 2.21 ## 92 2017 October 8.33 5.72 18.54 9.66 12.05 5.20 1.78 ## 93 2017 September 8.40 7.06 18.85 8.93 9.19 4.49 1.65 ## 94 2017 August 8.36 8.04 18.62 8.18 6.54 4.05 1.71 ## 95 2017 July 8.21 7.47 18.92 7.55 5.42 3.93 1.38 ## 96 2017 June 8.13 9.21 19.46 7.83 4.51 3.96 1.25 ## 97 2017 May 7.84 11.70 19.59 7.65 3.84 4.02 1.16 ## 98 2017 April 7.20 11.48 21.16 7.79 3.18 4.12 0.86 ## 99 2017 March 6.76 10.28 21.83 8.44 3.21 4.40 0.75 ## 100 2017 February 6.43 9.04 23.31 9.10 3.22 4.69 0.93 ## 101 2017 January 6.26 6.99 24.16 9.48 3.57 5.03 1.26 ## 102 2016 December 6.30 6.35 25.99 9.74 3.49 5.43 1.26 ## 103 2016 November 6.43 6.68 26.47 10.38 3.88 5.85 1.18 ## 104 2016 October 6.48 6.47 27.38 9.17 3.66 6.32 1.46 ## 105 2016 September 6.50 6.34 29.02 8.01 3.97 7.03 1.24 ## 106 2016 August 6.47 6.26 29.32 7.61 5.18 7.88 1.11 ## 107 2016 July 6.44 6.40 29.63 7.21 5.95 8.64 1.00 ## 108 2016 June 6.46 5.80 30.11 7.01 5.32 9.24 1.15 ## 109 2016 May 6.59 5.00 31.64 6.67 5.00 10.24 0.96 ## 110 2016 April 6.72 5.27 32.65 6.26 6.62 11.42 0.88 ## 111 2016 March 6.88 6.45 33.54 6.22 6.74 12.41 0.73 ## 112 2016 February 6.87 6.84 34.44 6.22 7.36 13.42 0.96 ## 113 2016 January 6.77 7.78 34.09 6.20 8.44 14.35 0.76 ## 114 2015 December 6.58 8.01 33.46 6.22 8.60 15.11 0.52 ## 115 2015 November 6.42 7.32 33.70 6.54 9.61 15.93 0.43 ## 116 2015 October 6.31 6.72 33.26 6.55 12.42 16.72 0.43 ## 117 2015 September 6.29 5.97 32.75 6.92 14.60 17.07 0.32 ## 118 2015 August 6.34 5.84 32.92 6.58 14.69 16.87 0.64 ## 119 2015 July 6.54 6.62 32.12 6.44 13.22 16.56 0.88 d1 = data$PENSION;d1 ## [1] 13.50 13.59 13.49 13.47 13.70 13.73 13.71 13.83 13.85 13.76 13.66 13.65 ## [13] 13.61 13.61 13.81 14.23 14.29 14.39 14.24 14.25 14.45 15.32 15.49 17.28 ## [25] 18.47 22.51 23.03 23.04 23.43 22.36 23.27 20.84 19.98 18.61 17.76 17.42 ## [37] 16.69 16.67 16.76 15.11 14.05 13.05 12.20 12.08 11.30 10.83 9.81 10.13 ## [49] 10.32 11.90 11.80 11.97 12.46 12.77 13.33 13.62 13.89 14.23 14.19 14.17 ## [61] 14.05 13.90 14.28 14.19 14.29 14.65 14.54 14.47 14.33 14.24 14.95 13.89 ## [73] 14.11 14.06 14.53 15.21 15.88 16.02 15.94 15.88 15.89 18.37 17.85 16.87 ## [85] 16.67 16.35 15.96 15.39 14.67 12.99 11.25 9.66 8.93 8.18 7.55 7.83 ## [97] 7.65 7.79 8.44 9.10 9.48 9.74 10.38 9.17 8.01 7.61 7.21 7.01 ## [109] 6.67 6.26 6.22 6.22 6.20 6.22 6.54 6.55 6.92 6.58 6.44 d2 = diff(d1); d2 ## [1] 0.09 -0.10 -0.02 0.23 0.03 -0.02 0.12 0.02 -0.09 -0.10 -0.01 -0.04 ## [13] 0.00 0.20 0.42 0.06 0.10 -0.15 0.01 0.20 0.87 0.17 1.79 1.19 ## [25] 4.04 0.52 0.01 0.39 -1.07 0.91 -2.43 -0.86 -1.37 -0.85 -0.34 -0.73 ## [37] -0.02 0.09 -1.65 -1.06 -1.00 -0.85 -0.12 -0.78 -0.47 -1.02 0.32 0.19 ## [49] 1.58 -0.10 0.17 0.49 0.31 0.56 0.29 0.27 0.34 -0.04 -0.02 -0.12 ## [61] -0.15 0.38 -0.09 0.10 0.36 -0.11 -0.07 -0.14 -0.09 0.71 -1.06 0.22 ## [73] -0.05 0.47 0.68 0.67 0.14 -0.08 -0.06 0.01 2.48 -0.52 -0.98 -0.20 ## [85] -0.32 -0.39 -0.57 -0.72 -1.68 -1.74 -1.59 -0.73 -0.75 -0.63 0.28 -0.18 ## [97] 0.14 0.65 0.66 0.38 0.26 0.64 -1.21 -1.16 -0.40 -0.40 -0.20 -0.34 ## [109] -0.41 -0.04 0.00 -0.02 0.02 0.32 0.01 0.37 -0.34 -0.14 #maximum likelihood estimator d2_positive = d2[d2 > 0] fitln = fitdist(data = d2_positive, distr = “lnorm”, method = c(“mle”)) summary(fitln) ## Fitting of the distribution ’ lnorm ’ by maximum likelihood ## Parameters : ## estimate Std. Error ## meanlog -1.447937 0.1898052 ## sdlog 1.381802 0.1342122 ## Loglikelihood: -15.60268 AIC: 35.20536 BIC: 39.14594 ## Correlation matrix: ## meanlog sdlog ## meanlog 1.000000e+00 -4.684208e-11 ## sdlog -4.684208e-11 1.000000e+00 plot(fitln)

d2_positive = d2[d2 > 0] fitg = fitdist(data = d2_positive, distr = “gamma”, method = c(“mle”)) summary(fitg) ## Fitting of the distribution ’ gamma ’ by maximum likelihood ## Parameters : ## estimate Std. Error ## shape 0.8084506 0.1356321 ## rate 1.6523797 0.3749279 ## Loglikelihood: -14.25895 AIC: 32.51789 BIC: 36.45847 ## Correlation matrix: ## shape rate ## shape 1.0000000 0.7393854 ## rate 0.7393854 1.0000000 plot(fitg)

moment matching estimation

fitln_mme = fitdist(data = d2_positive, distr = “lnorm”, method = c(“mme”)) summary(fitln_mme) ## Fitting of the distribution ’ lnorm ’ by matching moments ## Parameters : ## estimate Std. Error ## meanlog -1.248413 0.4414005 ## sdlog 1.032978 0.4616989 ## Loglikelihood: -22.09074 AIC: 48.18148 BIC: 52.12206 ## Correlation matrix: ## meanlog sdlog ## meanlog 1.0000000 -0.9175477 ## sdlog -0.9175477 1.0000000 plot(fitln_mme)

d2_positive = d2[d2 > 0] fitg_mme = fitdist(data = d2_positive, distr = “gamma”, method = c(“mme”)) summary(fitg_mme) ## Fitting of the distribution ’ gamma ’ by matching moments ## Parameters : ## estimate Std. Error ## shape 0.5244463 0.1736935 ## rate 1.0719496 0.4091231 ## Loglikelihood: -17.2375 AIC: 38.47499 BIC: 42.41558 ## Correlation matrix: ## shape rate ## shape 1.0000000 0.8677666 ## rate 0.8677666 1.0000000 plot(fitg_mme) Question Two

library(fitdistrplus) library(goftest) library(fGarch)

data = read.csv(“DATA25.csv”);data ## Year Month STOCK GDP CPI PENSION INFLATION CLAIMS INTEREST ## 1 2025 April 3.74 4.11 6.12 13.50 5.58 4.59 4.12 ## 2 2025 March 3.81 3.62 6.33 13.59 5.53 4.53 3.97 ## 3 2025 February 3.98 3.45 6.47 13.49 5.70 4.53 4.07 ## 4 2025 January 4.21 3.28 6.48 13.47 4.04 4.63 4.20 ## 5 2024 December 4.50 2.99 6.51 13.70 4.35 4.95 4.44 ## 6 2024 November 4.81 2.75 6.56 13.73 4.28 5.20 4.62 ## 7 2024 October 5.14 2.72 6.57 13.71 3.95 5.61 4.45 ## 8 2024 September 5.50 3.56 6.64 13.83 3.73 6.24 4.38 ## 9 2024 August 5.77 4.36 6.66 13.85 4.18 6.89 4.42 ## 10 2024 July 5.97 4.31 6.68 13.76 4.46 7.40 4.40 ## 11 2024 June 4.64 6.22 6.68 13.66 4.83 7.79 4.37 ## 12 2024 May 6.49 5.10 6.81 13.65 4.50 7.98 4.50 ## 13 2024 April 6.73 5.00 7.06 13.61 4.73 8.15 4.21 ## 14 2024 March 6.97 5.70 7.16 13.61 5.72 8.33 4.22 ## 15 2024 February 7.26 6.31 7.19 13.81 7.06 8.40 4.30 ## 16 2024 January 7.50 6.85 7.19 14.23 8.04 8.36 4.59 ## 17 2023 December 7.67 6.63 7.20 14.29 7.47 8.21 4.73 ## 18 2023 November 7.87 6.80 7.25 14.39 9.21 8.13 4.96 ## 19 2023 October 8.10 6.92 7.23 14.24 11.70 7.84 4.78 ## 20 2023 September 8.32 6.78 7.25 14.25 11.48 7.20 4.56 ## 21 2023 August 8.52 6.73 7.27 14.45 10.28 6.76 4.56 ## 22 2023 July 8.68 7.28 7.33 15.32 9.04 6.43 4.55 ## 23 2023 June 8.77 7.88 7.36 15.49 6.99 6.26 4.57 ## 24 2023 May 8.78 8.03 7.46 17.28 6.35 6.30 4.57 ## 25 2023 April 8.71 7.90 7.62 18.47 6.68 6.43 5.70 ## 26 2023 March 8.59 9.19 7.72 22.51 6.47 6.48 5.75 ## 27 2023 February 8.30 9.23 7.75 23.03 6.34 6.50 5.52 ## 28 2023 January 7.95 8.98 7.77 23.04 6.26 6.47 5.27 ## 29 2022 December 7.66 9.06 7.78 23.43 6.40 6.44 5.53 ## 30 2022 November 7.38 9.48 7.86 22.36 5.80 6.46 5.79 ## 31 2022 October 7.48 9.59 7.87 23.27 5.00 6.59 5.04 ## 32 2022 September 6.81 9.18 7.88 20.84 5.27 6.72 4.87 ## 33 2022 August 6.61 8.53 7.95 19.98 6.45 6.88 4.71 ## 34 2022 July 6.45 8.32 8.02 18.61 6.84 6.87 4.76 ## 35 2022 June 6.29 7.91 8.06 17.76 7.78 6.77 4.91 ## 36 2022 May 6.16 7.08 8.21 17.42 8.01 6.58 4.94 ## 37 2022 April 6.05 6.47 8.41 16.69 7.32 6.42 4.83 ## 38 2022 March 6.29 5.56 8.43 16.67 6.72 6.31 4.59 ## 39 2022 February 6.23 5.08 8.60 16.76 5.97 6.29 4.53 ## 40 2022 January 6.08 5.39 8.66 15.11 5.84 6.34 5.20 ## 41 2021 December 5.62 5.73 8.69 14.05 6.62 6.54 4.74 ## 42 2021 November 6.10 5.80 8.83 13.05 7.03 6.63 5.50 ## 43 2021 October 6.07 6.45 8.84 12.20 6.87 6.65 5.04 ## 44 2021 September 5.35 6.91 8.96 12.08 7.08 6.69 5.68 ## 45 2021 August 5.71 6.57 9.13 11.30 6.31 6.63 6.57 ## 46 2021 July 5.53 6.55 9.16 10.83 5.61 6.63 6.92 ## 47 2021 June 5.35 6.32 9.19 9.81 5.53 6.74 9.25 ## 48 2021 May 5.20 5.87 9.28 10.13 6.02 6.88 9.06 ## 49 2021 April 4.66 5.76 9.57 10.32 6.09 6.97 9.15 ## 50 2021 March 5.17 5.90 9.60 11.90 6.43 7.08 9.29 ## 51 2021 February 5.16 5.78 9.76 11.80 6.60 7.19 10.22 ## 52 2021 January 5.74 5.69 9.85 11.97 8.36 7.33 10.47 ## 53 2020 December 5.41 5.62 9.92 12.46 7.67 7.19 11.03 ## 54 2020 November 5.53 5.33 10.06 12.77 7.39 7.05 11.70 ## 55 2020 October 5.67 4.84 10.16 13.33 7.30 6.85 10.85 ## 56 2020 September 5.79 4.20 10.11 13.62 6.41 6.58 8.63 ## 57 2020 August 5.87 4.36 10.23 13.89 6.27 6.39 7.64 ## 58 2020 July 6.01 4.36 10.28 14.23 6.86 6.21 8.15 ## 59 2020 June 6.16 4.59 10.34 14.19 7.21 6.01 9.32 ## 60 2020 May 6.18 5.33 10.54 14.17 7.15 5.72 8.48 ## 61 2020 April 6.03 6.01 10.92 14.05 7.36 5.39 7.29 ## 62 2020 March 5.84 5.84 10.96 13.90 7.76 5.05 7.01 ## 63 2020 February 5.72 7.17 11.17 14.28 8.29 4.75 6.84 ## 64 2020 January 5.29 5.78 11.32 14.19 6.67 4.50 6.82 ## 65 2019 December 5.20 5.82 11.28 14.29 6.03 4.44 7.23 ## 66 2019 November 5.19 5.56 11.43 14.65 4.91 4.56 6.33 ## 67 2019 October 5.19 4.95 11.46 14.54 4.05 4.96 5.98 ## 68 2019 September 5.24 3.83 11.49 14.47 4.14 5.61 5.86 ## 69 2019 August 5.40 5.00 11.77 14.33 4.11 6.33 5.00 ## 70 2019 July 5.32 6.27 12.18 14.24 4.45 7.24 4.66 ## 71 2019 June 5.16 5.70 12.47 14.95 3.67 8.20 4.43 ## 72 2019 May 5.04 4.49 12.79 13.89 3.20 9.38 4.45 ## 73 2019 April 4.91 6.58 12.73 14.11 3.25 10.67 4.06 ## 74 2019 April 4.91 6.58 13.07 14.06 4.14 12.04 3.77 ## 75 2019 March 4.67 4.35 13.31 14.53 5.32 13.29 4.22 ## 76 2019 February 4.65 4.14 13.32 15.21 6.09 14.33 3.52 ## 77 2019 January 4.68 4.70 13.67 15.88 7.74 15.27 3.85 ## 78 2018 December 4.69 5.71 13.79 16.02 10.05 15.97 4.07 ## 79 2018 November 4.59 5.58 13.96 15.94 12.22 16.40 3.88 ## 80 2018 October 4.53 5.53 14.01 15.88 13.06 16.50 4.19 ## 81 2018 September 4.53 5.70 14.38 15.89 15.61 16.45 3.88 ## 82 2018 August 4.63 4.04 14.40 18.37 16.69 15.93 3.50 ## 83 2018 July 4.95 4.35 14.48 17.85 18.31 15.10 3.53 ## 84 2018 June 5.20 4.28 14.56 16.87 18.93 14.02 3.47 ## 85 2018 May 5.61 3.95 14.83 16.67 19.72 12.82 3.31 ## 86 2018 April 6.24 3.73 14.97 16.35 18.91 11.49 3.10 ## 87 2018 March 6.89 4.18 16.27 15.96 17.32 10.18 3.01 ## 88 2018 February 7.40 4.46 16.40 15.39 16.67 9.00 2.82 ## 89 2018 January 7.79 4.83 16.94 14.67 15.53 7.88 2.59 ## 90 2017 December 7.98 4.50 18.68 12.99 14.48 6.88 2.36 ## 91 2017 November 8.15 4.73 18.46 11.25 12.95 5.96 2.21 ## 92 2017 October 8.33 5.72 18.54 9.66 12.05 5.20 1.78 ## 93 2017 September 8.40 7.06 18.85 8.93 9.19 4.49 1.65 ## 94 2017 August 8.36 8.04 18.62 8.18 6.54 4.05 1.71 ## 95 2017 July 8.21 7.47 18.92 7.55 5.42 3.93 1.38 ## 96 2017 June 8.13 9.21 19.46 7.83 4.51 3.96 1.25 ## 97 2017 May 7.84 11.70 19.59 7.65 3.84 4.02 1.16 ## 98 2017 April 7.20 11.48 21.16 7.79 3.18 4.12 0.86 ## 99 2017 March 6.76 10.28 21.83 8.44 3.21 4.40 0.75 ## 100 2017 February 6.43 9.04 23.31 9.10 3.22 4.69 0.93 ## 101 2017 January 6.26 6.99 24.16 9.48 3.57 5.03 1.26 ## 102 2016 December 6.30 6.35 25.99 9.74 3.49 5.43 1.26 ## 103 2016 November 6.43 6.68 26.47 10.38 3.88 5.85 1.18 ## 104 2016 October 6.48 6.47 27.38 9.17 3.66 6.32 1.46 ## 105 2016 September 6.50 6.34 29.02 8.01 3.97 7.03 1.24 ## 106 2016 August 6.47 6.26 29.32 7.61 5.18 7.88 1.11 ## 107 2016 July 6.44 6.40 29.63 7.21 5.95 8.64 1.00 ## 108 2016 June 6.46 5.80 30.11 7.01 5.32 9.24 1.15 ## 109 2016 May 6.59 5.00 31.64 6.67 5.00 10.24 0.96 ## 110 2016 April 6.72 5.27 32.65 6.26 6.62 11.42 0.88 ## 111 2016 March 6.88 6.45 33.54 6.22 6.74 12.41 0.73 ## 112 2016 February 6.87 6.84 34.44 6.22 7.36 13.42 0.96 ## 113 2016 January 6.77 7.78 34.09 6.20 8.44 14.35 0.76 ## 114 2015 December 6.58 8.01 33.46 6.22 8.60 15.11 0.52 ## 115 2015 November 6.42 7.32 33.70 6.54 9.61 15.93 0.43 ## 116 2015 October 6.31 6.72 33.26 6.55 12.42 16.72 0.43 ## 117 2015 September 6.29 5.97 32.75 6.92 14.60 17.07 0.32 ## 118 2015 August 6.34 5.84 32.92 6.58 14.69 16.87 0.64 ## 119 2015 July 6.54 6.62 32.12 6.44 13.22 16.56 0.88 cpi= data$CPI;cpi ## [1] 6.12 6.33 6.47 6.48 6.51 6.56 6.57 6.64 6.66 6.68 6.68 6.81 ## [13] 7.06 7.16 7.19 7.19 7.20 7.25 7.23 7.25 7.27 7.33 7.36 7.46 ## [25] 7.62 7.72 7.75 7.77 7.78 7.86 7.87 7.88 7.95 8.02 8.06 8.21 ## [37] 8.41 8.43 8.60 8.66 8.69 8.83 8.84 8.96 9.13 9.16 9.19 9.28 ## [49] 9.57 9.60 9.76 9.85 9.92 10.06 10.16 10.11 10.23 10.28 10.34 10.54 ## [61] 10.92 10.96 11.17 11.32 11.28 11.43 11.46 11.49 11.77 12.18 12.47 12.79 ## [73] 12.73 13.07 13.31 13.32 13.67 13.79 13.96 14.01 14.38 14.40 14.48 14.56 ## [85] 14.83 14.97 16.27 16.40 16.94 18.68 18.46 18.54 18.85 18.62 18.92 19.46 ## [97] 19.59 21.16 21.83 23.31 24.16 25.99 26.47 27.38 29.02 29.32 29.63 30.11 ## [109] 31.64 32.65 33.54 34.44 34.09 33.46 33.70 33.26 32.75 32.92 32.12 d1 = diff(cpi); d1 ## [1] 0.21 0.14 0.01 0.03 0.05 0.01 0.07 0.02 0.02 0.00 0.13 0.25 ## [13] 0.10 0.03 0.00 0.01 0.05 -0.02 0.02 0.02 0.06 0.03 0.10 0.16 ## [25] 0.10 0.03 0.02 0.01 0.08 0.01 0.01 0.07 0.07 0.04 0.15 0.20 ## [37] 0.02 0.17 0.06 0.03 0.14 0.01 0.12 0.17 0.03 0.03 0.09 0.29 ## [49] 0.03 0.16 0.09 0.07 0.14 0.10 -0.05 0.12 0.05 0.06 0.20 0.38 ## [61] 0.04 0.21 0.15 -0.04 0.15 0.03 0.03 0.28 0.41 0.29 0.32 -0.06 ## [73] 0.34 0.24 0.01 0.35 0.12 0.17 0.05 0.37 0.02 0.08 0.08 0.27 ## [85] 0.14 1.30 0.13 0.54 1.74 -0.22 0.08 0.31 -0.23 0.30 0.54 0.13 ## [97] 1.57 0.67 1.48 0.85 1.83 0.48 0.91 1.64 0.30 0.31 0.48 1.53 ## [109] 1.01 0.89 0.90 -0.35 -0.63 0.24 -0.44 -0.51 0.17 -0.80 # fit the distributions d1_positive = d1[d1 > 0] fitlnMGEKS = fitdist(data = d1_positive, distr = “weibull”, method = “mge”, gof = “KS”) summary(fitlnMGEKS) ## Fitting of the distribution ’ weibull ’ by maximum goodness-of-fit ## Parameters : ## estimate ## shape 0.8401815 ## scale 0.2120730 ## Loglikelihood: 34.87007 AIC: -65.74015 BIC: -60.43222 fitlnMGECvM = fitdist(data = d1_positive, distr = “weibull”, method = “mge”, gof = “CvM”) summary(fitlnMGECvM) ## Fitting of the distribution ’ weibull ’ by maximum goodness-of-fit ## Parameters : ## estimate ## shape 0.8263981 ## scale 0.1991286 ## Loglikelihood: 34.45488 AIC: -64.90977 BIC: -59.60185 fitlnMGEAD = fitdist(data = d1_positive, distr = “weibull”, method = “mge”, gof = “AD”) summary(fitlnMGEAD) ## Fitting of the distribution ’ weibull ’ by maximum goodness-of-fit ## Parameters : ## estimate ## shape 0.7634249 ## scale 0.2174130 ## Loglikelihood: 36.49133 AIC: -68.98267 BIC: -63.67475