fGarch/0000755000176200001440000000000013203412756011447 5ustar liggesusersfGarch/inst/0000755000176200001440000000000013202277107012422 5ustar liggesusersfGarch/inst/THANKS0000644000176200001440000000035513202277107013340 0ustar liggesusersThe Rmetrics core team would like to thank the following people for ideas, testing and feedback regarding fGarch: Michal Miklovic Kris Kris Spencer Graves fGarch/inst/unitTests/0000755000176200001440000000000013202277107014424 5ustar liggesusersfGarch/inst/unitTests/Makefile0000644000176200001440000000041713203345302016060 0ustar liggesusersPKG=fGarch TOP=../.. SUITE=doRUnit.R R=R all: inst test inst: # Install package -- but where ?? -- will that be in R_LIBS ? cd ${TOP}/..;\ ${R} CMD INSTALL ${PKG} test: # Run unit tests export RCMDCHECK=FALSE;\ cd ${TOP}/tests;\ ${R} --vanilla --slave < ${SUITE} fGarch/inst/unitTests/runit.garch-methods.R0000644000176200001440000000524513202277107020442 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ # METHODS: DESCRIPTION: # show.fGARCH S4 print method for an object of class 'fGARCH' # summary.fGARCH S3 summary method for an object of class 'fGARCH' # plot.fGARCH S3 plot method for an object of class 'fGARCH' # residuals.fGARCH S3 residuals method for an object of class 'fGARCH' # fitted.fGARCH S3 fitted values for an object of class 'fGARCH' # predict.fGARCH S3 prediction method for an object of class 'fGARCH' # STATISTICS: Description: # .truePersistence Compute persistence ################################################################################ test.garch.methods.show <- function() { # show.fGARCH - S4 print method for an object of class 'fGARCH' # Garch(1,1) Default Model: x = garchSim(n = 250) # Fit: fit = garchFit( ~ garch(1,1), data = x, trace = FALSE) # Note: # Does also work: # fit = garchFit(dem2gbp ~garch(1,1), data = dem2gbp, trace = FALSE) # Note: # fit = garchFit(DEM2GBP ~garch(1,1), data = dem2gbp, trace = FALSE) # [1] "DEM2GBP" # [1] "dem2gbp" # Error in .garchArgsParser(formula = formula, data = data, trace = FALSE) : # Formula and data units do not match. # Print: print(fit) show(fit) # Summary: summary(fit) # Return Value: return() } ################################################################################ fGarch/inst/unitTests/runit.garchSim.R0000644000176200001440000001224613202277107017451 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ # FUNCTION: SIMULATION: # garchSim Simulates a GARCH/APARCH process ################################################################################ test.garchSim.arch = function() { # Simulation of ARCH Models: # ARCH(1) - default omega and alpha spec = garchSpec(model = list()) garchSim(n = 10, spec = spec) # ARCH(1) - default omega spec = garchSpec(model = list(alpha = 0.1)) garchSim(n = 10, spec = spec) # ARCH(1) spec = garchSpec(model = list(omega = 1e-6, alpha = 0.1)) garchSim(n = 10, spec = spec) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchSim.arma.arch = function() { # Simulation of ARMA-ARCH Models: # AR(1)-ARCH(1) spec = garchSpec(model = list(ar = 0.5)) garchSim(n = 10, spec = spec) # AR([1,5])-ARCH(1) spec = garchSpec(model = list(ar = c(0.5, 0, 0, 0 ,0.1))) garchSim(n = 10, spec = spec) # ARMA(1,2)-ARCH(1) spec = garchSpec(model = list(ar = 0.5, ma = c(0.3,-0.3))) garchSim(n = 10, spec = spec) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchSim.dist.arch = function() { # Simulation of non-normal ARCH Models: # rsnorn-ARCH(2) spec = garchSpec(model = list(alpha = c(0.12, 0.04), dist = 2/3), cond.dist = "snorm") garchSim(n = 10, spec = spec) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchSim.garch = function() { # Simulation of GARCH Models: # GARCH(1,1) spec = garchSpec() garchSim(n = 10, spec = spec) # GARCH(1,1) spec = garchSpec(model = list(alpha = 0.1, beta = 0.8)) garchSim(n = 10, spec = spec) # GARCH(1,1) spec = garchSpec(model = list(omega = 1e-6, alpha = 0.1, beta = 0.8)) garchSim(n = 10, spec = spec) # GARCH(1,2) spec = garchSpec(model = list(alpha = 0.1, beta = c(0.4, 0.4))) garchSim(n = 10, spec = spec) # GARCH(2,1) spec = garchSpec(model = list(alpha = c(0.12, 0.04), beta = 0.08)) garchSim(n = 10, spec = spec) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchSim.dist.garch = function() { # Simulation of non-normal GARCH Models: # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Normal - GARCH(1,1) spec = garchSpec(model = list(), cond.dist = "norm") garchSim(n = 10, spec = spec) # Skewed Normal - GARCH(1,1) spec = garchSpec(model = list(parm = 2), cond.dist = "snorm") garchSim(n = 10, spec = spec) # GED - GARCH(1,1) spec = garchSpec(model = list(parm = 4), cond.dist = "ged") garchSim(n = 10, spec = spec) # Skewed GED - GARCH(1,1) spec = garchSpec(model = list(parm = c(4, 2)), cond.dist = "sged") garchSim(n = 10, spec = spec) # Normalized Student t - GARCH(1,1) spec = garchSpec(model = list(parm = 4), cond.dist = "std") garchSim(n = 10, spec = spec) # Skewed Normalized Student t - GARCH(1,1) spec = garchSpec(model = list(parm = c(4, 2)), cond.dist = "sstd") garchSim(n = 10, spec = spec) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchSim.aparch = function() { # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Taylor Schwert Normal GARCH(1,1) spec = garchSpec(list(alpha = 0.1, delta = 1)) garchSim(n = 10, spec = spec) # Return Value: return() } ################################################################################ fGarch/inst/unitTests/runit.garchSolver.R0000644000176200001440000002402013202277107020164 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ # FUNCTION: SOLVER: # .garchRnlminb R coded solver nlmin # .garchRlbgfsb R coded solver optim using method lbgfsb # .garchRnm R coded solver nm as hybrid addon # .garchFsqp Fortran coded solver sqp # .garchRdonlp2 R coded solver donlp2 # .garchFmnfb Fortran coded solver mnfb ################################################################################ ## test.garchSolver.dem2gbp <- ## function() ## { ## # Note, Default has changed: "cda" -> "fda" ## # Loda Data ## data(dem2gbp) ## garchFit(~ garch(1,1), dem2gbp, hessian = "fda", algorithm = "nlminb") ## # Time difference of 2.969 secs ## # Error Analysis: ## # Estimate Std. Error t value Pr(>|t|) ## # mu -0.006190 0.008464 -0.731 0.464545 ## # omega 0.010761 0.003081 3.492 0.000479 *** ## # alpha1 0.153134 0.027720 5.524 3.31e-08 *** ## # beta1 0.805974 0.035761 22.537 < 2e-16 *** ## # --- ## # Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 ## # ## # Log Likelihood: ## # 1106.608 normalized: 0.5605916 ## garchFit(~ garch(1,1), dem2gbp, hessian = "cda", algorithm = "nlminb") ## garchFit(~ garch(1,1), dem2gbp, algorithm = "lbfgsb") ## # Time difference of 4.75 secs ## # Error Analysis: ## # Estimate Std. Error t value Pr(>|t|) ## # mu -0.006187 0.008462 -0.731 0.464720 ## # omega 0.010785 0.002860 3.771 0.000163 *** ## # alpha1 0.153306 0.026556 5.773 7.79e-09 *** ## # beta1 0.805706 0.033612 23.971 < 2e-16 *** ## # --- ## # Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 ## # ## # Log Likelihood: ## # 1106.608 normalized: 0.5605916 ## garchFit(~ garch(1,1), dem2gbp, hessian = "cda", algorithm = "nlminb+nm") ## # Time difference of 6.094 secs ## # Error Analysis: ## # Estimate Std. Error t value Pr(>|t|) ## # mu -0.006190 0.008462 -0.732 0.464447 ## # omega 0.010761 0.002853 3.772 0.000162 *** ## # alpha1 0.153134 0.026523 5.774 7.76e-09 *** ## # beta1 0.805974 0.033553 24.021 < 2e-16 *** ## # --- ## # Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 ## # ## # Log Likelihood: ## # 1106.608 normalized: 0.5605916 ## # ## garchFit(~ garch(1,1), dem2gbp, hessian = "cda", algorithm = "lbfgsb+nm") ## garchFit(~ garch(1,1), dem2gbp, hessian = "cda", algorithm = "donlp2") ## # Time difference of 7.094 secs ## # Error Analysis: ## # Estimate Std. Error t value Pr(>|t|) ## # mu -0.006190 0.008462 -0.732 0.464447 ## # omega 0.010761 0.002853 3.772 0.000162 *** ## # alpha1 0.153134 0.026523 5.774 7.76e-09 *** ## # beta1 0.805973 0.033553 24.021 < 2e-16 *** ## # --- ## # Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 ## # ## # Log Likelihood: ## # 1106.608 normalized: 0.5605916 ## # ## garchFit(~ garch(1,1), dem2gbp, hessian = "cda", algorithm = "sqp") ## # Time difference of 1.906 secs ## # Error Analysis: ## # Estimate Std. Error t value Pr(>|t|) ## # mu -0.006190 0.008462 -0.732 0.464437 ## # omega 0.010761 0.002853 3.772 0.000162 *** ## # alpha1 0.153134 0.026523 5.774 7.76e-09 *** ## # beta1 0.805974 0.033553 24.021 < 2e-16 *** ## # --- ## # Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 ## # ## # Log Likelihood: ## # 0.5605916 normalized: 0.0002839877 ## # ## garchFit(~ garch(1,1), dem2gbp, hessian = "cda", algorithm = "mnfb") ## # Time difference of 1.344 secs ## # Error Analysis: ## # Estimate Std. Error t value Pr(>|t|) ## # mu -0.006190 0.008461 -0.732 0.464384 ## # omega 0.010761 0.002853 3.772 0.000162 *** ## # alpha1 0.153134 0.026523 5.774 7.75e-09 *** ## # beta1 0.805974 0.033552 24.021 < 2e-16 *** ## # --- ## # Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 ## # ## # Log Likelihood: ## # 0.5605916 normalized: 0.0002839877 ## # Return Value: ## return() ## } # ------------------------------------------------------------------------------ test.garchSolver2.dem2gbp <- function() { # Note, Default has changed: "cda" -> "fda" # Loda Data data(dem2gbp) ## garchFit(~ garch(1,1), dem2gbp, hessian = "fcd", algorithm = "nlminb") garchFit(~ garch(1,1), dem2gbp, hessian = "rcd", algorithm = "nlminb") garchFit(~ garch(1,1), dem2gbp, algorithm = "lbfgsb") ## garchFit(~ garch(1,1), dem2gbp, hessian = "fcd", algorithm = "nlminb+nm") garchFit(~ garch(1,1), dem2gbp, hessian = "rcd", algorithm = "lbfgsb+nm") # garchFit(~ garch(1,1), dem2gbp, hessian = "fcd", algorithm = "donlp2") # garchFit(~ garch(1,1), dem2gbp, hessian = "rcd", algorithm = "sqp") ## garchFit(~ garch(1,1), dem2gbp, hessian = "fcd", algorithm = "mnfb") # Return Value: return() } # ------------------------------------------------------------------------------ ## test.garchSolver.sp500dge <- ## function() ## { ## # Loda Data: ## data(sp500dge) ## sp500dge = 100 * sp500dge ## garchFit(~ arma(0,1) + aparch(1,1), sp500dge, hessian = "cda", ## algorithm = "lbfgsb") # garchFit(~ arma(0,1) + aparch(1,1), sp500dge, hessian = "cda", # algorithm = "sqp") ## # Time difference of 48.954 secs ## # Error Analysis: ## # Estimate Std. Error t value Pr(>|t|) ## # mu 0.020646 0.006350 3.251 0.00115 ** ## # ma1 0.144745 0.008358 17.319 < 2e-16 *** ## # omega 0.009988 0.001085 9.201 < 2e-16 *** ## # alpha1 0.083803 0.004471 18.742 < 2e-16 *** ## # gamma1 0.373092 0.027997 13.326 < 2e-16 *** ## # beta1 0.919401 0.004093 224.614 < 2e-16 *** ## # delta 1.435124 0.067203 21.355 < 2e-16 *** ## # --- ## # Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 ## # ## # Log Likelihood: ## # 1.264345 normalized: 7.413338e-05 ## # # garchFit(~ arma(0,1) + aparch(1,1), sp500dge, hessian = "fda", # algorithm = "sqp") # garchFit(~ arma(0,1) + aparch(1,1), sp500dge, hessian = "cda", # algorithm = "mnfb") ## # Time difference of 35.156 secs ## # Error Analysis: ## # Estimate Std. Error t value Pr(>|t|) ## # mu 0.020646 0.006351 3.251 0.00115 ** ## # ma1 0.144745 0.008358 17.319 < 2e-16 *** ## # omega 0.009988 0.001086 9.201 < 2e-16 *** ## # alpha1 0.083803 0.004472 18.741 < 2e-16 *** ## # gamma1 0.373092 0.027997 13.326 < 2e-16 *** ## # beta1 0.919401 0.004093 224.606 < 2e-16 *** ## # delta 1.435124 0.067204 21.355 < 2e-16 *** ## # --- ## # Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 ## # ## # Log Likelihood: ## # 1.264345 normalized: 7.413338e-05 ## # # garchFit(~ arma(0,1) + aparch(1,1), sp500dge, hessian = "fda", # algorithm = "mnfb") ## # Time difference of 31.516 secs ## # Error Analysis: ## # Estimate Std. Error t value Pr(>|t|) ## # mu 0.020646 0.006342 3.255 0.00113 ** ## # ma1 0.144745 0.008363 17.307 < 2e-16 *** ## # omega 0.009988 0.001113 8.975 < 2e-16 *** ## # alpha1 0.083803 0.004534 18.485 < 2e-16 *** ## # gamma1 0.373092 0.027798 13.422 < 2e-16 *** ## # beta1 0.919401 0.004102 224.141 < 2e-16 *** ## # delta 1.435124 0.066283 21.652 < 2e-16 *** ## # --- ## # Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 ## # ## # Log Likelihood: ## # 1.264345 normalized: 7.413338e-05 ## # ## # Return Value: ## return() ## } # ------------------------------------------------------------------------------ test.garchSolver.sp500dge <- function() { # Loda Data: data(sp500dge) sp500dge = 100 * sp500dge # garchFit(~ arma(0,1) + aparch(1,1), sp500dge, hessian = "fcd", # algorithm = "lbfgsb") ### garchFit(~ arma(0,1) + aparch(1,1), sp500dge, hessian = "fcd", ### algorithm = "sqp") ### garchFit(~ arma(0,1) + aparch(1,1), sp500dge, hessian = "rcd", ### algorithm = "sqp") # garchFit(~ arma(0,1) + aparch(1,1), sp500dge, hessian = "fcd", # algorithm = "mnfb") # garchFit(~ arma(0,1) + aparch(1,1), sp500dge, hessian = "rcd", # algorithm = "mnfb") garchFit(~ arma(0,1) + aparch(1,1), sp500dge) # Return Value: return() } ################################################################################ fGarch/inst/unitTests/runit.garchSpec.R0000644000176200001440000000777213202277107017623 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ # FUNCTION: SPECIFICATION: # 'garchSpec' S4: garchSpec Class representation # garchSpec S4: Creates a 'garchSpec' object from scratch # show.garchSpec S4: Print method for an object of class 'garchSpec' ################################################################################ test.garchSpec = function() { # ARCH(1) - use default omega and default alpha[1] garchSpec(model = list()) # ARCH(1) - use default omega and specify alpha garchSpec(model = list(alpha = 0.2)) # ARCH(1) - specify omega and alpha garchSpec(model = list(omega = 3.0e-6, alpha = 0.3)) # AR(1)-ARCH(1) - use default omega/alpha and specify alpha[1] garchSpec(model = list(ar = 0.5)) # AR([1,5])-ARCH(1) - use default omega, specify alpha and subset ar[.] garchSpec(model = list(ar = c(0.5,0,0,0,0.1), alpha = 0.25)) # ARMA(1,2)-ARCH(1) - use default omega/alpha and specify ar[1]/ma[2] garchSpec(model = list(ar = 0.5, ma = c(0.3, -0.3))) # ARMA(2,2)-ARCH(1) use default omega/alpha and specify ar[2]/ma[2] garchSpec(model = list(ar = c(0.5, -0.5), ma = c(0.3,-0.3))) # ARCH(2) - use default omega and specify alpha[2] garchSpec(model = list(alpha = c(0.12, 0.04))) # GARCH(1,1) - use just defaults garchSpec() # GARCH(1,1) - use default omega and specify alpha/beta garchSpec(model = list(alpha = 0.2, beta = 0.7)) # GARCH(1,1) - specify omega/alpha/beta garchSpec(model = list(omega = 1e-6, alpha = 0.1, beta = 0.8)) # GARCH(1,2) - use default omega and specify alpha[1]/beta[2] garchSpec(model = list(alpha = 0.1, beta = c(0.4, 0.4))) # GARCH(2,1) - use default omega and specify alpha[2]/beta[1] garchSpec(model = list(alpha = c(0.12, 0.04), beta = 0.08)) # rsnorm-ARCH(1) - use defaults with skew Normal garchSpec(model = list(dist = 2), cond.dist = "snorm") # rged-ARCH(1) using default omega and alpha[1] garchSpec(model = list(dist = 4), cond.dist = "ged") # rsged-ARCH(1) using default omega and alpha[1] garchSpec(model = list(dist = c(4, 2)), cond.dist = "sged") # rstd-ARCH(1) using default omega and alpha[1] garchSpec(model = list(dist = 4), cond.dist = "std") # rsstd-ARCH(1) using default omega and alpha[1] garchSpec(model = list(dist = c(4, 2)), cond.dist = "sstd") # TS-GARCH(1,1) garchSpec(model = list(delta = 1)) # AR(1)-t-APARCH(2, 1) garchSpec(model = list(mu = 1.0e-4, ar = 0.5, omega = 1.0e-6, alpha = c(0.10, 0.05), gamma = c(0, 0), beta = 0.8, delta = 1.8, dist = c(nu = 4, xi = 0.5)), cond.dist = "sstd") # Return Value: return() } ################################################################################ fGarch/inst/unitTests/runit.predict-methods.R0000644000176200001440000000435213202277107021006 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ # FUNCTION: FORECASTING: # garchKappa Computes Expection for APARCH Models # .funE Internal function used by kappa() ################################################################################ test.predict.methods <- function() { # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") print(NA) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchKappa <- function() { # garchKappa( # cond.dist = c("norm", "ged", "std", "snorm", "sged", "sstd"), # gamma = 0, delta = 2, skew = NA, shape = NA) garchKappa() garchKappa("norm", gamma = 0.3) garchKappa("ged", skew = 0.95, shape = 1) # CHECK !!! garchKappa("dstd", skew = 0.95, shape = 1) # Return Value: return() } ################################################################################ fGarch/inst/unitTests/runit.snorm.R0000644000176200001440000000705213202277107017051 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ # FUNCTION: SKEW NORMAL DISTRIBUTION: # dsnorm Density for the skew normal Distribution # psnorm Probability function for the skew NORM # qsnorm Quantile function for the skew NORM # rsnorm Random Number Generator for the skew NORM # FUNCTION: PARAMETER ESTIMATION: # snormFit Fit the parameters for a skew Normal distribution # FUNCTION: SLIDER: # snormSlider Displays Normal Distribution and RVS ################################################################################ test.snormDist <- function() { # Normal Distribution: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Test: test = .distCheck("norm", mean = 0, sd = 1, robust = FALSE) print(test) checkTrue(sum(test) == 3) # Skew Normal Distribution: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Test: test = .distCheck("snorm", mean = 0, sd = 1, xi = 1.5, robust = FALSE) print(test) checkTrue(sum(test) == 3) # Return Value: return() } # ------------------------------------------------------------------------------ test.snormFit <- function() { # Parameter Estimation: # snormFit - Fit the parameters for a skew Normal distribution # Skew Normal Distribution: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Series: x = rsnorm(n = 1000, mean = 0, sd = 1, xi = 1.5) # Fit: fit = snormFit(x) print(fit) # Return Value: return() } # ------------------------------------------------------------------------------ test.snormSlider <- function() { # Try Distribution: # snormSlider(type = "dist") NA # Try Random Variates: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # snormSlider(type = "rand") NA # Return Value: return() } ################################################################################ fGarch/inst/unitTests/runit.garchFit.dist.R0000644000176200001440000001356313202277107020410 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ # FUNCTION: PARAMETER ESTIMATION: # 'fGARCH' S4: fGARCH Class representation # garchFit Fits GARCH and APARCH processes ################################################################################ test.garchFit.snorm <- function() { # Conditional Densities: # "norm", "snorm", "ged", "sged", "std", "sstd" # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # skewed normal GARCH(1, 1) model = list(omega = 1e-04, alpha = 0.1, beta = 0.8, skew = 0.9) spec = garchSpec(model, cond.dist = "snorm") x = garchSim(spec = spec, n = 250) # Fit: fit = garchFit( ~ garch(1,1), data = x, include.skew = TRUE, cond.dist = "snorm", trace = FALSE) print(coef(fit)) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchFit.snorm.fixed <- function() { # Conditional Densities: # "norm", "snorm", "ged", "sged", "std", "sstd" # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # skewed normal GARCH(1, 1) model = list(omega = 1e-04, alpha = 0.1, beta = 0.8, skew = 0.9) spec = garchSpec(model, cond.dist = "snorm") x = garchSim(spec = spec, n = 250) # Fit: Skewed Normal GARCH(1, 1) with fixed skew ... fit = garchFit(~garch(1,1), data = x, skew = 0.9, include.skew = FALSE, cond.dist = "snorm", trace = FALSE) print(coef(fit)) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchFit.ged <- function() { # Conditional Densities: # "norm", "snorm", "ged", "sged", "std", "sstd" # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # GED-GARCH(1, 1) model = list(omega = 1e-06, alpha = 0.1, beta = 0.8, shape = 2) spec = garchSpec(model, cond.dist = "ged") x = garchSim(spec = spec, n = 250) # Fit: fit = garchFit(~garch(1,1), data = x, include.shape = TRUE, cond.dist = "ged", trace = FALSE) print(coef(fit)) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchFit.sged <- function() { # Conditional Densities: # "norm", "snorm", "ged", "sged", "std", "sstd" # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Skewed GED-GARCH(1, 1) model = list(omega = 1e-05, alpha = 0.1, beta = 0.8, shape = 4, skew = 0.9) spec = garchSpec(model, cond.dist = "sged") x = garchSim(spec = spec, n = 250) # Fit fit = garchFit( ~ garch(1,1), data = x, include.shape = TRUE, include.skew = TRUE, cond.dist = "sged", trace = FALSE) print(coef(fit)) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchFit.std <- function() { # Conditional Densities: # "norm", "snorm", "ged", "sged", "std", "sstd" # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Student t-GARCH(1, 1) model = list(omega = 1e-06, alpha = 0.1, beta = 0.8, shape = 5) spec = garchSpec(model, cond.dist = "std") x = garchSim(spec = spec, n = 250) # Fi fit = garchFit( ~ garch(1,1), data = x, include.shape = TRUE, cond.dist = "std", trace = FALSE) print(coef(fit)) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchFit.sstd <- function() { # Conditional Densities: # "norm", "snorm", "ged", "sged", "std", "sstd" # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Skewed Student t-GARCH(1, 1) model = list(omega = 1e-06, alpha = 0.1, beta = 0.8, shape = 5, skew = 0.9) spec = garchSpec(model, cond.dist = "std") x = garchSim(spec = spec, n = 250) # Fit: fit = garchFit( ~ garch(1,1), data = x, include.shape = TRUE, include.skew = TRUE, cond.dist = "sstd", trace = FALSE) print(coef(fit)) # Return Value: return() } ################################################################################ fGarch/inst/unitTests/runit.garchFit.algorithm.R0000644000176200001440000001050113202277107021420 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ # FUNCTION: PARAMETER ESTIMATION: # 'fGARCH' S4: fGARCH Class representation # garchFit Fits GARCH and APARCH processes ################################################################################ test.garchFit.nlminb <- function() { # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Load Data: x = garchSim(n = 100) # Algorithms: # "nlminb", "sqp", "lbfgsb", "nlminb+nm", "lbfgsb+nm" # nlminb: fit = garchFit( ~ garch(1,1), data = x, algorithm = "nlminb", trace = FALSE) print(coef(fit)) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchFit.sqp <- function() { # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Load Data: x = garchSim(n = 100) # Algorithms: # "nlminb", "sqp", "lbfgsb", "nlminb+nm", "lbfgsb+nm" ### # sqp: ### fit = garchFit( ~ garch(1,1), data = x, ### algorithm = "sqp", trace = FALSE) ### print(coef(fit)) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchFit.lbfgsb <- function() { # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Load Data: x = garchSim(n = 100) # Algorithms: # "nlminb", "sqp", "lbfgsb", "nlminb+nm", "lbfgsb+nm" # lbfgsb: fit = garchFit( ~ garch(1,1), data = x, algorithm = "lbfgsb", trace = FALSE) coef(fit) # nlminb+nm: fit = garchFit( ~ garch(1,1), data = x, algorithm = "nlminb+nm", trace = FALSE) coef(fit) # lbfgsb+nm: fit = garchFit( ~ garch(1,1), data = x, algorithm = "lbfgsb+nm", trace = FALSE) coef(fit) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchFit.nlmin.nm <- function() { # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Load Data: x = garchSim(n = 100) # Algorithms: # "nlminb", "sqp", "lbfgsb", "nlminb+nm", "lbfgsb+nm" # nlminb+nm: fit = garchFit( ~ garch(1,1), data = x, algorithm = "nlminb+nm", trace = FALSE) coef(fit) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchFit.lbfgsb.nm <- function() { # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Load Data: x = garchSim(n = 100) # Algorithms: # "nlminb", "sqp", "lbfgsb", "nlminb+nm", "lbfgsb+nm" # lbfgsb+nm: fit = garchFit( ~ garch(1,1), data = x, algorithm = "lbfgsb+nm", trace = FALSE) coef(fit) # Return Value: return() } ################################################################################ fGarch/inst/unitTests/runit.sged.R0000644000176200001440000001040513202277107016631 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ # FUNCTION: GED DISTRIBUTION: # dged Density for the Generalized Error Distribution # pged Probability function for the GED # qged Quantile function for the GED # rged Random Number Generator for the GED # FUNCTION: SKEW GED DISTRIBUTION: # dsged Density for the skewed GED # psged Probability function for the skewed GED # qsged Quantile function for the skewed GED # rsged Random Number Generator for the skewed GED # FUNCTION: GED DISTRIBUTION SLIDER: # sgedSlider Displays Generalized Error Distribution and RVS # FUNCTION: PARAMETER ESTIMATION: # gedFit Fit the parameters for a GED distribution # sgedFit Fit the parameters for a skew GED distribution # FUNCTION: MOMENTS: ################################################################################ test.sgedDis <- function() { # Generalized Error Distribution: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Test: test = .distCheck("ged", mean = 0, sd = 1, nu = 2, robust = FALSE) print(test) # Skew Generalized Error Distribution: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(1953, kind = "Marsaglia-Multicarry") test = .distCheck("sged", mean = 0, sd = 1, nu = 2, xi = 0.8, robust = FALSE) print(test) # Return Value: return() } # ------------------------------------------------------------------------------ test.sgedFit <- function() { # Parameter Estimation: # gedFit - Fit the parameters for a GED distribution # Generalized Error Distribution: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Series: x = rged(1000, mean = 0, nu = 2) # Fit: fit = gedFit(x) print(fit) # Fit the parameters for a skew GED distribution # sgedFit - Fit the parameters for a skew GED distribution # Skew Generalized Error Distribution: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") x = rsged(1000, mean = 0, sd = 1, nu = 2, xi = 1.5) fit = sgedFit(x) print(fit) # Return Value: return() } # ------------------------------------------------------------------------------ test.sgedSlider <- function() { # Try Distribution: # sgedSlider(type = "dist") NA # Try Random Variates: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # sgedSlider(type = "rand") NA # Return Value: return() } ################################################################################ fGarch/inst/unitTests/runit.garchFit.faked.R0000644000176200001440000001371413202277107020515 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ # FUNCTION: PARAMETER ESTIMATION: # 'fGARCH' S4: fGARCH Class representation # garchFit Fits GARCH and APARCH processes ################################################################################ test.garchFit.faked <- function() { # Numeric Vector RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Simulate normal GARCH(1, 1) numeric Vector: model = list(omega = 1e-06, alpha = 0.1, beta = 0.8) spec = garchSpec(model) print(spec) N = 250 # UNIVARIATE: x.vec = as.vector(100*garchSim(spec, N)) print(head(x.vec)) x.tS = dummyDailySeries(matrix(x.vec), units = "GARCH11") print(head(x.tS)) # x.zoo = zoo(as.vector(x.vec), order.by = as.Date(rownames(x.tS))) # print(head(x.zoo)) x.ts = ts(x.vec) print(head(x.ts)) # FIT FROM UNIVARIATE DATA SERIES: fit = garchFit( ~ garch(1,1), data = x.tS, trace = FALSE) print(fit) formula(fit) fit = garchFit( ~ garch(1,1), data = as.vector(x.tS), trace = FALSE) print(fit) formula(fit) a = 2 b = 2 fit = garchFit( ~ garch(1,1), data = a*as.vector(0+b*x.tS), trace = FALSE) print(fit) formula(fit) # WHAT HAPPENS WHEN WE (MIS)SPECIFY LHS ? # ... lhs will be ignored for the univariate case: fit = garchFit(any ~ garch(1,1), data = x.vec, trace = FALSE) print(fit) formula(fit) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchFit.mult.faked <- function() { # Numeric Vector RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Simulate normal GARCH(1, 1) numeric Vector: model = list(omega = 1e-06, alpha = 0.1, beta = 0.8) spec = garchSpec(model) print(spec) N = 250 # UNIVARIATE: x.vec = as.vector(100*garchSim(spec, N)) print(head(x.vec)) x.tS = dummyDailySeries(matrix(x.vec), units = "GARCH11") print(head(x.tS)) # x.zoo = zoo(as.vector(x.vec), order.by = as.Date(rownames(x.tS))) # print(head(x.zoo)) x.ts = ts(x.vec) print(head(x.ts)) # MULTIVARIATE: X.mat = cbind(GARCH11 = x.vec, R = rnorm(N)/1000) print(head(X.mat)) X.tS = dummyDailySeries(X.mat, units = c("GARCH11", "R")) print(head(X.tS)) # X.zoo = zoo(X.mat, order.by = as.Date(rownames(x.tS))) # print(head(X.zoo)) X.mts = ts(X.mat) print(head(X.mts)) # FIT FROM MULTIVARIATE DATA SET: fit = garchFit(GARCH11 ~ garch(1,1), data = X.tS, trace = FALSE) print(fit) formula(fit) fit = garchFit(GARCH11 ~ garch(1,1), data = as.matrix(X.tS), trace = FALSE) print(fit) formula(fit) a = 2 b = 2 fit = garchFit(GARCH11 ~ garch(1,1), data = a*as.matrix(0+b*X.tS), trace = FALSE) print(fit) formula(fit) a = 2 b = 2 fit = garchFit(GARCH11 ~ garch(1,1), data = a*as.matrix(0+b*X.tS), trace = FALSE) print(fit) formula(fit) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchFit.mult.lhs.faked <- function() { # Numeric Vector RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Simulate normal GARCH(1, 1) numeric Vector: model = list(omega = 1e-06, alpha = 0.1, beta = 0.8) spec = garchSpec(model) print(spec) N = 250 # UNIVARIATE: x.vec = as.vector(100*garchSim(spec, N)) print(head(x.vec)) x.tS = dummyDailySeries(matrix(x.vec), units = "GARCH11") print(head(x.tS)) # x.zoo = zoo(as.vector(x.vec), order.by = as.Date(rownames(x.tS))) # print(head(x.zoo)) x.ts = ts(x.vec) print(head(x.ts)) # MULTIVARIATE: X.mat = cbind(GARCH11 = x.vec, R = rnorm(N)/1000) print(head(X.mat)) X.tS = dummyDailySeries(X.mat, units = c("GARCH11", "R")) print(head(X.tS)) # X.zoo = zoo(X.mat, order.by = as.Date(rownames(x.tS))) # print(head(X.zoo)) X.mts = ts(X.mat) print(head(X.mts)) # LEFT HAND SIDE FORMULA FAKED FIT: fit = garchFit(GARCH11 + R ~ garch(1,1), data = X.tS, trace = FALSE) print(fit) formula(fit) ### head(fit@data$data) ### head(fit@data$Data) ### head(rowSums(fit@data$Data)) # LEFT HAND SIDE FORMULA FAKED AND DATA FAKED FIT: fit = garchFit(GARCH11 + R ~ garch(1,1), data = as.matrix(X.tS), trace = FALSE) print(fit) formula(fit) ### head(fit@data$data) ### head(fit@data$Data) ### head(rowSums(fit@data$Data)) # Return Value: return() } ################################################################################ fGarch/inst/unitTests/runit.plot-methods.R0000644000176200001440000001423213202277107020330 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ test.plot.methods1 <- function() { # Load data: data(dem2gbp) dem2gbp = as.vector(dem2gbp[, 1]) # Fit to normal Conditional Distribution: fit = garchFit( ~ garch(1, 1), data = dem2gbp, trace = FALSE) print(fit) # garchFit 1: # 1: # 2: # Graph Frame: par(mfrow = c(2, 1)) # Plot 1: plot(fit, which = 1) mtext("norm-GARCH(1,1) Modeling", line = 0.5, cex = 0.8) mtext("DEM2GBP Data Vector", side = 4, adj = 0, cex = 0.7, col = "darkgrey") # Plot 2: plot(fit, which = 2) mtext("norm-GARCH(1,1) Modeling", line = 0.5, cex = 0.8) mtext("DEM2GBP Data Vector", side = 4, adj = 0, cex = 0.7, col = "darkgrey") # Return Value: return() } # ------------------------------------------------------------------------------ test.plot.methods2 <- function() { # Load data: data(dem2gbp) # Fit to normal Conditional Distribution: fit = garchFit( ~ garch(1, 1), data = dem2gbp, trace = FALSE) print(fit) # garchFit 2: # Graph Frame: par(mfrow = c(1, 1)) # Plot 3: plot(fit, which = 3) mtext("norm-GARCH(1,1) Modeling", line = 0.5, cex = 0.8) mtext("DEM2GBP Data Vector", side = 4, adj = 0, cex = 0.7, col = "darkgrey") # Return Value: return() } # ------------------------------------------------------------------------------ test.plot.methods3 <- function() { # Load data: data(dem2gbp) # Fit to normal Conditional Distribution: fit = garchFit( ~ garch(1, 1), data = dem2gbp, trace = FALSE) print(fit) # garchFit3: # 3: # 4: # 5: # Graph Frame: par(mfrow = c(2, 1)) # Plot 4: plot(fit, which = 4) mtext("norm-GARCH(1,1) Modeling", line = 0.5, cex = 0.8) mtext("DEM2GBP Data Vector", side = 4, adj = 0, cex = 0.7, col = "darkgrey") # Plot 5: plot(fit, which = 5) mtext("norm-GARCH(1,1) Modeling", line = 0.5, cex = 0.8) mtext("DEM2GBP Data Vector", side = 4, adj = 0, cex = 0.7, col = "darkgrey") # Return Value: return() } # ------------------------------------------------------------------------------ test.plot.methods4 <- function() { # Load data: data(dem2gbp) # Fit to normal Conditional Distribution: fit = garchFit( ~ garch(1, 1), data = dem2gbp, trace = FALSE) print(fit) # garchFit4: # 6: Cross Correlation # 7: Residuals # 8: Conditional SDs # 9: Standardized Residuals # Graph Frame: par(mfrow = c(2, 2)) # Plot 6: plot(fit, which = 6) mtext("norm-GARCH(1,1) Modeling", line = 0.5, cex = 0.8) mtext("DEM2GBP Data Vector", side = 4, adj = 0, cex = 0.7, col = "darkgrey") # Plot 7: plot(fit, which = 7) mtext("norm-GARCH(1,1) Modeling", line = 0.5, cex = 0.8) mtext("DEM2GBP Data Vector", side = 4, adj = 0, cex = 0.7, col = "darkgrey") # Plot 8: plot(fit, which = 8) mtext("norm-GARCH(1,1) Modeling", line = 0.5, cex = 0.8) mtext("DEM2GBP Data Vector", side = 4, adj = 0, cex = 0.7, col = "darkgrey") # Plot 9: plot(fit, which = 9) mtext("norm-GARCH(1,1) Modeling", line = 0.5, cex = 0.8) mtext("DEM2GBP Data Vector", side = 4, adj = 0, cex = 0.7, col = "darkgrey") # Return Value: return() } # ------------------------------------------------------------------------------ test.plot.methods5 <- function() { # Load data: data(dem2gbp) # Fit to normal Conditional Distribution: fit = garchFit( ~ garch(1, 1), data = dem2gbp, trace = FALSE) print(fit) # garchFit5: # 10: ACF of Standardized Residuals # 11: ACF of Squared Standardized Residuals # 12: Cross Correlation between r^2 and r # 13: QQ-Plot of Standardized Residuals # Graph Frame: par(mfrow = c(2, 2)) # Plot 10: plot(fit, which = 10) mtext("norm-GARCH(1,1) Modeling", line = 0.5, cex = 0.8) mtext("DEM2GBP Data Vector", side = 4, adj = 0, cex = 0.7, col = "darkgrey") # Plot 11: plot(fit, which = 11) mtext("norm-GARCH(1,1) Modeling", line = 0.5, cex = 0.8) mtext("DEM2GBP Data Vector", side = 4, adj = 0, cex = 0.7, col = "darkgrey") # Plot 12: plot(fit, which = 12) mtext("norm-GARCH(1,1) Modeling", line = 0.5, cex = 0.8) mtext("DEM2GBP Data Vector", side = 4, adj = 0, cex = 0.7, col = "darkgrey") # Plot 13: plot(fit, which = 13) mtext("norm-GARCH(1,1) Modeling", line = 0.5, cex = 0.8) mtext("DEM2GBP Data Vector", side = 4, adj = 0, cex = 0.7, col = "darkgrey") # Return Value: return() } ################################################################################ fGarch/inst/unitTests/runit.sstd.R0000644000176200001440000001067513202277107016675 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ # FUNCTION: VARIANCE-1 STUDENT-T DISTRIBUTION: # dstd Density for the Student-t Distribution # pstd Probability function for the Student-t Distribution # qstd Quantile function for the Student-t Distribution # rstd Random Number Generator for the Student-t # FUNCTION: SKEW VARIANCE-1 STUDENT-T DISTRIBUTION: # dsstd Density for the skewed Student-t Distribution # psstd Probability function for the skewed STD # qsstd Quantile function for the skewed STD # rsstd Random Number Generator for the skewed STD # stdSlider Displays Variance-1 Student-t Distribution and RVS # FUNCTION: PARAMETER ESTIMATION: # stdFit Fit the parameters for a Sudent-t distribution # sstdFit Fit the parameters for a skew Sudent-t distribution ################################################################################ test.sstdDist <- function() { # Standardized Student-t Distribution: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Test: test = .distCheck("std", mean = 0, sd = 1, nu = 5, robust = FALSE) print(test) # Skew Standardized Student-t Distribution: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Test: test = .distCheck("sstd", mean = 0, sd = 1, nu = 5, xi = 1.5, robust = FALSE) print(test) # Return Value: return() } # ------------------------------------------------------------------------------ test.stdFit <- function() { # Fit the parameters for a Student-t distribution # stdFit - Fit the parameters for a Sudent-t distribution # Standardized Student-t Distribution: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Series: x = rstd(n = 2500, mean = 0, sd = 1, nu = 5) # Fit: fit = stdFit(x) print(fit) # Fit the parameters for a skew Sudent-t distribution # sstdFit - Fit the parameters for a Sudent-t distribution # Skew Standardized Student-t Distribution: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Series: x = rsstd(n = 2500, mean = 0, sd = 1, nu = 5, xi = 1.5) # Fit: fit = sstdFit(x) print(fit) # Return Value: return() } # ------------------------------------------------------------------------------ test.sstdSlider <- function() { # Try Distribution: # sstdSlider(type = "dist") NA # Try Random Variates: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # sstdSlider(type = "rand") NA # Return Value: return() } ################################################################################ fGarch/inst/unitTests/runit.garchFit.init.R0000644000176200001440000000427413202277107020407 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ # FUNCTION: PARAMETER ESTIMATION: # 'fGARCH' S4: fGARCH Class representation # garchFit Fits GARCH and APARCH processes ################################################################################ test.garchFit.init <- function() { # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Simulate Garch(1,1) Series: x = garchSim(n = 250) # Modify Start Values - mci default: fit = garchFit( ~ garch(1,1), x, init.rec = "mci", trace = FALSE) # default print(coef(fit)) # Modify Start Values - uev alternative: # fit = garchFit( ~ garch(1,1), x, init.rec = "uev", trace = FALSE) # Error in .garchFit(formula.mean = args$formula.mean, formula.var = args$formula.var, : # Algorithm only supported for mci Recursion # coef(fit) # Return Value: return() } ################################################################################ fGarch/inst/unitTests/runit.garchHessian.R0000644000176200001440000000302213202277107020303 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ # FUNCTION: PARAMETER ESTIMATION: # .garchRCDAHessian Computes R coded CDA Hessian matrix # .garchFCDAHessian Computes Fortran coded CDA Hessian matrix # .garchFFDAHessian Computes Fortran coded FDA Hessian matrix ################################################################################ fGarch/inst/unitTests/runTests.R0000644000176200001440000000452613202277107016405 0ustar liggesuserspkg <- "fGarch" if(require("RUnit", quietly = TRUE)) { library(package=pkg, character.only = TRUE) if(!(exists("path") && file.exists(path))) path <- system.file("unitTests", package = pkg) ## --- Testing --- ## Define tests testSuite <- defineTestSuite(name = paste(pkg, "unit testing"), dirs = path) if(interactive()) { cat("Now have RUnit Test Suite 'testSuite' for package '", pkg, "' :\n", sep='') str(testSuite) cat('', "Consider doing", "\t tests <- runTestSuite(testSuite)", "\nand later", "\t printTextProtocol(tests)", '', sep = "\n") } else { ## run from shell / Rscript / R CMD Batch / ... ## Run tests <- runTestSuite(testSuite) if(file.access(path, 02) != 0) { ## cannot write to path -> use writable one tdir <- tempfile(paste(pkg, "unitTests", sep="_")) dir.create(tdir) pathReport <- file.path(tdir, "report") cat("RUnit reports are written into ", tdir, "/report.(txt|html)", sep = "") } else { pathReport <- file.path(path, "report") } ## Print Results: printTextProtocol(tests, showDetails = FALSE) printTextProtocol(tests, showDetails = FALSE, fileName = paste(pathReport, "Summary.txt", sep = "")) printTextProtocol(tests, showDetails = TRUE, fileName = paste(pathReport, ".txt", sep = "")) ## Print HTML Version to a File: ## printHTMLProtocol has problems on Mac OS X if (Sys.info()["sysname"] != "Darwin") printHTMLProtocol(tests, fileName = paste(pathReport, ".html", sep = "")) ## stop() if there are any failures i.e. FALSE to unit test. ## This will cause R CMD check to return error and stop tmp <- getErrors(tests) if(tmp$nFail > 0 | tmp$nErr > 0) { stop(paste("\n\nunit testing failed (#test failures: ", tmp$nFail, ", R errors: ", tmp$nErr, ")\n\n", sep="")) } } } else { cat("R package 'RUnit' cannot be loaded -- no unit tests run\n", "for package", pkg,"\n") } ################################################################################ fGarch/inst/unitTests/runit.garchFit.aparch.R0000644000176200001440000001022413202277107020672 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ # FUNCTION: PARAMETER ESTIMATION: # 'fGARCH' S4: fGARCH Class representation # garchFit Fits GARCH and APARCH processes ################################################################################ # garchFit( # formula, # data, # init.rec = c("mci", "uev"), # delta = 2, # skew = 1, # shape = 4, # cond.dist = c("dnorm", "dsnorm", "dged", "dsged", "dstd", "dsstd"), # include.mean = TRUE, # include.delta = NULL, # include.skew = NULL, # include.shape = NULL, # leverage = NULL, # trace = TRUE, # algorithm = c("sqp", "nlminb", "lbfgsb", "nlminb+nm", "lbfgsb+nm"), # control = list(), # title = NULL, # description = NULL, # ...) # ------------------------------------------------------------------------------ test.aparch11 <- function() { # Use Simulated Series - an Object of class 'ts' ... # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Leveraged normal APARCH(1, 1) model = list(omega = 1e-06, alpha = 0.1, beta = 0.8, gamma = 0.1) spec = garchSpec(model) x = garchSim(spec, n = 250) # Fit: fit = garchFit(x ~ garch(1,1), data = x, leverage = TRUE, trace = FALSE) print(coef(fit)) # Return Value: return() } # ------------------------------------------------------------------------------ test.aparch11delta <- function() { # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Leveraged normal APARCH(1, 1) delta = 1.5 model = list(omega = 1e-05, alpha = 0.1, beta = 0.8, gamma = 0.1, delta = 1.5) spec = garchSpec(model) x = garchSim(spec, n = 250) print(var(x)) # Fit: fit = garchFit(x ~ garch(1,1), data = x, leverage = TRUE, include.delta = TRUE, delta = 2, trace = FALSE) print(coef(fit)) # Return Value: return() } # ------------------------------------------------------------------------------ test.ar1aparch21 <- function() { # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Leveraged normal AR(1)-APARCH(2, 1) delta = 1 model = list(omega = 1e-06, ar = -0.1, alpha = c(0.1, 0.2), beta = 0.6, delta = 1) spec = garchSpec(model) x = garchSim(spec, n = 250) # Taylor Plot: taylor = teffectPlot(x) init.delta = mean(taylor$maxDelta) init.delta ## fit = garchFit(x ~ ar(1) + garch(2,1), data = x, include.delta = TRUE, ## delta = init.delta, trace = FALSE) ## print(coef(fit)) ## Error in solve.default(fit$hessian) : ## Lapack routine dgesv: system is exactly singular ## CHECK !!! # Return Value: return() } ################################################################################ fGarch/inst/unitTests/runit.garchFit.garch.R0000644000176200001440000000735213202277107020530 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ # FUNCTION: PARAMETER ESTIMATION: # 'fGARCH' S4: fGARCH Class representation # garchFit Fits GARCH and APARCH processes ################################################################################ # garchFit( # formula, # data, # init.rec = c("mci", "uev"), # delta = 2, # skew = 1, # shape = 4, # cond.dist = c("dnorm", "dsnorm", "dged", "dsged", "dstd", "dsstd"), # include.mean = TRUE, # include.delta = NULL, # include.skew = NULL, # include.shape = NULL, # leverage = NULL, # trace = TRUE, # algorithm = c("sqp", "nlminb", "lbfgsb", "nlminb+nm", "lbfgsb+nm"), # control = list(), # title = NULL, # description = NULL, # ...) # ------------------------------------------------------------------------------ test.garchFit.garch11 <- function() { # Use Simulated Series - an Object of class 'ts' ... # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Normal GARCH(1, 1) x = garchSim(n = 250) # Fit: fit = garchFit( ~ garch(1,1), data = x, trace = FALSE) print(coef(fit)) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchFit.garch21 <- function() { # Use Simulated Series - an Object of class 'ts' ... # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Normal-GARCH(2, 1) model = list(omega = 1e-06, alpha = c(0.1, 0.2), beta = 0.6) spec = garchSpec(model) x = garchSim(spec = spec, n = 250) # Fit fit = garchFit( ~ garch(2,1), data = x, trace = FALSE) print(coef(fit)) # Return Value: return() } # ------------------------------------------------------------------------------ test.garchFit.ar1garch11 <- function() { # Use Simulated Series - an Object of class 'ts' ... # RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Normal AR(1)-GARCH(1,1): model = list(omega = 1e-06, ar = -0.1, alpha = c(0.1, 0.2), beta = 0.6) spec = garchSpec(model) x = garchSim(spec = spec, n = 250) # Fit: fit = garchFit(~ arma(1,0) + garch(1,1), data = x, trace = FALSE) print(coef(fit)) # Return Value: return() } ################################################################################ fGarch/inst/unitTests/runit.formula-methods.R0000644000176200001440000001400413202277107021014 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ test.formula.methods.univariate <- function() { # Numeric Vector RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Simulate normal GARCH(1, 1) numeric Vector: spec = garchSpec() N = 250 # Univariate Data Simulation: x.vec = 100*garchSim(spec, N) print(head(x.vec)) x.tS = dummyDailySeries(matrix(x.vec), units = "GARCH11") print(head(x.tS)) # x.zoo = zoo(as.vector(x.vec), order.by = as.Date(rownames(x.tS))) # print(head(x.zoo)) x.ts = as.ts(x.vec) print(head(x.ts)) # Univariate Modeling: # A numeric Vector: fit = garchFit(~ garch(1,1), data = x.vec, trace = FALSE) print(formula(fit)) fit = garchFit(x.vec ~ garch(1,1), data = x.vec, trace = FALSE) print(formula(fit)) # An univariate timeSeries object with dummy dates: fit = garchFit(~ garch(1,1), data = x.tS, trace = FALSE) print(formula(fit)) fit = garchFit(x.tS ~ garch(1,1), data = x.tS, trace = FALSE) print(formula(fit)) ### # An univariate zoo object with dummy dates: ### fit = garchFit(~ garch(1,1), data = x.zoo, trace = FALSE) ### print(formula(fit)) ### fit = garchFit(x.zoo ~ garch(1,1), data = x.zoo, trace = FALSE) ### print(formula(fit)) # An univariate "ts" object: fit = garchFit(~ garch(1,1), data = x.ts, trace = FALSE) print(formula(fit)) fit = garchFit(x.ts ~ garch(1,1), data = x.ts, trace = FALSE) print(formula(fit)) # Return Value: return() } # ------------------------------------------------------------------------------ test.formula.methods.multivariate <- function() { # Numeric Vector RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Simulate normal GARCH(1, 1) numeric Vector: spec = garchSpec() N = 250 # Univariate Data Simulation: x.vec = 100*garchSim(spec, N) print(head(x.vec)) x.tS = dummyDailySeries(matrix(x.vec), units = "GARCH11") print(head(x.tS)) # Multivariate Data Simulation: X.mat = cbind(GARCH11 = x.vec, R = rnorm(N)) colnames(X.mat) <- c("GARCH11", "R") print(head(X.mat)) X.tS = dummyDailySeries(X.mat, units = c("GARCH11", "R")) print(head(X.tS)) # X.zoo = zoo(X.mat, order.by = as.Date(rownames(x.tS))) # print(head(X.zoo)) X.mts = as.ts(X.mat) print(head(X.mts)) # head doesn't wor for mts !!! # Multivariate Modeling: # A numeric matrix: fit = garchFit(GARCH11 ~ garch(1,1), data = X.mat, trace = FALSE) print(formula(fit)) fit = garchFit(100*GARCH11 ~ garch(1,1), data = X.mat, trace = FALSE) print(formula(fit)) # A multivariate timeSeries object with dummy dates: fit = garchFit(GARCH11 ~ garch(1,1), data = X.tS, trace = FALSE) print(formula(fit)) fit = garchFit(100*GARCH11 ~ garch(1,1), data = X.tS, trace = FALSE) print(formula(fit)) ### # A multivariate zoo object without column names: ### fit = garchFit(GARCH11 ~ garch(1,1), data = X.zoo, trace = FALSE) ### print(formula(fit)) ### fit = garchFit(100*GARCH11 + R/100 ~ garch(1,1), data = X.zoo, trace = FALSE) ### print(formula(fit)) # A multivariate "mts" object without column names: fit = garchFit(GARCH11 ~ garch(1,1), data = X.mts, trace = FALSE) print(formula(fit)) fit = garchFit(100*GARCH11 + R/100 ~ garch(1,1), data = X.mts, trace = FALSE) print(formula(fit)) # Return Value: return() } # ------------------------------------------------------------------------------ test.formula.methods.spread <- function() { # MODELING THE PERCENTUAL SPI/SBI SPREAD FROM LPP BENCHMARK: # Series: X.tS = as.timeSeries(data(LPP2005REC)) print(head(X.tS)) X.mat = as.matrix(X.tS) print(head(X.mat)) # X.zoo = zoo(X.mat, order.by = as.Date(rownames(X.tS))) # print(head(X.zoo)) X.mts = ts(X.mat) print(head(X.mts)) # head does not work for ts objects! # Fit: fit = garchFit(100*(SPI - SBI) ~ garch(1,1), data = X.tS, trace = FALSE) print(formula(fit)) ## fit = garchFit(100*(SPI - SBI) ~ garch(1,1), data = X.mat, trace = FALSE) ## print(formula(fit)) ## fit = garchFit(100*(SPI - SBI) ~ garch(1,1), data = X.zoo, trace = FALSE) ## print(formula(fit)) ## fit = garchFit(100*(SPI - SBI) ~ garch(1,1), data = X.mts, trace = FALSE) ## print(formula(fit)) # MODELING HIGH/LOW SPREADS FROM MSFT PRICE SERIES: # Series: X.tS = MSFT # Fit: fit = garchFit(Open ~ garch(1,1), data = returns(X.tS), trace = FALSE) print(formula(fit)) fit = garchFit(100*(High-Low) ~ garch(1,1), data = returns(X.tS), trace = FALSE) print(formula(fit)) # Return Value: return() } ################################################################################ fGarch/inst/unitTests/runit.garchFit.R0000644000176200001440000000622513202277107017443 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # Copyrights (C) # for this R-port: # 1999 - 2008, Diethelm Wuertz, Rmetrics Foundation, GPL # Diethelm Wuertz # info@rmetrics.org # www.rmetrics.org # for the code accessed (or partly included) from other R-ports: # see R's copyright and license files # for the code accessed (or partly included) from contributed R-ports # and other sources # see Rmetrics's copyright file ################################################################################ # FUNCTION: PARAMETER ESTIMATION: # 'fGARCH' S4: fGARCH Class representation # garchFit Fits GARCH and APARCH processes ################################################################################ # garchFit( # formula, # data, # init.rec = c("mci", "uev"), # delta = 2, # skew = 1, # shape = 4, # cond.dist = c("dnorm", "dsnorm", "dged", "dsged", "dstd", "dsstd"), # include.mean = TRUE, # include.delta = NULL, # include.skew = NULL, # include.shape = NULL, # leverage = NULL, # trace = TRUE, # algorithm = c("sqp", "nlminb", "lbfgsb", "nlminb+nm", "lbfgsb+nm"), # control = list(), # title = NULL, # description = NULL, # ...) # ------------------------------------------------------------------------------ test.garchInputSeries <- function() { # Numeric Vector RVs: RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") set.seed(4711, kind = "Marsaglia-Multicarry") # Simulate normal GARCH(1, 1) numeric Vector: model = list(omega = 1e-06, alpha = 0.1, beta = 0.8) spec = garchSpec(model) print(spec) N = 10 # UNIVARIATE: # A numeric Vector: x.vec = as.vector(100*garchSim(spec, N)) print(head(x.vec)) x.tS = dummyDailySeries(matrix(x.vec), units = "GARCH11") print(head(x.tS)) # x.zoo = zoo(as.vector(x.vec), order.by = as.Date(rownames(x.tS))) # print(head(x.zoo)) x.ts = ts(x.vec) print(head(x.ts)) # MULTIVARIATE: # A numeric matrix: X.mat = cbind(GARCH11 = x.vec, R = rnorm(N)) print(head(X.mat)) X.tS = dummyDailySeries(X.mat, units = c("GARCH11", "R")) print(head(X.tS)) # X.zoo = zoo(X.mat, order.by = as.Date(rownames(x.tS))) # print(head(X.zoo)) X.mts = ts(X.mat) print(head(X.mts)) # Return Value: return() } ################################################################################ fGarch/tests/0000755000176200001440000000000013202300512012572 5ustar liggesusersfGarch/tests/doRUnit.R0000644000176200001440000000151613202300512014304 0ustar liggesusers#### doRUnit.R --- Run RUnit tests ####------------------------------------------------------------------------ ### Origianlly follows Gregor Gojanc's example in CRAN package 'gdata' ### and the corresponding section in the R Wiki: ### http://wiki.r-project.org/rwiki/doku.php?id=developers:runit ### MM: Vastly changed: This should also be "runnable" for *installed* ## package which has no ./tests/ ## ----> put the bulk of the code e.g. in ../inst/unitTests/runTests.R : if(require("RUnit", quietly = TRUE)) { ## --- Setup --- wd <- getwd() pkg <- sub("\\.Rcheck$", '', basename(dirname(wd))) library(package=pkg, character.only = TRUE) path <- system.file("unitTests", package = pkg) stopifnot(file.exists(path), file.info(path.expand(path))$isdir) source(file.path(path, "runTests.R"), echo = TRUE) } fGarch/src/0000755000176200001440000000000013202303414012223 5ustar liggesusersfGarch/src/Makevars0000644000176200001440000000005613203345302013723 0ustar liggesusersPKG_LIBS=$(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) fGarch/src/dist.f0000644000176200001440000001216413203345302013344 0ustar liggesusers C ------------------------------------------------------------------------------ C CONDITIONAL DISTRIBUTON: DOUBLE PRECISION FUNCTION DIST(Z, HH, SKEW, SHAPE, NDIST) IMPLICIT NONE INTEGER NDIST DOUBLE PRECISION Z, HH, SKEW, SHAPE DOUBLE PRECISION DNORM, DSNORM, DSTD, DSSTD, DGED, DSGED IF (NDIST.EQ.10) THEN C NORMAL: DIST = DNORM(Z/HH)/HH RETURN END IF IF (NDIST.EQ.11) THEN C SKEW NORMAL: DIST = DSNORM(Z/HH, SKEW)/HH RETURN END IF IF (NDIST.EQ.20) THEN C STUDENT-T: DIST = DSTD(Z/HH, SHAPE)/HH RETURN END IF IF (NDIST.EQ.21) THEN C SKEW STUDENT-T: DIST = DSSTD(Z/HH, SHAPE, SKEW)/HH RETURN END IF IF (NDIST.EQ.30) THEN C GED: DIST = DGED(Z/HH, SHAPE)/HH RETURN END IF IF (NDIST.EQ.31) THEN C SKEW GED: DIST = DSGED(Z/HH, SHAPE, SKEW)/HH RETURN END IF RETURN END C ------------------------------------------------------------------------------ C NORMAL: DOUBLE PRECISION FUNCTION DNORM(X) IMPLICIT NONE DOUBLE PRECISION X DOUBLE PRECISION PI, TWO PI = 3.141592653589793D0 TWO = 2.0D0 DNORM = DEXP(-X**2/TWO) / DSQRT(TWO*PI) RETURN END C ------------------------------------------------------------------------------ C SKEW NORMAL: DOUBLE PRECISION FUNCTION DSNORM(X, XI) IMPLICIT NONE DOUBLE PRECISION X, XI DOUBLE PRECISION ONE, TWO, PI, M1, MU, SIGMA DOUBLE PRECISION Z, XXI, G DOUBLE PRECISION DNORM ONE = 1.0D0 TWO = 2.0D0 PI = 3.141592653589793D0 M1 = TWO/DSQRT(TWO*PI) MU = M1*(XI-ONE/XI) SIGMA = DSQRT((ONE-M1**2)*(XI**2+ONE/XI**2)+TWO*M1**2-ONE) Z = X*SIGMA+MU XXI = XI**SIGN(ONE, Z) IF (Z.EQ.0.0D0) THEN XXI = XI**0.0D0 END IF G = TWO/(XI+ONE/XI) DSNORM = G*DNORM(Z/XXI)*SIGMA RETURN END C ------------------------------------------------------------------------------ C GED: DOUBLE PRECISION FUNCTION DGED(X, NU) IMPLICIT NONE DOUBLE PRECISION X, NU DOUBLE PRECISION HALF, ONE, TWO, THREE, LAMBDA, G DOUBLE PRECISION DGAM HALF = 0.50D0 ONE = 1.0D0 TWO = 2.0D0 THREE = 3.0D0 LAMBDA = DSQRT(TWO**(-TWO/NU)*DGAM(ONE/NU)/DGAM(THREE/NU)) G = NU/(LAMBDA*(TWO**(ONE+ONE/NU))*DGAM(ONE/NU)) DGED = G*DEXP(-HALF*(DABS(X/LAMBDA))**NU) RETURN END C ------------------------------------------------------------------------------ C SKEW GED: DOUBLE PRECISION FUNCTION DSGED(X, NU, XI) IMPLICIT NONE DOUBLE PRECISION X, NU, XI DOUBLE PRECISION HALF, ONE, TWO, THREE, LAMBDA, G, M1, MU DOUBLE PRECISION SIGMA, Z, XXI DOUBLE PRECISION DGAM, DGED HALF = 0.50D0 ONE = 1.0D0 TWO = 2.0D0 THREE = 3.0D0 LAMBDA = DSQRT(TWO**(-TWO/NU)*DGAM(ONE/NU)/DGAM(THREE/NU)) G = NU/(LAMBDA*(TWO**(ONE+ONE/NU))*DGAM(ONE/NU)) M1 = (TWO**(ONE/NU))*LAMBDA*DGAM(TWO/NU)/DGAM(ONE/NU) MU = M1*(XI-ONE/XI) SIGMA = (ONE-M1**2)*(XI**2+ONE/(XI**2))+TWO*(M1**2)-ONE SIGMA = DSQRT(SIGMA) Z = X*SIGMA+MU XXI = XI**SIGN(ONE, Z) IF (Z.EQ.0.0D0) THEN XXI = XI**0.0D0 END IF DSGED = (TWO/(XI+ONE/XI))*DGED(Z/XXI, NU)*SIGMA RETURN END C ------------------------------------------------------------------------------ C STUDENT T: DOUBLE PRECISION FUNCTION DT(X, NU) IMPLICIT NONE DOUBLE PRECISION X, NU DOUBLE PRECISION ONE, TWO, PI, A, B DOUBLE PRECISION DGAM ONE = 1.0D0 TWO = 2.0D0 PI = 3.141592653589793D0 A = DGAM((NU+ONE)/TWO)/DSQRT(PI*NU) B = DGAM(NU/TWO)*(ONE+(X*X)/NU)**((NU+ONE)/TWO) DT = A/B RETURN END C ------------------------------------------------------------------------------ C STANDARDIZED STUDENT T: DOUBLE PRECISION FUNCTION DSTD(X, NU) IMPLICIT NONE DOUBLE PRECISION X, NU DOUBLE PRECISION TWO, S DOUBLE PRECISION DT TWO = 2.0D0 S = DSQRT(NU/(NU-TWO)) DSTD = S*DT(X*S,NU) RETURN END C ------------------------------------------------------------------------------ C STANDARDIZED SKEW STUDENT T: DOUBLE PRECISION FUNCTION DSSTD(X, NU, XI) IMPLICIT NONE DOUBLE PRECISION X, NU, XI DOUBLE PRECISION ONE, TWO, A, B, BETA, M1, MU DOUBLE PRECISION SIGMA, Z, G, XXI DOUBLE PRECISION DSTD, DGAM ONE = 1.0D0 TWO = 2.0D0 A = ONE/TWO B = NU/TWO BETA = (DGAM(A)/DGAM(A+B))*DGAM(B) M1 = TWO*DSQRT(NU-TWO)/(NU-ONE)/BETA MU = M1*(XI-ONE/XI) SIGMA = DSQRT((ONE-M1**2)*(XI**2+ONE/XI**2)+TWO*M1**2-ONE) Z = X*SIGMA+MU XXI = XI**SIGN(ONE, Z) IF (Z.EQ.0.0D0) THEN XXI = XI**0.0D0 END IF G = TWO/(XI+ONE/XI) DSSTD = G*DSTD(Z/XXI,NU)*SIGMA RETURN END fGarch/src/math.f0000644000176200001440000000320513203345302013326 0ustar liggesusers C GAMMA FUNCTION: DOUBLE PRECISION FUNCTION DGAM(X) IMPLICIT DOUBLE PRECISION (A-H, O-Z) DIMENSION G(26) DATA G/1.0D0,0.5772156649015329D0, + -0.6558780715202538D0, -0.420026350340952D-1, + 0.1665386113822915D0,-.421977345555443D-1, + -.96219715278770D-2, .72189432466630D-2, + -.11651675918591D-2, -.2152416741149D-3, + .1280502823882D-3, -.201348547807D-4, + -.12504934821D-5, .11330272320D-5, + -.2056338417D-6, .61160950D-8, + .50020075D-8, -.11812746D-8, + .1043427D-9, .77823D-11, + -.36968D-11, .51D-12, + -.206D-13, -.54D-14, .14D-14, .1D-15/ PI = 3.141592653589793D0 IF (X.EQ.INT(X)) THEN IF (X.GT.0.0D0) THEN DGAM = 1.0D0 M1 = X-1 DO K = 2, M1 DGAM = DGAM*K END DO ELSE DGAM = 1.0D+300 END IF ELSE IF (DABS(X).GT.1.0D0) THEN Z = DABS(X) M = INT(Z) R = 1.0D0 DO K = 1, M R = R*(Z-K) END DO Z = Z-M ELSE Z = X END IF GR = G(26) DO K = 25, 1, -1 GR = GR*Z+G(K) END DO DGAM = 1.0D0/(GR*Z) IF (DABS(X).GT.1.0D0) THEN DGAM = DGAM*R IF (X.LT.0.0D0) DGAM = -PI/(X*GA*DSIN(PI*X)) END IF END IF RETURN END C ------------------------------------------------------------------------------ fGarch/src/llhGarch.f0000644000176200001440000001041113203345302014116 0ustar liggesusers SUBROUTINE GARCHLLH(N, Y, Z, H, NF, X, DPARM, MDIST, MYPAR, F) IMPLICIT NONE C DECLARATION OF ARGUMENTS INTEGER N DOUBLE PRECISION Y(N), Z(N), H(N) INTEGER NF DOUBLE PRECISION X(NF) DOUBLE PRECISION DPARM(3) INTEGER MDIST INTEGER MYPAR(11) DOUBLE PRECISION F C LOCAL VARIABLE INTEGER INITREC, LEVERAGE, INCMEAN, INCDELTA ,INCSKEW, INCSHAPE INTEGER NR, NS, NP, NQ, NORM DOUBLE PRECISION XMEAN, XOMEGA, XDELTA, XSKEW, XSHAPE INTEGER IAR, IMA, IOMEGA, IALPHA, IBETA, IDELTA, ISKEW, ISHAPE INTEGER I, NEXT, IP, IQ, IR DOUBLE PRECISION SUMALPHA, SUMBETA, PERSISTENCE DOUBLE PRECISION VAR, ZI, ZZ, HH, LLH, DD DOUBLE PRECISION XINVD C EXTRENAL FUNC DOUBLE PRECISION DLOG, DIST C MYPAR INITREC = MYPAR(1) LEVERAGE = MYPAR(2) INCMEAN = MYPAR(3) INCDELTA = MYPAR(4) INCSKEW = MYPAR(5) INCSHAPE = MYPAR(6) NR = MYPAR(7) NS = MYPAR(8) NP = MYPAR(9) NQ = MYPAR(10) NORM = MYPAR(11) C DPARM XDELTA = DPARM(1) XSKEW = DPARM(2) XSHAPE = DPARM(3) C VECTOR START POSITIONS: IAR = INCMEAN + 1 IMA = INCMEAN+NR + 1 IOMEGA = INCMEAN+NR+NS + 1 IALPHA = INCMEAN+NR+NS+1 + 1 IBETA = INCMEAN+NR+NS+1+NP*(1+LEVERAGE) + 1 IDELTA = INCMEAN+NR+NS+1+NP*(1+LEVERAGE)+NQ + 1 ISKEW = INCMEAN+NR+NS+1+NP*(1+LEVERAGE)+NQ+INCDELTA + 1 ISHAPE = INCMEAN+NR+NS+1+NP*(1+LEVERAGE)+NQ+INCDELTA+INCSKEW+1 C TODO C INCLUDE MEAN? IF (INCMEAN.EQ.1) THEN XMEAN = X(1) ELSE XMEAN = 0.0D0 END IF C INCLUDE DELTA ? IF (INCDELTA.EQ.1) THEN XDELTA = X(IDELTA) END IF XINVD = 1.0D0/XDELTA C INCLUDE SKEW ? IF (INCSKEW.EQ.1) THEN XSKEW = X(ISKEW) END IF C INCLUDE SHAPE ? IF (INCSHAPE.EQ.1) THEN XSHAPE = X(ISHAPE) END IF C POSTION OMEGA: XOMEGA = X(IOMEGA) C ARMA RECURSION: DO I = 1, MAX(NR,NS) Z(I) = 0.0D0 END DO DO I = MAX(NR,NS)+1, N Z(I) = Y(I) - XMEAN NEXT = IAR DO IR = 1, NR, 1 Z(I) = Z(I) - X(NEXT)*Y(I-IR) NEXT = NEXT + 1 END DO NEXT = IMA DO IR = 1, NS, 1 Z(I) = Z(I) - X(NEXT)*Z(I-IR) NEXT = NEXT + 1 END DO END DO C COMPUTE (UNLEVERAGED) PERSISTENCE: SUMALPHA = 0.0D0 NEXT = IALPHA DO IP = 1, NP, 1 SUMALPHA = SUMALPHA + X(NEXT) NEXT = NEXT + 1 END DO NEXT = IBETA SUMBETA = 0.0D0 DO IP = 1, NQ, 1 SUMBETA = SUMBETA + X(NEXT) NEXT = NEXT + 1 END DO PERSISTENCE = SUMALPHA + SUMBETA C INITIALZE RECURSION - 1 (FCP) | 2 (TSP) LIKE: IF (INITREC.EQ.1) THEN VAR = 0.0D0 DO I = 1, N VAR = VAR + Z(I)**2 END DO VAR = VAR/N END IF IF (INITREC.EQ.2) THEN VAR = XOMEGA/(1.0D0-PERSISTENCE) END IF C ITERATE H: DO I = 1, MAX(NP,NQ) H(I) = XOMEGA + PERSISTENCE*VAR END DO IF (LEVERAGE.EQ.1) THEN DO I = MAX(NP,NQ)+1, N H(I) = XOMEGA NEXT = IALPHA DO IP = 1, NP, 1 ZI = DABS(Z(I-IP))-X(NEXT+NP)*Z(I-IP) H(I) = H(I) + X(NEXT)*DABS(ZI)**XDELTA NEXT = NEXT + 1 END DO NEXT = IBETA DO IQ = 1, NQ, 1 H(I) = H(I) + X(NEXT)*H(I-IQ) NEXT = NEXT + 1 END DO END DO ELSE DO I = MAX(NP,NQ)+1, N H(I) = XOMEGA NEXT = IALPHA DO IP = 1, NP, 1 H(I) = H(I) + X(NEXT)*DABS(Z(I-IP))**XDELTA NEXT = NEXT + 1 END DO NEXT = IBETA DO IQ = 1, NQ, 1 H(I) = H(I) + X(NEXT)*H(I-IQ) NEXT = NEXT + 1 END DO END DO END IF C COMPUTE LIKELIHOOD: LLH = 0.0D0 DO I = 1, N ZZ = Z(I) HH = DABS(H(I))**XINVD DD = DLOG( DIST(ZZ, HH, XSKEW, XSHAPE, MDIST) ) LLH = LLH - DD END DO F = LLH RETURN END fGarch/NAMESPACE0000644000176200001440000000572413202272600012665 0ustar liggesusers ################################################ ## import name space ################################################ import("stats") import("graphics") import("methods") import("timeDate") import("timeSeries") import("fBasics") importFrom("utils", capture.output, menu) ################################################ ## useDynLib ################################################ useDynLib("fGarch") ################################################ ## S4 classes ################################################ exportClasses("fGARCH", "fGARCHSPEC", "fUGARCHSPEC" ) exportMethods("coef", "fitted", "formula", "plot", "predict", "residuals", "show", "summary", "update" ) ################################################ ## S3 classes ################################################ S3method("volatility", "fGARCH") ################################################ ## functions ################################################ export( ".QMLECondDist", ".aparchLLH.filter", ".aparchLLH.internal", ".aparchLLH.testing", ".dsged", ".dsnorm", ".dsstd", ".garchArgsParser", ".garchFit", ".garchInitParameters", ".garchInitSeries", ".garchKappaFun", ".garchLLH", ".garchModelSeries", ".garchNames", ".garchOptimizeLLH", ".garchOptimizerControl", ".garchRCDAGradient", ".garchRCDAHessian", ".garchRlbfgsb", ".garchRnlminb", ".garchRnm", ".garchRoptimhess", ".garchSetCondDist", ".garchTSHessian", ".gedCondDist", ".gedFit", ".getfGarchEnv", ".gogarchFit", ".hessian2sided", ".interactiveGarchPlot", ".multGarchPlot", ".normCondDist", ".plot.garch.1", ".plot.garch.10", ".plot.garch.11", ".plot.garch.12", ".plot.garch.13", ".plot.garch.2", ".plot.garch.3", ".plot.garch.4", ".plot.garch.5", ".plot.garch.6", ".plot.garch.7", ".plot.garch.8", ".plot.garch.9", ".psged", ".psnorm", ".psstd", ".qqDist", ".qqLine", ".qsged", ".qsnorm", ".qsstd", ".rsged", ".rsnorm", ".rsstd", ".setfGarchEnv", ".sgedCondDist", ".sgedFit", ".snigCondDist", ".snormCondDist", ".snormFit", ".sstdCondDist", ".sstdFit", ".stdCondDist", ".stdFit", ".truePersistence", ".ugarchFit", ".ugarchSpec", "absMoments", "dged", "dsged", "dsnorm", "dsstd", "dstd", "garchFit", "garchFitControl", "garchKappa", "garchSim", "garchSpec", "gedFit", "gedSlider", "pged", "psged", "psnorm", "psstd", "pstd", "qged", "qsged", "qsnorm", "qsstd", "qstd", "rged", "rsged", "rsnorm", "rsstd", "rstd", "sgedFit", "sgedSlider", "snormFit", "snormSlider", "sstdFit", "sstdSlider", "stdFit", "stdSlider" ) fGarch/data/0000755000176200001440000000000013202277106012355 5ustar liggesusersfGarch/data/dem2gbp.csv0000644000176200001440000015007313202277106014420 0ustar liggesusersDEM2GBP 0.12533286 0.028874268 0.063461772 0.22671922 -0.21426695 0.20285367 0.16307007 0.044576711 -0.32004288 0.50415113 -0.23378662 -0.098017371 -0.084630738 0.015684012 -0.034409159 -0.060019766 0.058845114 -0.11381741 0.071118260 -0.18494858 -0.23161388 -0.41518445 -0.11181140 -0.15872893 -0.15172886 -0.28214838 -0.22096176 -0.028998565 -0.16657024 0.14475309 -0.44695983 -0.15385684 0.37519467 0.25476431 0.90773184 -1.3428085 0.59497405 -1.0008502 0.47749075 0.35887564 -0.17128037 -0.26294254 -1.0645585 -0.12831676 -0.71015654 -0.83077487 0.18235792 -0.23850088 0.48550827 -0.019511971 -0.48343942 0.19273652 0.31021804 0.55211979 -0.32646765 0.11806431 -0.40383002 -0.36056214 -0.14807346 -0.36711110 0.39471258 -0.66563837 0.00023669811 -0.34414368 0.29264842 0.26996162 0.061295132 -0.097898501 0.054793210 0.34217414 -0.021377494 -0.18664832 -0.073771376 0.15649133 -0.10756813 0.15809097 0.11685817 0.70424822 -0.032410086 0.099593918 -0.12586430 0.28750859 0.55526249 0.16035716 0.037636347 0.99289668 -0.59502353 0.34458857 -0.51398545 -0.097358688 -0.27608475 0.045422736 0.53248155 0.25038678 0.020437057 -0.88803935 -0.44555314 0.032690320 -0.67453815 0.21905975 -0.052402043 -0.48691452 -0.38949084 -0.19647625 0.19974889 0.27911930 0.066852638 0.092622831 0.0094754755 -0.072675511 0.24783998 0.25318874 0.42509829 -0.20683847 0.18728071 -0.048142150 -0.42451497 -0.28349715 -0.20841250 0.14939652 0.062254677 -0.12035567 -0.10225692 -0.13658221 -0.54083995 -0.26526508 -0.81430322 0.59191109 0.35709797 0.24574713 -0.19816610 0.92156417 -0.30971633 0.31287732 0.34348245 0.20491882 0.32197795 -0.039548166 -0.14936658 -0.66260774 0.55406147 -0.13949821 0.31055931 0.13130508 0.16762258 0.037975184 0.13911912 -0.070004927 -0.023236760 -0.35917118 0.43766322 0.022100690 -0.24978662 -0.38139904 -0.11131912 0.10435283 -0.030957727 0.051483363 -0.90032885 0.14673118 0.63034427 -0.26300222 0.27610261 -0.031949462 0.18958905 -0.21857975 -0.037664378 0.096106579 0.25370134 0.27992645 0.72172607 -0.13507480 0.49291158 -0.14784016 -0.19642314 -1.2518038 1.0256249 -0.0074590955 0.50596102 -1.8154856 0.29364020 0.074301129 -0.48561912 0.13978382 -1.0531730 1.0590836 -0.11778238 -0.0062380841 0.027523959 -0.023601520 0.39790640 0.21781026 0.32801227 -0.021469681 -0.047730438 -0.70042220 -0.90461117 -1.0251354 -0.84324901 0.21232275 0.13562663 -0.13014892 0.60189160 -0.0051007308 -0.056676138 -0.28432785 -0.10100292 -0.0055319758 0.10342352 0.24184819 0.44313083 -0.11905695 0.58135731 -0.19854930 0.21770468 0.16589777 -0.0070445742 0.073999718 -0.30757702 -0.0066470109 0.10480587 -1.2658492 -0.030191892 -0.24020397 0.19294544 -0.16353336 0.48917481 0.41808290 -0.0075258960 0.039751588 0.056437334 -0.37236851 -0.062710039 0.54271194 -0.27829445 -0.33819936 -0.074701326 0.10756666 -0.27550824 -0.92766082 -0.32863123 -0.60845440 0.87652858 0.46547359 -0.34009246 -0.46073353 -0.27015917 0.18729968 0.22208030 -0.35339659 -0.18319406 -0.32639358 -0.55111959 -1.3431610 0.62530584 -0.16217172 0.15228299 -0.14260974 -0.17891745 0.28486439 -0.050367568 -0.44081115 -0.56667822 0.24076223 -0.65189912 0.58480435 0.67475641 0.33303209 0.17802735 -0.13649653 0.16002621 0.16283967 0.35545642 0.68151113 -0.70023986 -0.22446116 -0.20859957 0.13236778 0.49154413 0.26759551 0.039322480 0.45827136 0.19287509 0.20304328 0.16411250 -0.92131726 -0.13317751 0.22598880 -0.53207249 0.21673610 0.45151176 -0.045710267 -0.093851827 0.38738578 -0.21646232 0.088515138 0.29223965 0.26458006 0.16060929 0.93261382 1.4946375 0.032978508 0.23879778 0.51940700 0.26120297 0.23934562 0.85129471 0.15401273 0.27964581 -0.98608742 -0.0059880831 0.051574667 -0.064960357 -0.15321458 0.0085730892 0.64139838 0.40786613 0.54558904 -0.069788164 0.39212621 -0.49041764 -0.14896454 -0.25846733 0.48815674 -0.055935513 -1.9070378 -0.21184585 1.3463268 0.48499478 -0.045734526 0.53888410 -0.41909580 0.27329932 -0.16997725 0.039862743 -0.041088507 0.53414967 0.32652019 0.093751313 0.35299225 -0.10054662 0.023410177 -0.26782670 0.25222108 -0.016463496 0.11239659 0.63464816 0.16579762 0.10420486 -0.66647361 -0.74625531 0.40780749 0.15717657 -0.12037339 -0.11027385 0.46981478 0.52004486 -0.47312311 0.68861017 -0.038540308 -0.26951423 0.48909531 -0.24773120 0.0037198511 0.52241194 0.064516278 0.47351310 -0.25356220 -0.10742854 0.67132555 0.11714174 0.024832182 0.32207186 1.6849669 -1.3436495 -0.40886088 -0.085095190 -0.0084144287 0.59894282 -0.33371047 0.24906791 -0.13328370 0.25378924 0.14402931 0.016531327 0.29185102 -0.43120963 0.11683753 -1.3595708 -1.7589044 -1.4326087 0.33464804 -0.73772964 -0.72384239 0.87126265 -0.21169256 0.45445570 0.49993864 -0.36718881 -0.060818840 0.22378474 -0.12430518 0.061008236 -0.079458838 -0.10678811 0.16162075 0.27872245 0.20060801 0.26898498 -0.017983232 0.59522095 -0.23409022 0.059156279 -0.11826911 -0.45852609 -0.99920152 0.19193986 0.49430203 -0.46372433 1.1057194 -0.63475316 -0.23604428 0.24508451 0.31766867 0.40506468 -0.14969537 -0.32919562 -0.34426836 -1.1440054 -1.9092993 -0.42737628 0.60906904 -0.42082868 -0.026268614 -0.28416137 0.12092831 0.041016137 0.12954534 0.095257082 0.12730118 -0.039726847 0.16402311 0.67780518 -0.33423197 -0.48067947 0.42945870 0.45226801 -0.14398851 0.19773892 -0.64636126 -0.044869148 0.27324035 0.061495029 0.0076432147 -0.69468109 -0.22198843 0.11811466 -0.17501011 -0.55329332 -0.10798383 0.43166782 -0.57357819 0.014397862 0.42269456 0.0075799890 0.16899445 -0.17710482 0.54119000 -0.22899428 0.56389417 -0.34251930 -0.040724583 -0.36356199 -0.17636623 0.75445794 -0.11043550 -0.095986988 -0.36717822 -0.14356457 -0.76488762 -1.0011545 -0.48012968 -0.62893075 0.28917272 -0.16165925 -0.39231648 -0.83581567 -0.015994723 0.071540648 0.066618327 -0.55376222 -0.68583902 0.40005364 -0.15954682 0.16480140 -0.25098135 -0.72594741 0.25616352 0.80132813 0.36196096 -0.34458284 -0.041168198 -0.17288137 -0.38810670 0.11872497 -0.35898033 -1.5387543 -0.30269375 -1.7181020 -0.66032992 -1.9329369 2.2026371 -1.7583441 0.69985611 0.53450404 -1.6593104 -0.41727876 1.0677418 0.81076422 -0.29574525 -0.32125173 -0.0048055467 -0.54689039 0.48332433 -0.56965677 1.0973120 -0.62880162 0.61026222 -0.55334815 -0.037946383 0.57325635 -0.71948202 -1.4446255 -0.96816642 -2.0483947 0.12087677 1.9243456 0.20077025 -0.49447095 1.2299179 0.57561504 1.3869931 -0.99847310 -0.22302539 -1.0967430 0.50902904 1.3838942 0.71691132 0.32280702 1.3937403 -0.88734166 1.3238045 0.16300000 -0.63642291 1.7141776 0.15784907 -0.77420774 0.96990963 -1.1084828 -1.6232632 0.33949956 -0.18081869 0.47636405 0.77001192 -1.5517049 -0.34273526 -0.15067097 -1.2602072 -0.17943211 -0.011392951 1.2194488 0.25900688 -0.64311581 0.21876329 0.47883925 -0.52370434 1.1767838 -0.38241937 -0.85649642 0.055534681 0.041070973 0.23530043 0.076188535 -0.037089999 0.50186514 0.47294481 0.10274784 -0.26276652 0.64260425 -0.032101018 0.20490306 0.10530712 -0.80700537 -0.73889499 -0.66181704 0.22488261 -0.51669418 0.30226881 0.74538857 -0.16880884 -0.33264876 -0.46033010 0.26866375 0.010712208 0.28718040 0.24729437 -0.24476544 -0.16381965 -0.080000278 0.27519617 -0.13101542 -0.013307922 0.13198281 -0.37508672 0.034884745 -0.43818568 -0.16231046 -0.15435406 -0.63156226 -0.18274882 -1.6952278 -0.61964325 0.62264652 -0.034002152 -0.91524781 -1.0359952 -0.34795673 -0.10914503 0.33944617 0.55111706 -1.6015700 -0.29160142 0.87921002 -1.4610010 -0.48737002 -1.3664948 1.8575414 -1.0915738 -1.2350623 0.39245497 -0.81162188 1.3047342 0.0012476037 -0.23148225 0.69814297 -0.30384023 0.29896194 -0.26358674 -0.25075479 -0.53272681 -0.89015142 0.59069267 -0.45852850 -0.068603333 -0.42340313 0.16754892 0.66913821 -0.061216839 0.13441918 0.88497777 -0.12732795 -0.85573794 0.54759750 -0.089839458 -0.56553501 -0.34417791 -0.99738312 -1.2902170 -0.53361413 0.47903396 -0.21589748 0.10432799 0.17767167 -1.0653125 -0.52623921 0.46109702 0.059819027 -0.97329045 -0.34816101 -0.74341747 0.66205626 -1.2917921 0.28211410 -0.0049101225 -0.81869976 -0.23248206 0.36167830 -0.099500748 -0.63187120 0.28027146 1.0543197 -0.53084055 -0.083880528 0.73814060 0.11025417 0.46354469 -0.43143869 -0.79839760 1.7476059 1.3154533 -0.84222354 0.69122102 0.77651286 -0.30025950 0.19183025 -0.67460426 -1.2870509 -0.59787140 -0.063388354 0.044709640 0.0012283533 -1.3163588 0.50308691 0.47106380 -0.63363614 -0.087145886 -0.089512682 0.0055073884 -0.92718181 0.34148231 0.45297612 -0.22102676 0.69936656 0.19758564 0.18072822 0.60457093 -0.46912012 0.68049731 0.11892151 0.44086759 -0.62223043 -0.29227640 0.029765364 -0.50794517 -0.67079355 0.0081113296 0.68030821 0.036995574 -0.010183923 -0.60026783 -0.29804433 -0.084147566 0.068308701 -0.074882007 -0.21140379 -0.88675097 -0.83812093 -0.68921489 0.74261247 -0.036874431 0.34567052 0.79410049 -0.65703985 -0.80709885 0.45163277 -0.13729525 -1.2951011 0.083333584 0.74277869 -0.23966777 -0.58020607 0.57105798 0.81154921 0.75399912 0.16360697 -1.2954205 -0.093363883 -0.34169478 0.65028276 -0.24425735 0.026419667 0.90029371 0.58941799 -0.45206348 0.33599714 0.91952956 -0.92667427 -0.13337503 0.55422496 0.77784021 0.72317738 0.014539793 1.1227268 0.41392541 1.3644026 -0.088415105 0.63956417 -0.62931381 -0.69214478 -0.58833889 0.41963453 1.0271964 -0.53996264 -0.33171847 0.54121173 -0.16252216 0.16041167 -0.21041771 -0.27803932 -0.58370525 -0.43967229 0.61271096 -0.20114344 0.49385040 1.1261192 -0.19270744 0.41425353 -0.073993775 -0.63182457 -0.073432725 -0.091181348 0.30193471 0.33904150 0.090391801 0.21350008 0.086042818 -0.25529051 0.21470276 0.31328280 0.0072310504 -0.046784534 0.020965925 0.41403294 -0.14484652 0.44706223 0.0096852417 -0.67257436 0.56419759 0.083279051 -0.17007518 -0.046175713 0.12442409 -0.18564846 0.023746171 -0.16013772 -0.64787915 -0.65140718 0.54903867 0.51572664 -0.057794622 -0.41813526 -0.26436501 0.098072094 0.26229894 0.49339321 0.073888517 0.20941524 -0.070597231 -0.036615233 -0.49486452 -0.74352548 -0.51577877 0.60112042 0.0044242136 -0.13617491 -0.75127414 0.70197861 0.36402374 0.15725591 0.044274715 0.16877189 0.35747790 0.12362632 -0.33709888 0.047392150 0.15581193 -0.061993794 0.23592380 0.19538369 0.22483210 -0.30750587 -0.23760047 -0.38581686 0.19850766 0.022313199 -0.38802796 0.22139770 -0.030165454 0.010571483 -0.43827109 0.27111745 -0.23390655 0.31985407 -0.13068953 -0.10620222 0.14374604 0.23854070 0.31337625 0.23607670 -0.089769920 -0.085530431 -0.27244384 -0.14920350 -0.074956447 -0.14611695 0.18446530 -0.38403565 -0.35188235 0.20535028 0.22099135 0.19580603 0.36161745 -0.099198534 -0.056151660 0.094576855 -0.075961413 0.091330930 -0.19519084 0.22265535 0.047650457 0.12264870 0.024470732 0.24450283 0.16022187 0.0043173099 -0.095831484 0.018083739 -0.58211332 0.28678745 0.39887589 -0.018172794 0.073354242 -0.13468094 -0.11052771 0.16453441 0.017492364 -0.066471465 0.029415340 -0.054941197 0.15271050 0.0073522032 0.082793128 -0.062715328 -0.059153636 -0.31996178 0.22293325 -0.16387740 0.38306449 -0.16913126 0.089965171 -0.067427266 0.040429396 -0.30312323 -0.20032715 -0.13428018 0.078719145 0.32591404 -0.030821576 -0.085773783 -0.18606194 -0.35438786 0.22578247 0.013407437 0.37585052 0.015007173 -0.17540028 0.30131203 -0.082831011 -0.081851569 0.20001840 0.024097214 -0.072796704 0.073842573 0.070395135 -0.018777720 0.069821176 0.061423147 -0.020893536 -0.052590839 -0.043456325 0.057421530 0.012977740 -0.031968389 -0.039969550 -0.24419402 -0.22491845 0.16584131 -0.29677779 0.31426843 -0.12286349 0.050426424 -0.59549579 -0.093655677 -0.13745306 0.27843447 0.47186440 -0.094124677 -0.068139409 0.24864833 -0.074200082 -0.082362808 0.12614856 -0.095607677 -0.12030777 0.22044569 -0.087478261 -0.015125020 0.044643603 -0.028727604 -0.22507157 -0.30284354 0.23876475 -0.18020109 -0.0048467449 -0.061969361 0.25755458 0.30152044 -0.023668590 0.0088187731 -0.15052702 -0.092635874 -0.016811653 0.022689796 0.10423527 0.051192770 0.14924583 0.067086506 -0.14579295 0.11864588 0.13476134 0.0055559190 0.064990697 0.0085974735 0.032894377 -0.12160815 0.20629776 0.0030969889 0.11728516 0.063460681 1.0649825 1.0901535 0.35251991 0.071864897 -0.14077588 0.22766654 0.065116525 0.12811955 0.19896629 -0.13056358 0.11340243 0.024932050 0.42886583 -0.022533157 -0.99566731 0.31691871 0.62515201 0.11228608 0.35843329 0.34765289 0.18473571 -0.037104219 0.17976147 -0.33812909 -0.25633196 0.012166436 -0.15811690 0.41419081 0.59348113 -0.058246228 0.11484923 0.11111604 0.065276519 -0.18034443 -0.25051214 0.0034858863 -0.18915866 0.23192009 -0.17029715 -0.17107071 -0.15062492 0.16081260 0.82483652 0.082485320 0.015036725 0.41296011 0.36315597 -0.28844029 -0.32626922 0.048448505 0.16715690 0.17050149 -0.14523047 0.15229076 0.27974211 -0.11388417 -1.2290840 -1.3938675 -0.044794861 0.018206982 0.71496273 -0.031161109 0.041198367 0.55761955 -0.33780714 -0.21231649 0.19698786 0.11655491 0.14355630 -0.18605419 0.25972226 -0.21336583 -0.76768701 0.13011785 0.058248449 -0.12693288 -0.51571720 -0.43527763 0.43164714 0.91582976 -0.11732487 -0.094976486 0.25109765 -0.38896667 0.15687216 0.12226043 -0.047279116 0.52862885 0.24810306 0.53801731 0.59751577 -0.50009284 0.67677479 0.094653334 -0.042569076 0.83185505 -0.14936997 -0.015937170 -0.092850662 -0.17615221 0.34765078 0.046116250 -0.12303988 0.77034584 0.17305624 -0.34172169 -0.27741842 -0.12397146 0.30957176 0.14932626 -0.85028946 0.60758125 0.11656129 -0.51737547 -0.71228302 -0.94997639 -0.36950350 0.20888615 -0.013847941 0.076180353 -0.93441294 -0.063151053 0.69872951 -0.12399792 -0.13618424 -0.058784594 -0.15466459 0.18257093 -0.0046272182 0.37207635 -0.069309309 -0.28205448 0.21397703 -0.067304807 -0.11037454 -0.20290631 0.20271823 0.31866365 0.59047517 0.058860316 -0.0025978153 -0.21025839 -0.26376145 0.12599833 -0.072394071 0.34909905 0.22418332 0.17643959 0.16567884 -0.068436536 -0.0066373890 -0.16333923 -0.43266375 0.059119528 0.54607475 -1.1065877 -0.44924147 0.32572367 -0.13431929 -0.027913751 0.22854043 0.080782681 0.37971766 -0.024283030 -0.050541977 0.28719072 0.10029252 0.056841399 -0.34905720 -0.099291838 -0.078615792 0.0059275699 0.050508866 -0.20518625 0.15858116 -0.068618084 0.12205169 -0.18328275 0.050308042 -0.26201762 1.3597612 0.18838517 0.37803319 0.14630489 -0.050827069 0.34139758 0.17853064 0.26585249 0.011895612 -0.81296124 -0.23254114 -0.27384145 -0.41270155 0.0088856205 0.61369688 0.31016233 0.048556086 -0.33215196 -0.098850241 0.11932809 0.020695697 -0.089812356 0.73608398 -0.16380298 0.38236090 -0.035503197 0.011826573 0.055497548 0.061274994 0.40112838 0.49086337 -0.12590845 0.33942952 0.14275459 0.21769807 -0.030182753 -0.53608544 0.22039577 -0.58471574 0.39257114 0.33166301 0.063176172 0.12853374 0.16375801 -0.38779721 0.086654227 0.22331191 -0.46695253 -0.37919323 0.19884600 0.097478187 -0.023672794 0.38138580 0.0043006647 -0.42368744 0.11163117 -0.12392167 -0.26221555 0.056810503 -1.3068128 -0.34938889 0.28343309 -0.96817739 0.12471879 -0.00052013921 -0.60136231 0.36478866 0.40384735 0.24570777 -0.19107098 0.13385287 0.17175698 0.15050242 -0.23701207 0.50479709 0.076601247 -0.16184668 0.090708659 0.023977067 0.28237713 -0.17235811 -0.42882711 -0.40818246 -0.14529502 0.31318745 -0.71234141 0.34133465 -0.014568528 -0.095853909 0.033446299 -0.013741116 0.52647584 -0.33820797 -0.31565963 0.19290163 -0.31960183 0.31828097 0.022531434 -0.097262766 -0.11083211 -0.15139781 0.068207191 -0.055968890 -0.038027810 0.067513735 0.071079203 0.20816573 -0.10467097 0.0067261560 0.094189752 -0.039556703 0.14449457 0.026493527 -0.069201671 -0.14013154 0.46967647 -0.32377270 -0.35409824 -0.16611013 -0.36726253 -0.19330059 -0.089523140 -0.76308865 0.015436704 -0.10358408 -0.46517575 0.16628866 -0.35216170 0.15733922 0.072336272 -0.0022480648 -1.1813299 0.12568188 -0.15495902 -0.18340137 -0.23112887 0.38961767 -0.58164377 -0.058915819 -0.40757867 -0.21232604 0.37176887 0.96326549 -0.76418521 -0.73330100 0.20060828 0.67506290 -0.0027662710 0.31139526 -0.041509402 -0.64836166 0.34485946 0.066318384 -0.22620541 0.53134886 0.29180585 0.37096181 -0.17777345 0.29228493 0.12958675 -0.069124381 -0.35282433 0.45665057 0.34025106 0.23313525 -0.16095304 -0.26693667 -0.74821635 -0.39483822 0.15821487 0.063180922 0.37165147 -0.21498286 0.20703327 -0.11806604 0.029853657 -0.40584035 -0.037725023 0.15562062 0.013269925 0.36989274 0.23785087 -0.78259281 0.28188121 0.092096068 -0.030432578 0.034379200 0.092854805 0.23682720 -0.31644373 -0.26309221 -0.10419409 0.18335429 -0.023642071 0.17763543 -0.00097496934 -0.0073276634 -0.059901925 0.0025363313 -0.14576128 -0.097493854 0.070412377 0.13580779 0.021028984 -0.14434669 -0.16610255 -0.82716293 -0.062518033 0.034957727 -0.21261127 0.086698698 -0.56315935 -0.15433565 1.2426243 -2.1416121 -0.90824557 0.61872055 -0.12559515 -0.25418312 -1.2885513 0.51667223 -0.26338733 0.72591745 -0.31107456 0.17904721 -0.31471636 0.65831814 -0.022210781 -1.5541223 -0.98631871 0.41186979 0.22831276 -0.34468491 -0.12992219 0.81240998 0.17748837 0.13193233 0.15380984 0.25279515 -0.11398962 0.17655796 -0.68721837 -0.43213480 -0.25553502 -0.86129805 -0.52903307 -0.62794513 -0.95328800 -0.85465624 0.75499206 -0.89898273 0.75571567 -0.51427515 -0.22509881 0.31268070 0.15434125 -0.50198882 0.35109661 0.24267431 0.26850472 -1.2750150 0.22173647 0.042788960 -0.70742979 0.63279315 0.48687452 -0.17110760 -0.53116682 -0.69640273 -0.98012189 0.0049231151 0.36176415 1.0102527 -0.024881731 -0.24031995 0.28229698 0.43794799 0.27951245 0.16194121 0.27415989 0.64613565 0.35309029 -0.96821172 -0.014524750 0.72947086 0.077021415 -0.51896012 -0.24284626 -0.074462373 0.58988246 -0.19222924 0.57859955 0.29739552 -0.11285208 -0.011915358 0.41450327 -0.69504690 -0.11576382 -0.032260529 0.22172859 0.58320925 0.015613405 -0.097491545 0.21946868 0.44652488 -0.13652487 0.16761756 0.066909723 0.25035716 0.045641824 -0.057684845 -0.49571329 -0.018226480 0.27580416 -0.028900536 -2.1442953 0.20960978 -0.25179384 0.32208323 -1.4559132 -0.57911723 -0.15058461 0.20323364 0.069866994 0.17431404 -1.3456223 0.44183801 -0.50826175 0.56062670 0.15926672 0.91662561 0.21556915 0.61978289 -0.36922801 0.30017694 -0.48313865 0.27880414 0.33686940 0.30770182 -0.58478099 -0.24460223 -0.29700880 -0.49658703 0.097624595 -0.60824830 0.36358350 0.24223013 0.34775721 0.48263421 -0.13961266 -0.52045318 -0.60117154 0.13623495 0.13176180 0.54477301 -0.012555017 0.19819097 -0.035139996 -0.32846229 -0.43704831 -0.074470731 0.62263343 0.31772759 -0.26725805 0.37736601 0.68231551 0.54250255 0.55072135 -0.0012899723 0.63856185 -0.41861611 0.88346333 -0.37564749 0.010537189 0.040710063 -0.050674979 0.45560861 -0.065250624 -0.21915581 0.96936855 0.45292478 -0.15946400 -0.19600524 -0.36219955 0.62079323 0.28967244 0.085002308 0.22786120 0.23831588 -0.36911349 -0.25462634 0.61928002 -0.15014319 0.98657590 0.21986031 0.18769468 0.11639493 0.96175829 0.20032054 -0.43909919 -0.47813701 0.46505483 0.23510285 0.25819313 0.29756295 -0.51914621 -0.019849770 -0.10023663 -0.46414908 -0.86622100 -0.0041442045 0.66422582 0.53583275 -0.53703705 -0.092708097 0.26540778 -0.089553415 -0.26542614 0.37965120 0.69794950 -0.026780305 0.074567498 -0.40054062 -0.035933634 -0.15012181 -0.044638998 0.16150880 0.59288980 0.32036546 -0.20822671 0.90866813 0.16839645 -0.20041000 0.26199403 -0.53334936 -1.3768541 -0.11167187 -0.11491080 0.31947025 -0.23922645 -0.25963126 -0.48878500 -0.11849919 0.38383045 0.37015208 -0.069127205 0.13869340 0.27390344 0.048896966 -0.92912351 -1.2726453 0.96512511 0.46230123 -0.85506560 0.30873159 -0.12173307 0.21137185 -0.14528951 -0.67839476 0.88593526 3.1725953 -0.67376624 -0.22371274 0.29923029 -0.34471153 -1.0137448 -0.47542343 0.33653394 -0.24095461 -0.60413939 0.15781654 0.22060943 -0.11434230 0.040178226 0.40598402 -0.35190380 0.29496243 -0.30714508 -0.37776107 -0.45395821 0.12539634 0.051015168 -0.24358929 -0.0079971714 -0.0070254365 -0.70294567 -0.033805484 -0.21339066 -0.26801123 0.087264482 0.16861436 0.34077049 0.14721673 0.25786487 0.40122522 -0.030759002 -0.31972631 0.071275401 -0.35167297 -0.38929010 -0.15925463 -0.11812441 -0.17386782 -0.27914742 -0.43796390 -0.14367945 0.20271178 0.21971322 -0.086711585 -0.054726709 -0.10657795 -0.37305719 0.12809395 0.42249560 0.39311775 -0.35330155 0.099991607 0.34896085 0.50993154 0.10520281 0.31726268 0.14642290 0.034761816 -0.18296476 0.16837352 0.50866035 0.044694222 0.078159836 -0.58792675 -0.10192840 -0.049069937 -0.33740887 0.074227856 -0.13526004 0.23256717 0.20029232 0.26892333 -0.10785662 -0.081547967 -0.43747728 -0.41621290 0.12439148 -0.065886368 -0.0049661123 -0.086293865 -0.036974152 0.011343409 0.17444820 0.079020896 0.26490385 -0.024021897 -0.064117773 0.094499078 0.26922083 -0.022916393 0.28133618 0.054227033 -0.32429002 -0.080311015 0.044975006 -0.0019844098 -0.15202083 0.014670564 0.094978633 0.33204208 -0.039803897 -0.17010059 0.061894413 0.065357387 0.15238561 -0.16570928 -0.084640729 0.32728162 0.085820038 0.14874899 0.33912315 0.13086182 0.28650537 0.67853050 -0.25681462 -0.0069824305 -0.053496418 0.22035141 0.15743799 0.048310248 0.022047325 0.16950848 0.20953280 0.032868811 -0.38704911 -0.16080244 0.089271980 0.47287780 -0.10236386 -0.25069357 -0.58292613 -0.32233674 -0.070837508 0.39383066 -0.26181641 1.4811668 -1.6860155 0.051612444 0.098816366 0.65596130 -0.32725214 0.043973657 0.033495983 -0.54133922 0.15590300 0.21162695 0.21333692 0.010689535 -0.025886972 -0.14495915 -0.30635030 -0.056093926 -0.23203763 0.35961149 0.28409471 -0.32570301 -0.079954316 -0.12672931 0.0012489989 -0.35690063 -0.020451271 0.065083868 -0.37839538 -0.35136326 -0.051599101 -0.021993262 0.25536446 0.19214565 -0.070598314 -0.16864407 -0.13111109 0.14186612 0.37835063 0.047411431 0.033893545 -0.068636296 0.16646505 0.15898367 0.059550677 -0.14438079 -0.075639352 0.0033672675 0.12174854 0.11891677 0.26900473 -0.11093005 -0.039372351 0.058102957 0.15229478 -0.10900206 -0.38713536 -0.15295871 -0.082695710 -0.029625191 0.090074410 0.010452678 0.069739789 -0.093251280 -0.017732264 -0.23655044 -0.034983749 -0.17002438 0.016426966 0.052958898 -0.029514737 0.18763845 0.015139569 -0.29293439 1.2707298 -0.23297240 -0.37499739 -0.40794682 -0.074731194 0.26258901 0.24105923 -0.32266761 0.033558306 0.10982233 0.081008863 0.034121968 0.11507481 -0.092049253 0.013566148 -0.25673186 -0.23790422 -0.21121516 0.063940406 -0.24206435 -0.24860957 0.21162251 -0.086003994 0.33246830 -0.26657320 -0.14846622 0.12203775 0.0049115893 0.0066865963 -0.062601147 0.051684277 -0.099798790 0.061458840 0.094901071 -0.15705940 -0.39280021 -0.11847507 0.32025702 0.19703510 0.22243539 -0.33984553 0.023004346 0.037814246 -0.34310428 0.10457415 0.20726179 -0.029802878 0.12185579 -0.12165353 0.068515102 0.14274555 -0.081306083 -0.30404799 0.11505681 -0.026650895 -0.057851002 0.015842570 -0.00086317491 -0.040089442 -0.14245996 0.00061551866 -0.043456488 -0.24862490 -0.16866043 -0.31331052 -0.018387650 -0.86490434 0.30524653 -0.20727790 -0.0051021501 0.069847199 0.49236143 -0.46739352 -0.0022668899 -0.17188430 -0.065279491 0.050274314 -0.30736890 0.089090533 0.46275788 -0.24433180 0.40894484 0.50469084 -0.31917489 -0.052601438 0.11973006 -0.47823610 -0.40853965 -0.030467691 -0.11754582 -0.23127105 0.52804687 fGarch/data/sp500dge.csv0000644000176200001440000056366013202277106014441 0ustar liggesusersSP500 0 -0.0022548 -0.00964 0.0062482 0.0011319 -0.0102332 -0.0074563 -0.0011521 0.0068926 0.0062768 -0.0079955 -0.0086381 0.0005782 -0.0023148 0.0069284 0.0057373 0.0028563 0.0062554 0.0039604 -0.0107864 0.0062589 0.0033975 -0.0062376 -0.0051326 0.0045636 -0.0022792 0.0056883 -0.0131318 0.0017227 0.0011468 -0.0005732 0.0028629 0.0034247 -0.00057 -0.0005703 -0.0051473 -0.0022962 -0.0028777 -0.018029 -0.0029386 -0.0023571 0.0093953 0.0011682 0.0029146 0.0005819 -0.0046647 0.002918 0.0058106 0.0023148 0 0.0069125 0.0085739 0.0056754 -0.0051064 0.0034072 0.0163062 -0.003352 0.0072484 -0.0044544 0.0005579 0.0077778 0.0104598 0.0032805 0.002181 0.0054318 0.0102399 -0.0026846 0.0096309 0.0005323 0.0137423 -0.005791 -0.0026434 0.0031713 0.0172644 -0.0078105 -0.0115669 0.0058002 -0.0015785 0.012559 0.0020779 -0.0088611 0.0176445 -0.0015444 0.0163519 -0.0071211 0.0045837 -0.0081633 0 0.0056194 -0.0148835 -0.0098728 0.0052083 0.0041472 0.0072165 0.0107281 0.0035506 0 0.0015178 0.0025246 0.0050302 0.0154347 0.0083641 -0.006883 -0.0014811 -0.0014833 0.0073947 0.0039216 -0.0024492 -0.0168154 0.0034852 -0.0099901 -0.0146652 -0.0138499 0.0199444 0.0060576 0.0015087 -0.016722 0.0126937 0.0090407 0.0034939 0.0074461 -0.0209903 0.0025221 -0.0096179 -0.0025465 -0.0123142 -0.0129906 -0.0232815 -0.018369 0.0295482 0.0084344 -0.0164068 0.0005335 -0.0188431 -0.0032662 0.0124629 -0.0005386 -0.0010782 -0.0043243 0.0005416 0.0113056 0.0095898 0.0110731 0.003664 0.0026089 -0.0110035 0.016201 0.0098015 -0.0046308 0.0025753 0.0010283 -0.0015428 -0.0250143 -0.0074153 0.0079429 -0.0015835 -0.0122244 0.0053333 0.0121598 -0.0021042 0.0021042 -0.0036852 0.0084034 -0.0015703 0.0057456 0.0020812 0.009312 0.0025714 0 -0.0020566 -0.0005148 -0.0046452 0.0015508 0.0025793 0.0087202 -0.0046071 -0.0123905 0.002594 -0.002594 0.002594 -0.0005183 -0.008329 0.017617 0.0071648 0.0015287 0.0035578 0.0030395 0.0125661 -0.0009995 0.0009995 0.0158576 0.0053935 -0.0034289 0.0078202 0.0019455 0.0014567 0.0125363 0 0.0047801 0.0047574 -0.006189 0.0071378 -0.002849 -0.0052444 0.0076191 0.0037879 -0.0009456 0 0.0042483 0.0046993 -0.0070572 0 0.0018868 0.0065759 -0.0056338 0.0089056 -0.0009337 -0.0004672 -0.0126971 0.0004731 0.0108211 -0.0004681 -0.0046926 -0.003298 0.003298 -0.0018832 -0.002359 -0.0028382 0.0033105 0.0108008 0.0046598 0.0055633 0.0009242 0.003228 0.0032177 0.002292 0.0054795 -0.0054795 -0.0013746 0.0063986 0.0018207 -0.0036447 -0.0119377 0.0101104 0.0059266 -0.010969 -0.0036832 0.0141976 -0.0018207 0.0009107 0.0122146 0.0116228 -0.0049009 0.0071206 0.0079506 0.0048277 0.0030601 0 0.0052242 0.0146554 0 0 0.0085216 -0.0149607 0.0128371 0.0076239 0.0042105 0.0046112 0.0116425 0.0037136 -0.0103499 -0.0075188 0.0025126 -0.0041911 -0.0385322 -0.0242998 -0.0198742 0.0176355 0.0190905 -0.0097217 -0.0017778 0.0022217 -0.000444 -0.0035587 0.0115198 0.0122593 0.0039088 0.011207 0 0.008961 -0.0042571 0.0084962 0.01428 0.0029148 0.0123969 0.0187149 0.0020133 -0.0004023 -0.0113316 -0.0131096 -0.0033044 0.0151922 0.0016287 -0.0016287 -0.0028566 0.004892 -0.0147483 0.0135276 0.0052792 0.0032349 0.004431 -0.0008042 0.0084118 0.0059654 -0.0063644 0.0166209 -0.0019643 -0.0031508 0.0003944 0.0035426 0.0113305 0.0038775 -0.0015492 -0.0062209 0.0023374 -0.0082048 -0.0310782 -0.0109869 0.0218544 -0.0012017 -0.0040161 -0.0203259 -0.0123969 0.0140382 -0.0004101 0.0085767 0.0109202 0.0020092 0.0016045 0.0119523 0.0133755 0.009335 -0.0023256 -0.0109248 -0.0066916 -0.0159239 0.0091872 0.0063417 0 -0.0143258 0.0008013 0.0107549 0.0192276 0.0135111 0.0019153 -0.0034503 -0.0003841 -0.0003842 -0.0046225 -0.0136057 -0.0133966 -0.0281595 -0.0065493 0.0299375 0.0173849 -0.02579 0.0115885 -0.0123927 0.0175443 -0.0099306 0.0007981 -0.0096193 -0.0080874 0.0060717 0.0112361 0.0035849 0.0007949 -0.006777 0.0023971 0.0103216 0.004335 -0.0007868 0.0015729 0.0097752 0.0058196 -0.003876 -0.0046711 -0.0019527 0.0027328 -0.0046893 0.0159319 0.0019257 0.0046065 0.0099086 0.0041627 -0.0060606 -0.0095439 0.0042105 -0.0061303 0.0122232 -0.0038037 -0.0231313 0.012018 -0.0042479 0.0050183 0.0046101 -0.0015343 -0.0256624 0.0121356 -0.0372615 0.0219701 -0.0075352 -0.0035892 -0.0337225 0.0159872 0.0012193 0.0084935 0.0036181 0.0139472 0.0145357 -0.001952 0.001952 -0.0042994 -0.0054988 -0.0047375 0.0063117 0.0007862 0.0152079 0.0034769 0.0046172 0.013725 0.0003786 -0.0037922 0.0056829 0.0056508 0.0037495 -0.0037495 0.0104635 0.0059303 0.001846 0.0110052 0.0076322 0.0054162 0.0103888 0.0042674 0.0049558 0.0014114 0.0003525 -0.0031774 -0.0028329 0.0021254 0.0109098 0.0024471 -0.0066562 0.0070053 0.0024403 -0.0020913 0.0034831 0.001737 -0.0132776 0.0139716 -0.0066122 0.0045288 -0.0038308 -0.0038455 -0.0130444 0.0112916 0.0132452 0.0069013 0.0163714 0.0084218 -0.0090986 -0.0037307 -0.010246 0.0116042 -0.0376881 0.0157318 0.0151466 0.0088436 0.0030431 0.0016866 0.0183675 0.0006616 0.0085611 0.0058843 -0.0042463 0.0078253 0.0096963 0.001928 -0.0025715 -0.0006439 -0.0019342 0.009634 0.0133335 0.0034629 -0.0031476 -0.0223152 0.0257771 0.0028235 -0.0078629 -0.018162 0.0137317 -0.0114834 0.0067147 0.002864 0.0123166 -0.0081942 0.0025284 0.001577 -0.0107732 0 -0.0003186 -0.0186561 0.0016221 0.0090352 -0.0280149 0.0056004 -0.009241 -0.0059861 0.0073114 -0.0422717 -0.0104168 0.045377 0.015227 -0.0032906 -0.0023099 0.0176822 -0.0016242 -0.0068505 -0.008217 -0.0356101 0.0152727 -0.029047 -0.0292017 -0.0100467 0.0192863 -0.06089 -0.0324766 0.0142667 -0.0069151 -0.1316607 -0.1071211 0.1180549 0.049225 -0.0540212 -0.1044868 0.0362117 -0.0089307 -0.0643497 -0.0585811 -0.0588243 0.0856893 0.0536294 -0.0103987 0.0299115 0.0271639 0.0158585 -0.0037089 -0.0116796 -0.0295682 0.0125062 0.001433 0.0328668 0.0183071 -0.0081968 0.0261748 0.012395 -0.0146247 0.0075606 -0.0084539 -0.0555826 0.0247272 0.0119104 -0.0291081 0.0107252 -0.0065147 -0.0269711 -0.0336535 0.0191605 -0.0142124 0.0063961 0.0218296 -0.0009602 -0.0077146 0.0110711 0.0264541 -0.0126673 0.0023579 0.011707 0.0009307 -0.0088765 -0.000939 0.0153813 -0.003243 -0.0046512 0.0032581 0.001857 0.0041657 -0.0069525 -0.0088765 0.0028116 0.0060649 0.0051032 0.0009251 0.0096619 0.0091158 0.0085837 -0.0009001 -0.004965 0.0112487 0.0053548 0.0141408 0.0061243 -0.0083206 0.0118034 0.0129535 -0.0107829 -0.0039105 0.0082376 -0.0017286 0.0086133 0.0017138 -0.0004282 -0.0094665 0.0056047 0.0008595 -0.0090616 -0.0188148 0.0122916 -0.0105264 0.0004408 0.0183411 -0.001299 0.0086282 0.0072759 -0.0038453 0.0076759 -0.0076759 0.0097977 0 0.0004238 0.0029617 0.0021102 -0.0110217 0.0059499 -0.0063762 -0.0055591 0.0148971 0.00967 0.0054246 0.0045672 0.0061945 -0.0103456 0.0099339 -0.0012363 0.0151425 -0.0020329 0.0113316 0.0080161 0.0035864 0.0091072 -0.0103012 0.0019893 0.0149904 0.0074118 -0.0050653 -0.0054838 0.0159754 0.0019309 -0.0030912 0.0019331 -0.0061992 0.0003886 -0.0070176 0.007406 -0.0180256 0.0082694 0.0019589 -0.0078586 -0.0011841 0.0019728 -0.0243379 -0.0012124 0.0068507 -0.0243915 -0.0305016 -0.0314613 0.0061109 0.0333792 -0.019121 0.0038536 0.012317 0.0184029 -0.0016591 0.0136057 0.0061237 -0.016414 0.0045408 0 -0.0220704 0.0046209 -0.005042 0.0021039 0.0100377 0.0066363 0.0016522 0.0004126 0.005759 0.0045017 -0.0036817 -0.0090573 0.0045389 -0.015768 -0.0164457 -0.0210534 -0.02863 0.0277612 -0.0358366 -0.0031581 0.0058572 -0.0208814 -0.0585625 0.0009723 -0.0356121 0.0457644 -0.0263173 -0.0290602 0.0211275 -0.0354647 0.0077062 0.0232686 -0.0095454 0.0045329 0.027752 -0.0108109 0.0108109 -0.010317 -0.0209589 0.0070352 0.0144174 0.0248611 -0.0106487 0.0183226 0.0203365 -0.0018744 0.0074767 0.0046447 0.0087659 -0.0092294 -0.0296423 0.0179844 0.0158216 -0.0130113 0.005597 0.00972 0.005054 -0.0078215 -0.0266807 0.006148 -0.0047259 0.0056684 0.0135675 0 -0.0159254 -0.0056818 -0.0382335 -0.0009872 0.0073801 -0.0258207 0.0134901 0.0004962 0.0264333 -0.0024184 -0.0053411 0.00969 0.0052897 -0.010123 0.0072412 0.0052771 -0.0105821 0.0144026 0.0075974 -0.0004731 0.0112942 0.0004678 -0.0098708 -0.0071107 0.0151089 0.0144222 -0.0009242 0.0059922 0.0045851 -0.006425 -0.0101806 -0.0013963 -0.0131272 0.0014148 0.0032933 -0.010862 -0.0182085 0.0024149 -0.0273856 0.0132974 -0.0162766 -0.0190769 -0.0153221 -0.0072314 -0.0225435 -0.0144195 0.0436797 -0.0124354 0.0124354 -0.0098319 -0.0327725 0.0005372 -0.0118856 -0.0404824 0.024596 -0.0268623 0.0157572 0.0160624 -0.0177388 -0.0411017 -0.0105449 0.0341567 -0.0300427 -0.0088366 0.0141013 0.0344071 -0.0056529 0.0079052 0.0044893 -0.0175096 -0.012038 -0.0233383 0.0088158 0.0023378 -0.0302245 0.0018034 -0.0342123 -0.012508 -0.0222726 0.0159595 0.0219238 0.0256895 0.0197316 0.0094285 -0.0340027 0.0108631 0.0207908 -0.0041237 0.0152317 -0.011696 0.0029369 -0.0117995 -0.0143457 -0.0139438 0.0115328 0.0137851 0.0094787 -0.0172469 -0.0151106 0.0006088 -0.0128639 -0.0155331 0.000626 -0.0157682 -0.0115091 -0.007747 -0.0282635 -0.004008 -0.03404 0.0453546 0.0072536 0.0111076 0 -0.0336999 0.0053619 0.0132804 -0.0206605 -0.006079 -0.0027137 0.0228351 0.0184216 0.0327057 0.0144068 -0.0093721 0.0124768 -0.0024829 0.0086634 -0.0099072 0.0055849 -0.0200007 -0.0120675 0.011436 -0.0236508 0.0122149 -0.0057674 -0.0064475 0.0204873 0 0.0182109 0.0215459 -0.0091772 0.0079584 -0.00489 -0.0185534 0.0093197 0.0012361 -0.0061958 0.0043411 0.0049383 0.0055266 -0.0067589 0.0030779 0.0146433 0.0268914 0.0157944 0.0028977 -0.0058038 -0.0011648 0.0104349 -0.0168658 0.0087592 0.0132835 0.0159366 0.0123458 0.0132966 -0.0110682 0.0110682 -0.0077348 -0.0055617 -0.0231322 -0.0011422 -0.0091849 0.0199835 -0.0211376 0.0183071 0.0067797 -0.0022548 -0.0113509 -0.0068729 -0.0046083 0.0097674 0.0158824 -0.0107497 0.0129982 0.0111671 0.0027724 -0.0094577 -0.0072932 0.006734 -0.0056085 -0.0135902 -0.0189934 -0.0217336 -0.0107464 0.0017991 -0.010238 -0.0042463 0.0132852 -0.0102503 -0.013423 0.013423 -0.0054695 0.0030423 0 0.0156724 -0.0126393 -0.0201903 -0.012438 -0.0157682 0.0101203 0.0043956 -0.0266682 -0.020807 0.0045887 0 -0.0224877 -0.0127905 -0.0061162 -0.0206619 0.0488896 -0.0295919 0.0115373 0.0160646 -0.008 0.0046745 -0.0040053 0.0322502 -0.0150084 -0.0013158 -0.009924 -0.00333 -0.0222606 -0.0151206 -0.0076469 -0.0347923 -0.0007228 -0.0058013 0.0101303 0.0035932 -0.0071995 -0.0323082 0.000746 -0.0112487 0.0037636 -0.022029 -0.0487902 -0.0162605 0.0727018 0.0322488 -0.0111318 -0.0257006 0.0375702 -0.0163572 0.0266288 0.0021874 0.0014556 -0.0014556 -0.00731 0.0021986 -0.0110417 -0.0179243 -0.003775 0.058754 0.0412213 -0.0137838 0.0461099 -0.006649 0.0237322 0.0097245 -0.0268078 -0.0173801 0.0160539 -0.0086638 0.0211928 -0.0105403 -0.0398567 -0.0096954 0.0083161 0.0096155 -0.0179315 -0.0097903 -0.0098871 -0.0207967 0.0243391 0.0091518 0 0.0132268 0.0110042 -0.0235305 0 -0.0219478 -0.0035855 0.0078712 0.0106346 -0.0315212 0.0043573 -0.0050854 0.0079797 0.0064818 -0.0064818 -0.0145563 -0.0066201 0.0044183 -0.0014706 -0.0029477 0.0319562 -0.0136742 0.0158163 0.0190751 0.0097494 -0.026687 0.0035524 0.0028329 0.0021194 -0.0221201 -0.003614 -0.0043541 -0.003643 0.016649 -0.0057596 0.0100576 0.007832 -0.0171678 0.0043197 -0.0188548 -0.0229555 -0.0045045 -0.0321129 -0.0085837 -0.0110324 0.0055314 -0.0255401 -0.0220687 -0.0091325 -0.01428 0.0184414 -0.0493717 -0.034624 -0.0127274 -0.0119652 0.0645385 -0.0757118 0.0222231 -0.0175524 -0.0216683 -0.0428081 -0.0354109 -0.0187116 0.0176812 -0.0346128 -0.0604912 0.1165225 -0.0132049 0.0823995 -0.0066132 0.0084946 -0.0520851 -0.0230356 0.0180728 0.0303796 0.0019286 0.0105415 0.0438299 -0.009166 -0.0337111 0.0318677 0.0091828 -0.0278053 -0.0218536 -0.0332062 0.0039643 0.0311612 0.0095421 -0.0028531 0.030021 -0.0037037 0.030153 0.0231327 0.0131063 -0.0210534 -0.0151856 -0.0036069 -0.0321276 -0.0112572 -0.0161677 0.0161677 -0.0374864 -0.0049092 -0.030987 -0.008155 -0.0071906 0.017374 -0.0350551 -0.0233556 -0.0151518 0.0353545 -0.012712 -0.035815 0.0186103 -0.0219307 0.0337907 -0.0042965 -0.0294942 -0.0269679 -0.0230425 -0.0319743 -0.0133255 -0.0234434 0.0136394 -0.0236771 -0.0268387 0.0796441 0.0047733 -0.0302138 0.017032 -0.041878 0.0012571 -0.0254467 0.0254467 0.0174351 0.0024661 -0.0376456 -0.0338134 -0.0013236 0.0678443 0.0171783 0.0416975 -0.020036 0.0094787 -0.0106699 0.0477112 0.0112996 0.0022447 -0.0226767 -0.0243773 -0.0035315 0.0175341 -0.0058106 -0.044081 -0.0061088 0.00489 0.0133255 -0.0194417 -0.0148334 -0.0112713 -0.0063171 0.0421899 -0.0221139 0.0049566 -0.0061996 -0.0328727 -0.007742 -0.013038 -0.0118813 -0.003992 0.0794271 0.0804216 -0.0346856 0.0392207 -0.0415764 0.0267613 0.0011474 -0.0232029 -0.0358461 0.0252266 -0.0095352 -0.0011983 0.0011983 -0.0072116 0.0072116 0.0422103 0 0.0011474 0.0293806 -0.017978 0.017978 -0.0191124 -0.0091221 -0.024349 0.0093459 -0.0343026 0 -0.0243617 0.0207451 -0.0319045 -0.0075094 0.0124846 -0.0012415 -0.0137588 -0.0101267 -0.0310102 -0.0039448 -0.0013184 0.0208885 -0.0571584 -0.0179439 -0.0112046 -0.0056497 -0.0478699 -0.0301682 -0.0107776 -0.0266682 0.0031746 -0.0387771 -0.0016488 -0.0132892 0.0441609 0.0268367 -0.0141179 -0.0337381 -0.0148151 0 0.0342332 -0.0459097 0.0083543 0.0033223 0.0148151 0.0242143 -0.0390293 -0.03373 0 -0.0155578 -0.0140353 0.0140353 -0.010508 0.0696968 -0.0148886 -0.006689 0.0083543 -0.0016653 -0.0339016 -0.0350913 -0.0180185 0.0198026 -0.0035714 -0.0253637 0.0054895 0 -0.0018265 -0.0073395 -0.0413593 -0.0351599 0.0157794 -0.0563529 0.0041322 -0.0815903 -0.0157839 0.0531098 0.0524779 0.0653051 -0.0291566 -0.0443621 -0.0594655 0 0.0737953 -0.0102146 -0.01032 0.0245914 0.0357891 0 -0.058308 0.0041322 0.0082136 -0.024846 0 0.0062696 -0.0425596 -0.0021763 -0.0332256 0 0.0156428 -0.0178976 0.0376567 -0.0219789 0.0219789 -0.0331522 -0.0090294 0.0112741 0.0309075 0 0.0467176 -0.0062435 0.0288086 0.0020263 -0.0287494 -0.0041754 0.0308984 0.0240493 0.0292704 0.0019212 0.0505252 -0.0147061 0.0487902 0.0312525 0.0303053 0.0115418 0.001638 -0.0400721 0.0848796 0.0201401 0.0420482 0.0599323 0.0286709 -0.0053981 0.0345779 -0.0052425 -0.083553 -0.0086084 0.0695691 0.0317487 -0.0223841 0.0119128 -0.0092532 0.0039761 0.0565704 0.0185764 0.0218455 -0.0084389 0.0156159 0.0212272 0.0011662 -0.0129034 -0.00949 0.00949 0.0427564 0.0245822 -0.0166949 0.0439148 -0.0372034 -0.024832 0.0034227 -0.0744585 -0.0438942 -0.0594234 0.0413117 -0.0118189 -0.00929 -0.0215642 0.0374375 0.11164 -0.0309918 0.0168071 0.0141846 -0.0579873 0.0111318 0.0278975 -0.0315944 -0.0024722 0.0086261 -0.0111044 -0.0012415 -0.0855444 0.0053981 -0.0567626 -0.0362621 -0.053083 0.0692005 -0.0309988 0.0666914 0.0097698 -0.0281709 0.0184011 0.0371688 -0.023241 -0.0583796 -0.0044085 0.0058737 -0.0103018 0.0190482 0.0086706 0.0199437 -0.0127752 -0.0057307 -0.0291566 -0.0361485 -0.0061539 0.0598981 0.0144303 0.0365723 -0.0452054 0.0724551 0.0317487 0 -0.0330937 0 -0.0314448 -0.0069687 -0.0028011 0.01531 -0.0055402 -0.0041754 -0.045657 -0.0102716 0.004415 -0.0014695 -0.0029455 -0.0345121 0.0271101 -0.039399 -0.0015468 0.0123078 0.0492269 0.002907 0 0.0272028 -0.0070872 0.0056738 -0.0113799 0.0184272 -0.0098801 -0.0071175 -0.0014296 -0.0028653 -0.0217558 -0.0029369 -0.0344088 0 0.012103 -0.0060332 -0.001514 0.0224729 0.0248733 -0.0043447 -0.0087464 0.0457877 -0.0042046 0.0153313 -0.0139278 0.0290276 -0.0027285 -0.0123713 0.0027624 -0.0027624 -0.023794 0.0028289 -0.0185322 0.0043073 0.0113961 0.0056497 -0.0099081 -0.0071378 0.0170459 -0.0070672 -0.0014194 -0.0114287 0.0028694 -0.0057471 -0.0396819 -0.0181548 -0.0030581 -0.0123268 0.0046404 0.0092167 0.0121582 0.0209275 -0.0149034 0.0015004 -0.0539007 -0.0063492 -0.0241752 0.0161816 -0.0064412 -0.0311756 -0.006689 -0.0481192 0.0380011 -0.0539731 -0.0107915 0.0232361 0.0192482 -0.0210165 0.0330753 0.1536613 0.0174677 -0.044255 -0.0030212 -0.0167815 -0.0472529 -0.0129872 0.0210194 0 -0.0048116 -0.0211218 0.0195128 -0.0228023 -0.0033003 -0.0336166 0.0051151 -0.0017021 0.0050977 0.0084389 0.0166671 0.0115038 0.0145988 0.0517763 -0.0045977 -0.0154802 0.0397606 -0.0015004 -0.0197125 0.0197125 0.0695933 0.0909718 -0.0498137 0.040822 0.0204349 -0.0243134 0.0064558 -0.0090498 0.0167422 0.0606997 0.0131345 0.0035524 -0.0059277 0.0281378 0.0103509 -0.0301997 -0.0166472 0.0071685 0.0487902 0.0279504 -0.0044199 -0.0246649 -0.0148659 0.0193959 0.0101181 -0.0056085 -0.0079052 -0.0183071 -0.0023121 0.0363676 0.0209837 -0.0076797 0.0282321 0.0316149 0.0144184 -0.0144184 0.01032 0.0392602 -0.0280299 0.0220893 -0.0029836 0.0177695 0.0087677 0.0096526 0.0076555 0.0374225 -0.0298251 -0.0095058 -0.0722729 0.0071612 0.0151748 0.0697958 -0.0150946 0.0056872 -0.0346188 0.0327267 0.0028369 0.0260965 0.0100687 -0.0128324 -0.0092679 0.0157047 0.0253407 0.0377072 -0.0060423 0.0256424 0.0092399 0.0008358 -0.0092321 -0.0127282 0.013571 0.0108924 -0.0125788 0.0050505 0.0083613 0.0156963 -0.0504309 -0.0929853 -0.0910619 0.0061984 0.078219 -0.0172915 0.0258264 0.0084627 -0.0236866 -0.0471137 0.0297052 0.0231447 -0.0124702 -0.0224509 -0.0079287 0.0332712 0.0396278 -0.0167914 -0.00377 -0.0123517 0.0019102 -0.027081 0.0534478 -0.0168701 0.0159403 0.0156902 -0.0129034 0.0092337 0.036105 -0.0017746 -0.0053428 -0.0089687 -0.0009013 0.012545 -0.0353458 0.0009221 -0.0139213 -0.0037453 0 0.0431457 -0.0063092 0.0045106 0.0017986 -0.0282479 0.0255488 -0.0090498 0.0036298 -0.0322163 -0.0637281 0.0226722 0.014514 -0.0243084 -0.0088977 -0.0426028 0.0144035 -0.0071758 0.0112533 -0.0215947 0.005184 0.0621442 -0.0127141 -0.0108858 0.0079287 0.0185824 -0.0087592 0.000977 -0.0388302 0.0030411 -0.0702227 0.032054 -0.0473716 -0.0520479 0.0286224 -0.033279 0.0511766 0.0391354 0.0263035 -0.0199272 0.0105375 -0.0137205 -0.0401138 -0.0088889 0.0176996 0.0109052 0.0341184 -0.0031496 -0.0063291 0.0363676 0.0071175 -0.0153142 0.0122701 -0.0030534 -0.0123078 -0.0114168 0.045903 -0.0110277 0.0020141 0.0287576 -0.0127892 -0.0049628 -0.0180728 0.0140847 0.0029925 -0.0354827 0.0010315 0.0183866 0.0030318 0.0010086 -0.0020182 0.029853 -0.0068864 0.0068864 -0.0098523 0.0176648 0.002914 -0.0019417 -0.0097657 0.0039177 -0.0157639 -0.0180366 -0.0122077 -0.0020492 -0.0186341 -0.0020921 0.031945 -0.0091697 -0.0196389 0.0134787 0.0284283 -0.002004 0.0129548 0.0009896 -0.0139444 -0.0030136 -0.0131647 -0.0040858 -0.0010241 0.0112075 0.0269881 0.0049188 -0.0118461 -0.0009935 0.0560533 0.0046882 -0.0028103 -0.0028182 0.0278311 0.0009145 -0.002746 0.0127506 0.0063149 0 -0.0090335 -0.0009079 0.0162166 0.0124336 -0.0142225 0.0256311 -0.000873 0.0112897 0.0196672 0.0008464 -0.0318033 0.0043573 -0.0282206 -0.002687 0.0062584 0.0062195 0.0192988 0.002603 0.0043234 -0.0200442 0.0035149 0.0026281 -0.0265973 -0.0172184 -0.0231171 0.0111629 -0.0046361 -0.0037244 0.0321276 0 -0.0054348 -0.0118777 -0.0260722 0.0186921 -0.0065026 0.002792 0.0184167 0 0.000912 -0.0165445 0.0027765 -0.0120875 -0.0227067 0.0198964 -0.0198964 0.0180185 -0.0103922 -0.0114614 0.028411 -0.0274508 0.0028749 0.016137 0.0121667 0.0009298 0.0074074 0.0027637 0.0027561 0.0045767 -0.0027435 -0.0045893 0.0146121 -0.000907 -0.002726 -0.0036463 0 -0.0156469 0.0101524 0.0127739 0.0018116 0.0099055 -0.0017937 -0.0044984 -0.0081485 -0.0054695 -0.013806 0.0009264 -0.0083682 -0.0236194 0 -0.0202808 0.0038948 0.0029112 -0.0156253 -0.0350562 0.0241704 -0.0170601 -0.0235546 -0.0104168 -0.0137061 0.0031797 0.0188685 -0.0072955 0.0031332 0.0267506 -0.0030503 0.0050787 -0.0225419 -0.0093702 0.0031332 0.011405 0.0051414 0.0081716 -0.0040775 -0.0185572 -0.0242245 -0.0032034 0.0148623 0.023947 0.0020555 -0.0030848 0.0462859 0.0049044 -0.0128018 0.0108429 0 -0.0148151 0.0177519 0.0135924 0 -0.0175102 -0.0108536 -0.0099702 -0.0222907 0.0071465 -0.010225 0.0233632 -0.0030166 0.0050226 -0.0171808 0 -0.0123078 -0.0031008 0.0164275 0.0091232 -0.0020202 -0.0010116 0.0060545 0.0050176 -0.0080402 0.0020161 0.0010065 -0.0223814 -0.0041237 0.0163938 -0.0102146 -0.0281122 -0.0031729 -0.0377811 -0.0110621 0.0088594 -0.0815138 0.0283038 0.0150032 -0.0068966 0.0011527 0.030632 0.0066815 -0.0122838 -0.020432 -0.0011474 -0.0022989 0.0159821 0.0334107 -0.0221493 0.0022371 0.0242838 -0.0076629 -0.0066152 0.0077135 -0.0055036 -0.005534 -0.0044494 0.0242303 0.0225938 -0.0053333 0.0180185 0.0020986 -0.0158482 -0.005339 -0.0086022 -0.0108579 -0.0010923 -0.0021882 -0.0076966 0.0164207 -0.0208455 -0.0111484 -0.0033689 -0.021604 0.0022962 0.0034345 -0.0034345 -0.0290887 0.0058858 -0.0082499 0.0082499 0.0254938 0.0034266 0.0203167 0.0011167 -0.006719 0.0277026 -0.006579 0.0098523 -0.010953 0.0022002 -0.0301194 0.0033918 -0.0033918 -0.0011331 0.0202027 -0.0022247 -0.0067039 -0.0101409 0.0268172 0.0131437 -0.010941 -0.0099503 0.0099503 0.0021978 -0.0044004 -0.0044199 0.0011068 -0.0022148 -0.0033315 0.0165475 -0.023244 -0.0146647 0.0011357 -0.0056915 0.0034188 0.0022727 -0.0045506 0.011338 0.0089787 0.0077908 0.0186716 -0.0076461 0.0195446 0.0021482 -0.0097036 -0.0032556 0.0043384 -0.0065147 -0.0043668 -0.004386 0.004386 -0.004386 0.004386 0.014123 0.0128619 0.0137496 -0.0094988 0.0115974 0 -0.0010488 -0.0126718 0.0074114 0.0084034 -0.0020942 -0.0084211 -0.0063627 -0.0042644 -0.020508 0.0010899 -0.0054615 -0.002193 0.0043812 0.0021834 -0.0010911 -0.0142938 -0.001108 0.0022148 -0.0011068 0.0088203 -0.0055036 0.0011031 0.0368007 0.003183 0.0063358 0.0010521 0.0021008 -0.0021008 0.0062893 0.0010444 -0.0115487 -0.0010565 -0.0021164 -0.0203324 -0.0108697 0.0021834 -0.0231671 0.0155042 0.004386 0.0043668 0.0075963 0.003238 -0.0086581 0 -0.0021763 0.0054318 -0.0032556 -0.0142312 -0.0099724 0.0055525 0.007722 -0.0055097 0.0044102 -0.0110621 -0.0111858 -0.0090396 0.0079141 0.0167508 0.0033168 -0.0044248 -0.0011093 0 0.005534 -0.0011044 0.0315415 -0.0161903 -0.0164568 -0.0011068 -0.0190056 -0.0011293 -0.0102216 0.0034188 -0.0057045 0.0057045 0 -0.0079955 -0.0290887 -0.0023641 0.0129337 -0.0023392 -0.0070506 -0.0190482 -0.0194181 0.0036697 -0.0160003 0.0208725 -0.0012158 -0.00978 0.0146344 -0.0012114 0.0203966 0.0153215 -0.0105821 -0.0047393 -0.0083483 0.0107208 0.0011841 0 0.0023641 0.0082305 -0.0046948 -0.0023557 0.0105573 0.0242087 0.0045455 -0.0045455 0.0180592 -0.0044843 -0.0056338 0.0112361 0.0133187 0.0065934 0.0021882 -0.0154188 0.0143253 0.0216459 0.0074667 0.003183 -0.0127934 0.0127934 -0.0042463 -0.0064034 0.005339 -0.0117837 -0.0054025 0.0043243 0.0160517 0.0084567 -0.0084567 -0.0042553 0.0283782 0.0041365 0.0061729 0.0051151 0 0.0010199 0.0010188 0.022156 -0.0029925 -0.0140847 0.0020243 0.0090589 0.0079841 0.0009935 -0.0049776 -0.006006 0.0070035 -0.0181091 -0.016377 -0.0114168 -0.0073337 0.0166844 0.0255246 -0.0010086 -0.0070886 0.006079 0.0080483 0.0049975 0.0099207 -0.0069342 0.0059465 0.0098329 0.0039063 -0.0039063 0.0058537 -0.0048757 -0.0078509 0.0224072 0.0133973 -0.0047642 -0.0144303 -0.011696 -0.004914 0.0088279 -0.000977 0.0048757 0.0009723 0.005814 0.0115275 0 0.01234 -0.0047281 0.0075543 -0.010402 0.0094608 -0.001885 0 0.001885 0.004697 -0.0009376 -0.007533 0.0028315 0.0149675 -0.0009289 0.0074074 -0.0101994 0.0055762 0.0119762 0.0109291 -0.0090992 0.0127159 -0.0036166 -0.0081856 0.0154058 0.0071685 -0.0008933 -0.0008941 0.0035714 0.0237792 0.009528 0 0.0060163 0 -0.0112022 0.0086282 0.0051414 -0.0242226 0.0026235 0.0086957 0.0034572 -0.0025918 -0.0209798 0.0122916 -0.0301174 -0.0018002 0.0062865 0.0062472 0.0070922 -0.0097648 0.0132922 0.0096365 0.0155712 0.0059906 0.0034072 0.0084675 0.0050463 -0.0118145 0.0016964 -0.0025456 -0.0042571 0 0.0084962 -0.0205135 -0.0280228 0.0044307 0.0079261 0.0122059 0.0043234 0 -0.0025918 0.0008647 0.0017271 -0.0095363 -0.0336613 0.0143115 0.0088418 0.0070176 0.0078363 -0.0069626 0.0052265 0.0197856 0.0008514 0.0110031 0.0067114 -0.0041894 -0.0050505 -0.0033812 0.01596 0.0157093 0.00491 0.0065094 -0.0016234 0.009701 0.0096078 -0.0071972 -0.0008029 -0.0072552 0.0080581 0.0119666 -0.0023819 0.0031746 0.0188389 -0.0038956 0.0085504 0.0015468 -0.0100972 0.0116416 0.0183491 0.0037807 0.0060196 -0.003758 0.0134632 -0.0127105 0.0097343 -0.0210851 0.0158554 -0.0128159 -0.0145207 0.0076687 -0.0115253 0.0007725 -0.0155645 0.027081 0.0083619 -0.0022736 -0.0022788 0.0113423 0.0015026 -0.0174181 0.0038124 -0.0137933 -0.0093024 0.0015564 -0.0101603 0.0132659 -0.0031056 -0.0046765 0.0062305 0.0046476 0.0015444 0.0099809 0.0022892 -0.0007625 -0.0061209 0.0205096 0.009727 -0.0022363 0.0111318 -0.0059216 -0.0044643 0.0155386 0.0058565 -0.0021922 0.0080146 -0.0043636 0 0.005814 -0.0065431 0.0043668 -0.0014535 -0.0080322 -0.0088366 -0.0037051 0.0213008 0.0108422 -0.0043228 0.0071943 0.0028633 0.0014286 0.0099433 -0.0049593 0.0162032 -0.0006991 0.0097426 -0.001386 -0.0034734 0.0013908 -0.0048764 0.0020928 0.0055594 0.0137648 0.0061329 -0.0040844 0.0054422 -0.0109142 0.0109142 -0.0068074 0.0155883 -0.0026936 -0.0094852 -0.0185509 -0.0048662 0.023417 -0.0061455 -0.0034305 0.0150071 0.0141179 0.0026667 0.0013307 0.0039814 -0.0073114 -0.0325452 0.0150482 0.0101318 -0.0286318 -0.0153313 0.0263355 -0.0034258 0.023738 -0.0040296 0.0133692 -0.0013289 -0.006002 0.0066667 -0.0053298 0.0086465 -0.0033168 -0.0154004 0.0013486 -0.0020236 0.0074 0.0179347 0.0098265 -0.0045737 0.0078278 0.007767 -0.0051713 0.0006479 -0.0032436 0.0025957 -0.0006483 -0.0203086 0.0098782 -0.0045977 -0.0059426 -0.0086465 -0.0236577 -0.0013689 0.0169783 -0.0307717 0.0027739 0.0055249 -0.0393309 -0.0014337 -0.029853 0.0175829 0.0072359 -0.0050596 0.0014482 0.0143681 0.0113476 -0.0185059 -0.0014378 0.0078825 -0.0107644 0 0.0079052 0.0226478 0 0 -0.0070225 -0.0242523 0.0100576 -0.0035804 0.0107029 0.0098871 0.0014045 0.0139375 -0.0020783 -0.0083566 0.0069687 -0.0006947 0 -0.0034807 -0.0147526 -0.000708 0.0056497 0.0098109 0.0097156 0.0048226 0.0143298 -0.0115845 0.0081912 0.0020374 0.0121377 -0.0047027 0.0047027 -0.0060504 0.00538 0.0106739 -0.0046558 0.0106102 -0.0106102 -0.0033389 0.0013369 -0.0053584 -0.0033636 0.004035 -0.0013432 0.0093646 -0.0053405 -0.0087396 0.0053872 0.0120162 0.0184095 0.0064935 0 0.0115831 0.0006396 -0.0006396 0.0019175 0.0057307 0.0050665 0.0062973 -0.0062973 0.0037831 -0.0037831 0.0100567 0.0099565 -0.0018593 -0.0099751 0.0037523 -0.0106684 0.001261 0.0025173 -0.0025173 -0.0063211 0.0063211 0.0131457 0.0099011 -0.0024661 -0.007435 0.0049628 -0.0049628 -0.0131457 0.0025173 -0.0069379 0.0006327 0.0056765 -0.0056765 -0.0314835 0.0116809 0.0096309 0.0012771 -0.0076874 0.0216293 0.0018862 0.0025094 0.0018779 -0.0025047 0.0037547 -0.0037547 0.0043791 0.0062228 0.0104907 -0.0073937 -0.0006186 -0.0030989 -0.002486 -0.0068686 -0.0018815 -0.0113638 0.0075902 0.0100314 0.0062189 0.0018582 0.003706 -0.0049444 0.001857 -0.0180972 0.0094015 0.0062189 -0.0043492 -0.0031182 0.0018721 0.0191423 0.0097384 0.0012107 0.0090335 0.0023952 0.0053683 0.0035629 0.0064993 -0.0011786 -0.0047281 -0.0017788 0.0112129 0.0046838 0.0005839 -0.0011682 0.0040828 -0.0081824 0.00293 0.0011696 -0.0272529 0.016677 0.0005905 0.0152317 0.0017427 -0.0011614 -0.0023269 0.0150292 0.0074307 -0.0074307 0.0142412 0.0005655 -0.0033975 -0.0114091 -0.0109606 -0.006401 0.0156389 0.0136988 -0.0073969 -0.0120656 -0.0098752 0.0104531 -0.0245626 0.0170242 -0.0052524 0.0145225 0.0017286 -0.0051948 -0.0081349 -0.0111471 0.0052957 -0.0017621 0.0011751 -0.0070713 0.0035419 0.0047031 0.0099213 -0.0046566 0.0011662 0.0092808 0 -0.0017336 -0.0075472 -0.0093678 -0.0082694 -0.0125337 0.0125337 0.0100325 0.00176 -0.0070589 0.0041237 0.0151695 -0.005225 -0.0093568 -0.0053019 0.008821 0.0005853 0.0225639 0 0.0011435 0.003992 0.000569 0.001705 0.0028353 0.0045198 0.0067416 -0.0067416 -0.0067874 0.0124085 0.0067039 -0.0050237 0.0027941 -0.0084058 -0.0147395 0.0079636 -0.0011338 0.0079096 0.0033708 0.0028003 0.006689 0.0071963 0.0011025 -0.016107 0.0089187 0.0027709 -0.0044371 0.0099558 0.0082215 -0.0032805 -0.0088009 0.0027586 -0.0016543 0.0055036 0.008199 -0.0005445 -0.0214707 0.0055494 -0.0038813 0.0033278 0.0016598 0 0.0137252 0.0113853 -0.0092067 0.0129732 0.0032172 -0.0064447 -0.0010782 0.0069874 -0.0156548 -0.0010887 -0.0043668 -0.0076881 0.0049491 -0.0066043 -0.0212062 -0.0005642 -0.0005645 -0.028058 0.0155578 0.0119354 -0.0011306 0.0039515 -0.0067835 0.0179881 -0.0016727 -0.011788 -0.0125002 0.0028547 0.0045506 -0.0091221 -0.0320074 0.0047198 0.0023516 -0.0041189 0.0082208 0.0104713 0.0011567 -0.0040545 -0.004071 -0.0052586 0.0035088 0.0029146 0.0132988 -0.0127169 -0.0199772 -0.0065496 -0.035262 0.0165699 -0.0271454 0 0.0271454 0 0.0024316 0.015663 -0.0084034 0.0072072 -0.0035971 -0.0030075 -0.0194653 0.0006141 -0.0061577 -0.0339229 0.0101717 0.0012642 -0.0133547 0.0165083 -0.0025221 0.0261697 0.0006148 0.0134312 -0.0018209 -0.0128403 -0.0012315 0.0018467 0 -0.0186225 0.0068686 0.0018651 0.0111181 -0.0018445 -0.007412 0.003095 -0.0086903 -0.0062539 -0.013262 -0.00894 -0.0253343 0.0091684 -0.010485 0.0137392 0.007767 -0.0025823 -0.0077872 0.0019525 0.008417 0.0070672 -0.0064226 -0.0103628 -0.0157484 0.0013219 0.0170273 0.0045352 0.014758 0.0344322 0.0073575 0.0018309 -0.00489 -0.002454 0.0158443 -0.0085004 -0.0012203 0.0048721 -0.0024331 0.0012173 0.0180837 0.0118766 -0.007109 0.0029682 0.0041408 0.0094008 -0.0023419 -0.001173 -0.0153758 -0.0035821 0.002986 0.0124446 0.0052864 -0.0082353 0.0053019 -0.006484 -0.0035545 0.0094507 0.0035211 -0.001759 -0.0017621 0.0052771 0.0098924 0.002891 -0.0086982 -0.0058411 -0.0094174 -0.0148945 -0.0102565 0.006046 -0.0078669 0.0078669 -0.0072596 -0.0196205 -0.0168596 0.0018874 0.0131129 -0.0049751 -0.0271739 -0.016145 0.0064893 0.007732 -0.0588211 -0.0054608 0.0250098 -0.0541785 0.0167719 -0.013957 0.0311336 -0.0047798 0.0189836 -0.0217252 -0.0278376 -0.0163646 0.0099929 0.0042523 -0.025064 -0.0437269 -0.0083682 0.0404247 0.0065814 0.0050891 -0.0021779 -0.0029112 0.0029112 -0.0124316 -0.0559904 0.0238381 -0.0076278 -0.0240229 0.0023502 -0.0448075 -0.0008187 -0.0198518 -0.0109199 0.0016878 -0.0973358 0.0311096 0.0721111 0.0199177 -0.0274903 -0.0484524 0.0618754 -0.0219048 0.0017021 0.0243607 0.0245914 0.0008094 -0.0229143 -0.0474665 -0.0052219 0 -0.0292185 -0.0008989 0.0204725 0.05235 -0.0041894 0.0016779 -0.0341039 -0.0043459 -0.0078706 -0.0203998 -0.0600088 0.0299929 -0.0550424 0.0174086 -0.0252441 0.0479939 0.0466904 -0.0198742 0.0135933 -0.0126813 0.0198562 0.0133158 0.0008814 -0.0195736 0.0169269 0.0087951 -0.01856 -0.0098611 0.0009005 -0.0338705 0.008345 0.0073597 0.0154619 -0.0072464 0.0135442 0.0142478 0.0061701 -0.017731 -0.0053812 -0.0054103 -0.0340263 -0.0361944 0.0106127 0.0133462 -0.0009474 -0.0028477 0.0437076 -0.0063898 0.0447702 -0.0087951 0.0261567 0.0212865 0.0067171 -0.0092476 -0.0144622 0.0025674 0.0177895 -0.0203569 -0.010336 -0.0086957 0.0181745 -0.0190482 -0.0026258 -0.0008768 -0.0159155 -0.0390781 -0.0139993 -0.0084946 -0.0037987 0.0169815 0.0185362 -0.0138698 -0.0379552 0.0191577 0.020658 -0.0187623 0.0390022 -0.0073126 0.0064015 -0.003653 0.0082005 -0.0118669 -0.0018382 0.0254328 -0.0117277 0.0153087 0.0168369 0.0260205 -0.0146618 0.0051993 -0.0025963 -0.017483 0.0105264 -0.009645 -0.0097389 -0.0098347 -0.0008989 -0.021819 0 0.0009187 -0.0110804 -0.0177991 0.0028315 0.0158956 0.030153 -0.0451066 -0.0085107 -0.0328215 0.02136 -0.002886 -0.0313137 -0.020081 0.003038 -0.0561478 -0.0161729 0.0075799 -0.060018 -0.0126803 -0.0140189 0.0471081 0.0385298 -0.0021622 0.0256424 -0.0224009 -0.0075799 0.0446408 0.0653828 -0.0316545 0.0100001 0.0049628 0.0098523 0.0403513 -0.0199721 -0.0292418 -0.0049579 0.0098913 0.0281435 -0.007685 -0.0155494 -0.0247906 0.0119762 -0.0312368 0.001023 -0.0082136 -0.011405 0.0267506 0.0161131 -0.004004 0.0451057 -0.0028805 0.0218744 -0.0189939 0.0057362 -0.0057362 -0.0164334 0.0019474 -0.019647 0.0059347 0.0068796 -0.0098426 -0.014948 -0.0141559 0.007103 -0.0183679 -0.0176628 -0.0265549 -0.001077 0.0128481 -0.0139263 0.0318498 -0.0031397 -0.0126584 0.0241228 0.0092832 -0.0041152 0.003088 0.0213531 -0.0141846 -0.0030659 -0.0259216 0.0114884 0.0041451 0.0092641 -0.0092641 0 0.0523785 0.0261516 0.0254851 0.0275753 0.0108207 0.0212963 -0.0114792 -0.0008885 0.0409287 -0.0137459 0.0298275 0.0191274 -0.0132672 0.0132672 -0.0041271 -0.016681 0.00587 -0.0194181 0.0260848 -0.0075032 -0.0092476 0.013423 0.0099503 0.0187991 0.0255809 -0.0111112 0.0007978 0.0007971 0.0165946 0.0031299 -0.0141623 -0.0297569 0.0186014 -0.012092 0.0056612 -0.0121705 0.0129767 -0.0089033 0.006483 0.0223651 0.0117787 -0.0062647 -0.0063042 -0.0127289 -0.0259544 -0.0207562 -0.0033613 0.0033613 0.0133335 0.0016543 -0.0008268 0.0180333 0 -0.0032547 0.0225634 -0.0023933 0.0079555 -0.0095542 -0.0104545 -0.0429463 0.0159066 0.0016598 -0.0116765 0.0281243 0.0073141 -0.0105821 0.0154286 -0.0097167 -0.022214 -0.0117156 0.0150379 -0.0589159 -0.0061756 0.0322187 -0.02078 -0.022115 0.0282206 0.0333507 0.00587 -0.0177145 -0.0337548 0 -0.0303866 -0.002726 0.0436206 0.035932 0.0281709 0.0178142 0.0048039 -0.0032 0.0299944 -0.0031153 0.0023374 0.0116055 -0.0069472 -0.0054369 0.0306773 -0.0068208 0.0090841 -0.0151863 0.013678 -0.0182793 0.0152558 0.0030234 0.0112572 0 0.0022363 -0.012739 0.0052651 -0.0143561 -0.0022857 0.0045662 -0.0053293 0.0038095 0.0030372 -0.0015175 0.0030326 0.0165169 0.0264527 -0.0065479 0.0058224 -0.0257273 -0.0059746 -0.0288774 0.0114988 -0.0215725 0.0031104 0 -0.0085771 0.0023465 0.0015613 -0.0141401 -0.0215922 0.0048387 0.0238485 -0.0094713 -0.0103628 -0.0008016 -0.0056293 0.0080322 0.0031949 -0.0120338 -0.0056657 0.0088889 0.0024106 0.0103793 0.0212189 0.0023301 0.0007755 -0.010912 -0.0062893 -0.0015785 -0.0063392 0.0071287 0.0109891 0.0038956 -0.0101603 0.0093824 0.0215559 0.0007613 0.0053131 -0.0098898 0.0114026 -0.0129329 0.0007654 -0.011543 -0.0101129 0.0015625 -0.0189131 -0.0079873 -0.0112904 0.0240396 0 0.0078865 -0.0015723 0.0070561 -0.0039139 -0.0222055 -0.0442695 0.0041824 -0.0058602 -0.032426 0.0282191 -0.0042248 0.0292052 0.0114474 -0.0147423 0.0212253 -0.006483 0.0080972 0.0056293 -0.0121018 0.0129034 -0.0145281 0.0024361 0.0088818 -0.0064516 0.0016168 0.0080451 -0.0064309 0.0088319 -0.0283764 0.0057401 0.0008173 0.0242143 0.0079429 -0.0007915 0.0055271 0 -0.001576 0.0140958 0.0031056 -0.0085637 0.0046802 0.0169757 -0.0046012 0.0068939 -0.0061256 -0.0077101 0.0038625 -0.0281488 -0.0023819 -0.029853 -0.0156834 -0.0058407 0.0174206 -0.0342986 0.0143644 0.0125054 -0.0024886 -0.0041615 -0.0134343 0.007579 -0.0350014 -0.0471408 0.0225133 0.0026679 -0.0215448 0.0036232 -0.0368366 -0.0460734 0.0252196 -0.0019175 0.0265167 0.008376 -0.0149396 0.0396548 -0.0210149 -0.0158216 0.0121214 0.0119762 0.0036563 -0.0018265 -0.0147332 0.0018536 0.0101337 0.010939 -0.0091075 -0.0009153 -0.0055097 0.012809 0.0260221 -0.0035492 -0.0035619 0.0026726 -0.0008901 0.0176527 -0.0123241 0 -0.0071111 0.0026726 0.0008893 -0.0279423 -0.0064191 0.0018382 0.0091408 0.0081559 0.0080899 -0.005386 0.0283959 0.0017483 0.0034874 0.0060738 0.0077553 -0.0043011 -0.0156389 0.0052402 0.0034783 -0.0008684 0.012948 0.0008573 -0.002574 0.0136521 -0.0033956 -0.0085398 -0.0068847 -0.0043271 -0.0245842 0.0026631 0.0061865 0.0061485 0.0087185 0 -0.0060949 0.0043573 -0.0026121 -0.0202561 0.0044385 -0.0205824 -0.0247152 0.0064665 0.010078 0.002731 0.0180185 -0.0008933 -0.0053764 -0.0008989 0.0044863 0.0124557 0.0209981 0.007762 -0.007762 0.0043197 0.0397179 0.0074288 -0.0132452 -0.0125788 0.0200508 0.0115133 -0.0082102 -0.0066171 0.0099092 0.0008214 -0.0032895 -0.0024742 -0.0057971 0 0.0099174 -0.0032949 -0.0183186 0.0058651 -0.0109199 0.0025306 -0.007611 -0.0205839 0.0017316 0.0103271 0.0085252 0.0092945 -0.0264182 -0.0008639 -0.0209615 -0.0044228 -0.0224124 0.01886 -0.0316339 -0.0027586 0.0209575 0.0258136 -0.0186258 0.0273748 -0.010508 -0.0159719 0.0106763 0.0201496 0.0919141 -0.0087406 -0.0023971 0.0150856 0.0039324 0.02174 0.0114549 -0.0106871 0.00383 -0.0007648 -0.011543 -0.0354507 0.03777 -0.0007725 0.0061633 -0.0077101 0.0061729 -0.0038536 0.0122795 0 -0.0192536 -0.0054581 0.017823 -0.0108109 -0.0085771 0.0015649 0.0023428 -0.0015613 -0.0086309 0.0031471 0.0023539 0.00625 -0.0078186 -0.0031447 0.0031447 0.0271019 -0.0068992 -0.0015396 -0.0030864 0.0061633 -0.0023068 0.0023068 0.0144875 -0.0098898 -0.0045977 -0.0030769 -0.001542 -0.0100815 -0.0007797 0.0015588 0.0085305 -0.0030936 -0.0069958 -0.0054752 -0.013423 0.0047581 0.0007908 0.0070894 -0.0086717 0.0125887 -0.0031323 0.0046948 -0.0015625 -0.0070616 -0.001576 -0.0150976 0.0016 0.000799 -0.0040016 -0.0112904 -0.0105994 0.00735 0.0008133 -0.0016273 -0.00163 0.0153787 0.0008029 -0.0080581 0 -0.0105735 -0.003276 0.0154663 -0.0016168 0.003231 -0.0008068 -0.0016155 -0.0024282 0.0040437 -0.0008074 0.0048348 0.0008035 -0.0056384 -0.0056703 0.0088961 0.0032154 0.0024048 0.0111466 0.0110237 -0.0031373 -0.005514 0 0.0007896 -0.0095163 0.0015924 -0.0160388 -0.0195925 -0.0033031 -0.0016556 0.0057828 0.0008234 -0.0016474 0.0016474 -0.0024722 -0.0049628 0.0041374 0.0131257 -0.0090054 -0.0008227 0.0008227 0 -0.0057732 -0.003314 0 0.0008295 0.001657 -0.0033168 0.0082713 0.0065682 0.0122002 0 -0.0024282 -0.0008107 -0.0040634 0 0.000814 0.002438 -0.002438 0.0048701 -0.0024321 -0.007332 -0.0057401 0 -0.0016461 0.0008234 -0.0016474 -0.0057875 0.001657 0.0008275 0.0049505 0.0073801 0.0008167 -0.00409 0 0.0032733 0.002448 -0.0016313 -0.002452 -0.0123509 -0.0049834 -0.000833 0.007472 0.0041271 0 -0.0008241 -0.0049587 -0.0049834 0.0132343 -0.0024681 0.0032895 0.0057307 -0.0032706 0.0032706 0.0153912 0.0064103 -0.0032 0.0071857 0.0015898 -0.0103793 -0.0088675 0.0032336 -0.0056657 0.0008114 -0.0008114 -0.0138948 0.0008227 -0.0099174 0 0.0041442 0.0041271 0.0073862 -0.0040967 0.0008207 -0.0090648 0.0008275 0.0024783 0.005759 -0.0132124 0.0058019 0.0016515 -0.0024783 -0.0024845 0.0024845 0.0016529 0.0008254 -0.030153 0.0033956 -0.0602539 -0.0776453 0.0096806 0.0095878 -0.0518961 -0.0203053 0.0040942 -0.0687011 0.0043668 0.0021763 -0.0043573 0.0097774 0.0139562 -0.0204638 0.0065076 0.0021598 -0.0043243 -0.0130863 0.0130863 -0.0152841 0.0142001 0.0129312 -0.0010712 -0.0371222 0.0467222 0.0486891 -0.0193983 0.0244411 0.0060181 -0.002002 0.0030015 0.001996 -0.0120363 0 0.0070387 0.0119523 -0.0291332 -0.006135 0.0102042 0.0131116 0 -0.0110832 -0.0020284 0.0030411 0.0060545 0.0030136 -0.0030136 0 0.0030136 0 -0.002008 0 0.0030105 0.0109617 -0.0029777 0.0009935 -0.0099801 -0.0010035 0.0010035 0.0010025 -0.0090589 0.0030288 0.0050277 0.004004 0.0069687 0.024499 -0.0038797 -0.0029197 -0.0009751 0.0029226 0 -0.010758 0 0 0.0097848 0.0087252 0.0019286 -0.0372958 -0.0090407 0.0090407 -0.0161294 0.0091048 -0.0020161 0.0120363 0.017787 0.0107161 -0.0126769 0.0019608 0.0019569 0 0.0135924 -0.0048333 0.0172915 0.005698 0 0.0206193 0.0138187 -0.0073462 -0.0036934 -0.0271934 0.0009501 -0.0076263 -0.0144581 0.0009704 0.0058027 0.0086414 0.0076191 0.0075615 -0.0028289 0 0.0075259 0.0213267 -0.0036765 -0.0018433 -0.0064785 -0.0177991 0.0065945 0.0009385 0.0139732 0.0046147 0.0009204 -0.0083141 0 -0.0055814 -0.0169336 -0.0057089 -0.0009547 0.0104514 -0.0047371 0.0103922 0.0037523 0.0046707 -0.0009324 -0.0018674 -0.0046838 0.0046838 0.0093024 -0.0065026 0 0.0111215 -0.0036934 0.0018484 0.0082759 0.0145457 0 0.0036036 0.0035907 -0.0337162 0.054116 -0.014147 0.0150246 -0.0035149 -0.0088418 0.0026608 -0.0106858 -0.0098966 -0.00181 0.0009054 -0.0238106 0 -0.0009272 0.0009272 -0.0027842 -0.0187623 0 0.0009465 0.0037772 0.0009421 -0.0037736 0 -0.0066382 0.0019011 0.0066257 0.000943 0 0.0018832 0.0037559 0.0018727 -0.0009359 -0.0094074 -0.0037879 -0.009533 -0.0038388 0.0009611 0.0019194 -0.0048054 0.0019249 -0.000962 0.0048008 0.0057307 0.0066445 0.0009456 -0.0094967 0.0226425 0 0.0018639 0.0009307 0.0018587 0.0055556 0.0027663 -0.0009212 -0.0027688 -0.0055607 -0.0083995 -0.0122585 -0.0018993 -0.001903 -0.0028612 -0.009597 0.0057692 -0.0009592 0.0028749 0.0038204 0 -0.0057362 -0.0203397 -0.0177695 0.0029836 -0.0069756 -0.004008 0.0010035 0.0178931 0.0039331 -0.0029484 0.0039293 -0.004914 -0.0168906 -0.0141274 -0.032011 0.0073184 0.0051948 -0.0020747 -0.0083421 0.0176445 0.0041068 0.0081633 0.0091048 0.0020121 -0.00706 0.0040404 -0.0020182 -0.0132183 0.0051047 -0.0061287 0.0192802 -0.0050378 0.0010096 0.0189911 -0.0079523 0 -0.0050025 0.0010025 0.0069895 -0.001992 0.0039801 -0.0059761 0.0009985 -0.0090226 -0.0030257 0.0020182 0.0040242 -0.0030166 0.0080241 -0.0070176 -0.0020141 0.0040242 0.0010035 0.004004 0.0148738 -0.0019704 -0.002963 -0.0059524 -0.0211169 -0.0143298 -0.0010315 -0.0093313 0.0020812 -0.0031234 0 -0.0052274 -0.0147838 -0.0021299 -0.0010667 -0.0053505 0.0117335 0.0042328 -0.0074192 -0.0010644 0.0031898 0.0021209 -0.0138669 -0.0010747 0.0032206 0.0021413 -0.0010701 0.0169855 -0.0031629 -0.0021142 0 0.0147061 -0.0031332 0 -0.0073491 -0.0170036 0.0021413 0.0032034 0.0021299 0.016878 -0.0010466 -0.0115852 0 0.0010588 -0.0127797 0.0064103 0 -0.0010655 -0.0032034 0.0010689 0.0116836 -0.0010565 0.0042194 -0.0010532 0.0083946 0.0093604 0.0164275 0 0.0050787 -0.0020284 -0.0020325 -0.0020367 0.0081219 0.0010106 -0.0020222 -0.0122201 0.0030691 0.0162111 -0.00706 0.0020222 0.0040323 -0.0050429 -0.0010116 -0.0030411 -0.0030503 0.007103 0.0020202 0.0010086 0.0169919 0.0186554 0 0.002914 -0.002914 0.0009723 0.0009713 0.0029084 -0.004852 -0.0068326 0.0039101 0.0058366 0.0144442 -0.0009565 -0.0028749 -0.0057748 -0.0019324 0.0048239 0.0076702 -0.001912 -0.0047962 -0.000962 -0.0048239 -0.0019361 0.0038685 0 0 -0.0019324 -0.0106953 -0.0078509 -0.0009857 0 -0.0049432 0.0039565 -0.0099207 0.0039801 0.0059406 0.0009867 0.003937 -0.0009828 -0.0019685 0.0009847 0.0009838 0.0078355 0.0009751 0.0029197 -0.0009723 0.0019436 0.003876 -0.0067928 -0.0029254 -0.002934 0.000979 0.000978 -0.0029369 -0.0078741 0.0108109 0 0.0019531 -0.0009761 0.0048709 0.0173415 -0.0076702 -0.0096713 -0.0038948 0.0029226 0.0038835 -0.0068061 -0.012764 -0.0029688 0.0039565 0 0.0068864 -0.0029455 -0.0029542 -0.0009867 0 -0.0009877 -0.0119286 -0.002002 -0.0141274 0 0 -0.0061162 -0.0061539 -0.014508 0.0041667 0.009312 0 0.0092261 -0.00409 0.0010241 0.0051047 -0.0040816 -0.0123458 -0.0010357 -0.0031137 0 -0.0125525 0.0042017 0.0052274 0.0072728 -0.0083161 -0.0031364 0 -0.0073568 -0.0234803 -0.0054142 0.0097245 0.0010747 -0.0032275 -0.0021575 0.0086022 0.0042735 0.0010655 0.0010644 -0.0053333 -0.008593 -0.0064935 -0.00982 -0.0021954 -0.0033021 0.0207318 0.0107412 0.0021345 -0.0064171 0.0064171 -0.0446941 -0.0328641 0 0.0160003 -0.0102565 -0.0011461 0.0011461 -0.0022936 -0.0162041 -0.0093787 0 -0.0011786 -0.0094787 -0.0023838 0.0011926 0.0035693 0.0035566 -0.0095126 0.0432563 -0.0057373 0.0227541 0.0089586 0.0132892 -0.0044102 -0.0055402 -0.013423 -0.0033841 -0.0068027 0.0056722 0.0201575 0 0.0022148 -0.0088889 -0.0044743 0.0044743 -0.0022346 -0.0146481 0 0.0033994 0.0045147 0.0100841 0.0022272 -0.0066965 -0.0022422 -0.0067568 -0.00453 0.0033994 0.0067644 0.0078344 -0.0022321 -0.0112361 0.0011293 -0.0136366 -0.0138251 -0.0023229 0.0023229 0.0069364 -0.0034622 -0.0186703 -0.0011786 0.0023557 -0.0035357 0.0035357 0.0023502 -0.0070672 0.0070672 0.0081824 0 -0.0140682 0.0152317 -0.0105203 -0.015394 -0.0266037 0.0085418 -0.0036519 -0.007344 -0.0198518 0 0.0062461 -0.0012461 0.0123917 0.0207198 -0.009697 -0.0012188 -0.0110363 0.0012323 0.0036878 0.0085523 -0.007326 -0.0036832 -0.0098888 0 0.0012415 -0.0062228 0.0049813 0.0074258 0 0.0110363 -0.00489 -0.004914 -0.0161394 -0.0012523 -0.0025094 0 -0.0164665 -0.0025575 0.0012796 -0.0154642 0.007762 0.0038585 0.0025641 -0.0025641 -0.0260093 -0.005284 0.0026455 -0.0039709 -0.0093272 0.0185682 0.0065488 0.0065062 0.0051747 0.0025773 0.0038536 -0.0012829 0.0127553 0 0.0063171 0.0075283 -0.0075283 -0.0165083 -0.0025641 0.011487 0.008844 -0.0012587 -0.0037855 -0.0025316 0.0163423 -0.0012477 -0.0012492 -0.0025031 0.0025031 0.0198026 0.002448 -0.0036742 0.004896 -0.0012217 0.0073082 0.0132612 0.0023923 0.0035778 0.0082988 -0.00949 -0.0059773 0.0035907 -0.0059916 0.0047962 0.0023895 0.0011926 0.0165488 -0.0047004 -0.0106573 -0.0035778 -0.0144407 0 -0.0048603 0.0012173 0.0012158 0.0024272 0.0036298 0.0024125 -0.0084695 0.0156724 0.0095239 0.0106071 -0.0023474 0.0243773 0.0102682 -0.0011357 -0.0034149 -0.0045714 0.0102565 0.0011331 -0.0011331 -0.0114026 -0.0034463 0.0068808 0.0022831 -0.0034266 -0.0138251 0.0011594 0 0 -0.0011594 -0.0163746 0.0023557 0.007034 0 0.0011675 -0.0023364 -0.0094008 -0.0011813 0.0035398 -0.0011786 0 0.0035315 0 0.0035191 0.0046729 0.0034904 0.004635 0.009206 -0.0011461 -0.0034463 0.0022989 0 0.0022936 -0.009206 -0.0127983 0.0058377 0.0023256 0.0011608 0 0 0.0011594 -0.0011594 -0.0011608 0.0011608 0.0069364 -0.0046189 -0.0069687 -0.0046729 0.0011703 0 0.0046675 0.0011635 -0.0011635 0.008116 -0.0011554 0 0.0034622 0.0080322 0.0124931 0.0045045 -0.0022497 0.0011255 -0.0045096 0 0.0078785 0.0144688 0.0033094 0.0054915 0 0.0043716 0.0140771 0.0042919 0.0074667 0.0042418 -0.0021186 -0.012807 0.0042873 -0.0010701 0.0010701 0.0127526 -0.0010565 0 -0.0031763 0.0010599 0.0042283 -0.009539 -0.0085562 -0.0010747 0.0064309 0.0063898 0.0063492 -0.0042283 0.0021164 0.0126052 0.0072803 0.0041365 -0.0082902 0.002079 -0.00625 -0.0010455 -0.0084034 -0.012739 0.0042644 -0.0010644 0.009539 0.0010543 -0.0127255 -0.0021368 -0.0042873 0.0032172 0 -0.0053677 -0.001077 0.0032275 0.0032172 0 0.0010701 -0.0053619 0.0064309 0 0.0010678 0 0.0031966 0.0021254 0.0021209 0.0084389 0.0176996 -0.0010325 0.002064 -0.002064 -0.0010336 0.0030976 0.0041152 0.0020513 -0.0113345 0 0.0113345 0.0010241 0.0071392 0.0080972 -0.0020182 -0.0010106 0.0020202 0.0010086 0.0020141 0.0020101 -0.0030166 0.0020121 0.006012 0.0079602 0.0009906 0.0019782 -0.0099306 0.0009975 0.0148444 -0.0009828 0.0039254 0.0087763 0.0048426 -0.0009667 0.0009667 0.0086581 0.0028694 0.0047642 0 -0.0076336 -0.0009583 0.0076409 0 -0.0009519 0.0075902 0.0065945 0.0018762 0.0046751 0.0083605 -0.0018519 0.0018519 -0.0139732 -0.0018779 0.012144 0.0064785 0.0055198 0.0064015 0 0.002731 -0.0072993 -0.007353 0.0128324 0.0018198 0.0045352 0.0018083 -0.0054348 -0.0054645 -0.0045767 0.0100412 0.0036265 0.0009046 -0.00181 -0.0027211 -0.0072926 -0.0018315 -0.0027536 -0.0009195 0.0045893 0.0027435 0.002736 0.0207308 0.0079965 0.0026513 0.014023 0.0086656 -0.0008632 0.0008632 -0.0025918 0.0017286 0.0008632 0.0145613 -0.0051151 -0.0085837 -0.0404629 0.0044783 -0.003581 -0.0008973 0.012489 0.0070672 -0.0026443 0.0052817 -0.0008783 -0.0035211 0.0096534 0.0026167 0 0 0 0 0.0095363 0 0.0051635 0.0144868 0.0033784 0.0058848 0.0033473 -0.0134569 0.0101096 0.0033473 -0.0033473 -0.0041999 0.0033613 -0.0186288 0.0025608 -0.0008529 0.0076498 0.0101096 -0.0025178 0 -0.0008407 -0.0016835 0.0025242 0.0075346 0.002499 0.0024927 0.0049669 0.0057637 0.0008207 0.0040933 -0.004914 0.0081767 -0.0106428 -0.005778 0.0033058 0.0016488 -0.0049546 0.0016543 -0.0183491 0.0041999 0.001675 0.0016722 -0.0008358 0.0008358 -0.0058651 0.0016793 -0.00252 0.0050336 0.021524 0.0032706 0.005698 -0.003252 0.0056841 0.0008094 -0.0008094 0.0016181 0 -0.0016181 0.0008094 0.0040371 0.0008055 0.0056202 0.0063847 0.0055534 -0.0055534 -0.0023895 0.0015936 -0.0007965 -0.0063949 0.0024029 0 0.0007997 -0.0016 -0.0145164 -0.0321943 -0.0033613 0.0166949 -0.0192233 -0.0144499 -0.018143 0.0215619 0.0059549 -0.0033985 -0.0102653 -0.0017212 -0.0008617 0.0094381 0.0076564 -0.0059499 0.009334 0 -0.002537 0.0059097 0.0033613 -0.0008393 -0.0084318 -0.0076498 -0.0102917 0.0077287 0.0017094 0.0034101 -0.0068318 0.0008565 -0.0008565 0.0110781 0.0033841 0 -0.0016906 0.0016906 0.0008442 -0.0059247 0.0109752 0.0016779 -0.0008386 -0.0008393 -0.0016807 0.0016807 0.0058602 0.0099669 0.0090498 0.0016367 0.0008173 -0.002454 -0.0090498 0 -0.0008268 -0.007472 -0.0016681 0.002501 0.0058116 0.0008275 -0.0008275 -0.0049793 -0.0041684 -0.0117648 -0.0136172 0.0042753 0.0059549 -0.0076629 0 0.0042644 0.0067854 0.0033755 -0.0016863 0.0050505 0.0033529 -0.0092476 0.0042141 0 -0.0008414 0.0033613 0.0058553 -0.0025052 -0.0041894 0.0008393 0 -0.0118145 -0.0085252 -0.0077353 0.0008624 -0.0297485 0.0035461 0.0096874 -0.0105728 -0.0035492 0 -0.0044544 -0.0062696 0.0026918 0.0124668 0.004415 -0.0008814 -0.0035336 -0.0053239 -0.0080393 -0.0026942 -0.0117595 0.002726 0.0099324 0.0080537 0.0008909 0.0008901 0.0035524 0.0088262 0.0104896 -0.0061056 0.0052356 0.0026076 -0.0034783 -0.0026167 -0.0008737 0.005231 0.0052038 0.0043159 0.0025806 -0.0025806 -0.0008617 -0.0008624 0.0017241 -0.0017241 -0.0095363 0 0.0181274 -0.0017123 -0.0008573 0.0127824 0.0109475 -0.0041964 -0.0016835 0.0016835 -0.0033698 0.0058898 -0.006734 -0.002537 0.0042248 0.0050463 -0.0016793 -0.0025242 0.0008421 0 0.0016821 0.0016793 -0.00252 -0.0008414 -0.0101524 -0.0017021 0.0059448 0 0.0033812 -0.0016892 -0.0025391 -0.0085107 -0.0085837 0.0025829 -0.0060371 0.0094706 0 0.0068318 -0.0008514 0 0.0067912 -0.0025413 0.0067625 -0.007611 0 -0.0016992 0.0084675 0.0016849 0 0 0.0008414 -0.0059047 0.0042212 0.0008421 0.0016821 0 0.0025178 0.0066834 0.0082919 -0.0024804 0.0016543 0.0033003 0.0082035 -0.0016353 0.004898 0.000814 0.001626 -0.004886 -0.00409 0.00409 -0.001634 -0.0106865 0.0024763 -0.0016502 -0.0008261 -0.0099669 -0.0025073 0.0066723 -0.0008316 0.0016625 -0.0066667 0.0008358 0.0008351 0.0049958 0.0024886 -0.0008288 0 -0.0066556 -0.0025073 0 0.0025073 -0.0033445 -0.0177444 -0.0034159 0.0076694 0.0016964 -0.0008478 -0.0102303 0.0017123 0.0059702 0.0042427 0.0050676 0 0.0075535 -0.0008365 0.0066723 -0.0016639 0.0058116 0.0016543 -0.0008268 -0.0008275 0 0.0008275 -0.007472 -0.0016681 0.0008344 0.0008337 0.0066445 0.0016543 0.0016515 0.0008247 0 0.0032922 0.0041 -0.001638 0.001638 0.002452 0.0016313 0.0064988 -0.0032441 -0.0008127 0.0008127 -0.00652 0.00652 -0.0008127 -0.0040733 0.0016313 0.0048781 0.0176853 0.0071457 0.001581 0.005514 0.007045 0.0031153 0.0069741 0.0015432 -0.0023157 -0.0015468 -0.0015492 0.0007749 0.0054075 0.0030769 -0.0053908 -0.0007725 0.0030864 0.0007701 0.0091955 0.0053252 -0.0038008 0.0022822 0.0053051 0.0030189 -0.0015083 0.0015083 -0.003775 0.0007561 0.0007556 -0.0106303 -0.0092025 0.0069098 -0.0084518 -0.0139862 -0.009434 0.0031546 0.0078432 -0.0023465 0 -0.0054967 0 0.0007871 0.0054924 0.0023447 -0.0062647 -0.0094713 0.0023762 0.0023706 -0.0039541 0.0047431 0.0078555 0.0039047 0.0015576 0 -0.0007785 0.004662 0.0061824 0.0046118 -0.0046118 -0.0069579 0.0015504 -0.006216 -0.002341 0 0.0031201 0.0023337 -0.0038926 0.0031153 -0.0062403 -0.0245557 -0.0032129 -0.0016103 0 0.0056248 0.0047962 -0.0096155 -0.005652 0.0080646 0.0048077 0.0015974 0.0087406 0.001581 -0.0031646 0.0023744 0.0031571 0.005501 -0.0023539 0 -0.0031471 0.0039324 0.0031348 0.0015637 0 0.0054539 0.0061968 0.0015432 0.0023104 -0.0084975 0.0030984 0.0061681 0.0007683 -0.0007683 -0.0046225 0.0038536 0.0053702 -0.002298 -0.0015349 0.0007678 -0.0178092 0.002341 0 -0.0078248 0.0015699 0.0031323 -0.0023483 0.0015662 0.0039047 0.0054411 -0.0007755 0.0023247 0.0030912 -0.0015444 0.0023157 0.0007707 -0.0085107 -0.0125099 -0.0023631 0.0007883 -0.0015773 0.002365 0.0015736 0.0070506 0.0007803 -0.0054752 0.000784 0.0023483 -0.0007822 0.0054624 -0.0015576 -0.002341 0.002341 0.006216 0.0038655 0 0.0023121 0.0076687 0.0045732 0.0015198 -0.0022805 -0.0030488 0.0030488 0.0098448 0.001506 -0.0075529 0.003028 -0.006826 -0.0022857 0.0007625 0.002284 -0.0091674 -0.0046154 0.0099732 0.0136469 0 0.003758 0.0104479 0.0014837 -0.0022263 -0.001487 0.0103628 0.0007361 0.0073314 -0.0007307 -0.0029283 0.0007329 -0.007353 -0.0007383 0.006625 -0.0044118 -0.0096261 -0.006719 -0.0037523 -0.0067899 0.0030234 0.0060196 0.0097052 0.0044477 0.0014782 -0.0059259 0.0007427 0.0022247 0.0073801 0.0036697 0.0036563 0.0021874 0.0021826 0 -0.0058309 0.0014609 0.014493 0.0050233 0.0071327 -0.0014225 0.0014225 0.0063762 0.0035249 -0.0014085 -0.0021164 -0.0028289 -0.0021269 0.0077766 0.0070176 0.0013976 -0.0063047 0 0.0049071 0.0048832 0.0006957 -0.0182461 -0.0214754 0.0072098 0.0050161 0 0.0014286 0.0042735 0.0014205 0 -0.005694 -0.0136545 -0.0094512 -0.0007307 0.0043764 -0.008772 -0.0170311 0.0059568 0.0081331 0.0022067 0.0022018 0.0094857 0.0014514 -0.0014514 -0.0072887 0.0072887 0.0050706 -0.00217 0.003614 0.0143269 -0.0007115 0.0106196 0.0202168 0.0013793 0.0096023 -0.0096023 -0.0013793 0.0041322 0.0054832 0.0047733 -0.0020429 -0.0020471 0.00409 0.0061038 0.003375 -0.003375 -0.0013532 0.0067477 0.0033568 0.0020087 -0.0013387 0.0020074 -0.0100773 -0.0129122 0 0.0074958 -0.006812 0.0034118 0.000681 0.0054311 0.0067477 0.0013441 -0.0047122 -0.000675 -0.0074551 0 0.0061038 0.0053945 0.0107024 0.0053086 -0.0066401 0.0013316 0.001994 -0.0006642 -0.0013298 -0.0046682 0.0006682 -0.0026756 0.0006696 -0.0033523 0.0020127 0.0046807 0.0039947 0.0033168 0.0019848 -0.0026473 0.0013245 0.004622 0.0052563 0.0013098 0.001308 0.0032626 0.0013021 -0.0013021 -0.0204022 -0.0113676 0.0060342 0.0046682 0 -0.0113752 0.0033591 0.0086812 0.0039814 -0.0033168 0.0026543 -0.0026543 -0.0073358 -0.022336 -0.0034282 0.0068447 0 -0.0102846 0.0020654 0.0095826 -0.0206477 0.0048561 0.0103271 0.0041012 0.0013633 -0.0040956 0.0040956 0.0027211 -0.0136801 0.002064 0.0163603 -0.0006764 -0.0115687 0.0061413 -0.005457 -0.0151622 0.004158 0.0068918 0.0197218 0.0133781 0.0145121 0.003269 -0.0013063 0.0032626 -0.0131149 0.0234844 0.0012887 0.0134316 -0.0006355 0.0019054 0.0012682 0.0063171 0.0043984 0 -0.0056586 -0.0190967 -0.0032185 0.01979 0.009437 0.00375 -0.0050031 -0.0018826 -0.0006283 0.0012563 -0.0006279 -0.003776 0.0119086 0.0068302 0.0104649 0 -0.0018388 0 0.004896 0.0048721 0.0024272 0.0024213 0.003621 -0.0012055 0.000603 0 0.0042105 0.003595 -0.0078055 0.0036101 0.0035971 -0.0078102 -0.0151932 0.004887 0.0048632 -0.0079148 0.0012217 0.0163491 0.0131267 -0.0005929 -0.0005933 0.005327 0.0117372 -0.0035067 0.0011703 0 -0.0035149 -0.0052957 0.0076404 0.0075824 0 -0.0011628 0.0046431 -0.0145818 -0.0100385 -0.0071471 0.0124742 0.0123205 -0.0052616 -0.00176 0.0093513 0.0058005 0.0086381 -0.0011474 -0.0005742 0.0051561 0.0022831 0.0062518 0.0016983 -0.002265 -0.0154245 -0.0046163 0.0011561 0.0017316 -0.0233383 0.0094008 0 -0.0064535 -0.0005888 0.0111275 0.0138811 -0.007495 0.0017346 0.0028843 0 -0.0063566 0.0011587 -0.0023188 0.0040545 0.0005779 0.0217151 0.0145906 0.006663 0.0033149 -0.0038685 0.0148395 0.0016353 0.0010887 -0.0021787 -0.0021834 -0.0109891 -0.02009 0.0067416 0.0116895 0.0027632 -0.001657 0.0005526 0.0283243 0.0026817 -0.0059092 0.0005386 0.0037624 0.0037483 -0.0048219 0.0042873 -0.0069761 0 -0.0010776 -0.0092067 -0.0076461 -0.014357 0.0060993 0.0191629 0.0107876 -0.0140467 -0.0376985 -0.0188201 0.0199494 -0.0467888 -0.0059312 0.0200242 0.0075516 -0.0040592 -0.0064121 -0.000585 0.0104774 -0.0046431 0.0086882 0.0086133 0.0017138 -0.008023 0.0022989 -0.0156208 -0.0035047 0.0110563 0.0086431 0.008 -0.0068533 0.0074222 0.0068027 0 0.0050719 0.0156166 -0.0005536 -0.0061094 -0.0011148 0.0061162 0.0022148 -0.0011068 0.0005536 0.01701 0.0108226 -0.0021552 0 0.0043057 0.0138669 -0.0037145 -0.0021288 0 -0.00695 -0.0010735 0.0133371 -0.0015911 0.0031797 0 -0.0010588 -0.0021209 -0.0101361 -0.0059156 0.0021552 0.0085745 -0.0010678 0.0021345 -0.0026688 -0.0048219 -0.00863 -0.0027122 -0.0081811 0.0135983 -0.0021633 -0.0016256 0.0161381 0.0058526 -0.0031881 -0.0064069 -0.0075269 0.0059188 -0.0021482 -0.0043104 0.0064586 0.0021436 0.0064034 -0.0010644 0 0.0074271 0.0146907 0.0026008 -0.003643 -0.006801 -0.0063191 -0.0058278 -0.0005315 0.0005315 0.0015928 -0.0106668 0.0021425 0.0058682 -0.0005321 0.0010638 -0.0139189 -0.0059476 -0.0224852 0.0110316 0.0021918 -0.0071409 -0.0016552 0.0153428 0.0021727 0.0059508 -0.0005395 -0.002161 -0.0032503 -0.0038054 0.0054318 0.0016238 -0.005423 -0.0065467 -0.0176703 0.0011136 0.0055494 -0.0016616 -0.0033315 -0.0027847 -0.03058 0.0011494 0.0051561 0.005698 0.0034033 0.0056465 0.0111983 0.0027801 0.0005551 -0.006123 -0.0027956 0.0094735 0.0044272 -0.0033186 0.0016607 0.0082622 -0.001647 -0.0116055 -0.0083729 -0.001683 0.0055991 -0.0095372 -0.0101984 0.0011383 -0.0062768 -0.0319888 -0.0112928 0.0017916 -0.0065849 -0.0696366 -0.0045176 0.0337075 -0.0094251 -0.0538217 -0.0283803 0.0310416 -0.0019953 0.0191236 0.0058613 -0.0078227 -0.0319176 -0.0322719 0.0248117 -0.0192446 0.0212847 0.0254876 0.0111954 -0.0105333 -0.0099768 -0.0026774 0.0080107 -0.0039973 -0.0114133 -0.0074551 0 -0.011632 -0.0286232 0.014763 0.020719 0.0054533 0.0393253 -0.0039293 -0.0152069 -0.0026684 -0.0026756 0.0046776 -0.0080322 -0.0074199 0.0006768 -0.0054274 -0.0006805 -0.0206335 -0.0090751 0.0041987 0.0356691 0.0153798 0.0072728 0.0098329 -0.0440071 0.0081467 0.0040486 0.0120483 -0.006006 -0.0087396 0.0053872 -0.0108036 -0.0006791 -0.0095564 -0.0006861 -0.0075784 -0.0174403 -0.0056457 0.014055 -0.0013966 0.0097358 0.0068966 0.008895 -0.0006814 -0.0158025 0.0034566 0.0157484 -0.0054496 0.00409 0.0074551 0.0338565 0 0.0026076 -0.0137662 0.0013193 0.0052597 -0.000656 -0.0039448 0.0019743 0.0156559 0.003231 0.0025773 -0.0084007 -0.0025991 -0.0104645 -0.0013158 0.001973 -0.0032906 0.008533 -0.0065574 0.0039396 0.0026178 0.0091087 -0.0078024 0.0058575 0.0019449 -0.013038 -0.0145409 -0.0147555 0.0047186 -0.0067477 0.0006768 0.0194311 0.0099043 -0.0132277 -0.0033344 0.0046651 0.009924 0.0013158 -0.0019743 0.010485 0.0084389 0.0115683 -0.0032 0.0038388 0.0050956 0.0038047 0.0018969 0.0056693 -0.003776 0.0162605 0.0049505 -0.0093024 0.0055918 -0.0130965 -0.0044039 -0.0006307 0.001891 0 -0.0120369 0.0019102 0.0050762 -0.0082619 -0.0128454 -0.0110498 0.011696 -0.0032352 0.0006479 -0.0019449 0 0.011613 0.0038412 -0.0318105 -0.0039656 -0.0059781 -0.0086986 0.0060302 -0.0026756 -0.0100977 -0.0006768 0.0033795 0.012739 0.0046527 -0.0006633 0.0118735 0.0006555 -0.0098782 -0.0059741 0.0138845 0.0111003 -0.0045558 -0.0013055 -0.0091864 0.0039474 -0.0006568 -0.0026316 -0.000659 -0.0079418 -0.0147258 -0.0006745 0.0006745 -0.007445 -0.0109291 -0.0292704 0.000707 0.0098454 -0.0014006 -0.0126941 0.0175875 0.0076416 0.0075836 0.0013727 -0.006192 -0.0069252 0.0006947 -0.0020855 0.0020855 0.0124225 0.0075163 0.0067843 0.003375 0.0006736 -0.0108329 -0.000681 -0.0054645 0.0020527 0.0020485 -0.0137365 -0.0216716 -0.0028309 0.0091711 -0.0198588 -0.0180706 0.0043668 0.0043478 0.0186252 0.0070722 0.0007045 0.000704 -0.0049383 -0.0014154 0.0154606 0.0076416 -0.0104349 0.0138891 -0.0069204 -0.0006947 0.0076151 -0.0055325 0.0096619 0.0230832 -0.0053836 0.0107384 0.0026667 -0.0040027 0 0.0119603 0.0013201 0.0052632 -0.0198814 0.008 0.0039761 0 0.0059347 0.0163029 -0.0012945 0.0103094 0.0006408 0.0038363 -0.0096185 0.0102565 0.0120445 0.0056551 -0.0018815 -0.0006279 -0.0107358 0.0063291 -0.0031596 0.0044206 0.0050283 0.0106019 -0.0024845 -0.0087446 -0.022202 -0.0045002 0.0153456 0.0025349 -0.0114578 0.0031959 -0.0031959 0.0012796 -0.0135181 -0.006502 0.006502 0.0058158 -0.0032269 0.0070854 -0.005148 -0.002584 -0.0045381 0.0025957 0.0012953 -0.0143418 0 0.0013123 -0.0019692 0.0065488 0.0032584 -0.0026059 -0.0124714 -0.0026455 -0.0160217 0.0020168 0.0093584 0.0006651 -0.00333 -0.0040107 0.0093334 0.0131841 -0.003937 -0.0006577 -0.0013167 -0.0166062 0.0040107 -0.0060221 -0.0033613 0.0060423 0.0113146 0.0033036 0.0006594 0.0046038 0.0013115 0.0013098 0 -0.0078844 0.0065746 0.001964 0.0013072 0.0155544 0.002569 -0.0012837 0.0006421 0.0070355 0.0063533 -0.0019017 -0.0044515 0.0006371 -0.0128207 0.0012895 0.0006441 0.0006437 -0.0032227 -0.010383 0.006502 0.0032352 -0.0012928 -0.0077922 0 -0.0019576 0.0013055 0.0026059 -0.0039113 -0.0098458 0.0019769 0 0 0.0072155 0.002611 0.0045529 -0.005205 -0.0006525 -0.0052356 -0.0026281 -0.0046159 -0.0099635 0.0006673 0.0053227 0.0013263 -0.009321 -0.0060383 -0.0155988 -0.001368 0.0108919 0.0033795 0.0013486 -0.0006741 0.00739 0.0066711 0.0046435 -0.0013245 0.0019861 -0.0033124 0.0033124 0.0092167 -0.0039396 0.0039396 -0.0006555 -0.0085611 -0.0013236 -0.0039814 0.011897 0.0052425 0.002611 -0.0091684 -0.0032949 0.0052666 0.005239 -0.005239 0.0019679 -0.0059152 -0.0146085 0 -0.0046933 -0.0006723 -0.0006727 -0.0108255 0.00068 -0.0116241 -0.0082873 -0.0048662 0.0006966 -0.0027894 0.0013957 0.0104059 0.0109816 0.0020457 0.000681 0.0013605 -0.0061371 -0.0186405 -0.010508 -0.0007045 0.0070225 0.0013986 -0.0297894 -0.0007202 -0.0021637 -0.0007223 0.0143474 0 0.000712 -0.0021375 -0.0042888 0.0007161 0.0021452 0.0049875 -0.0064171 -0.0035829 0.0050125 0.0049875 0.0063762 0.000706 -0.0063717 0.0021284 0.0035373 -0.0085107 -0.0064309 0.0042919 -0.0014286 0 0.0057021 -0.000711 -0.0157709 0.0079166 0.0057184 0.0204593 0.0248289 0.0013615 0 -0.0006805 0.0040761 -0.002036 -0.0013596 0.0114983 0.0140236 0.002649 0.0019822 0 0.0019782 0.006566 -0.0032776 0.002623 0.0013089 0.0006538 -0.001308 0.001308 -0.001308 0.0065232 0.0032457 -0.0006483 0.0032373 -0.0006466 0.0051613 0.0089687 0.0063573 -0.0012682 -0.0140577 0.0006433 0.0012853 -0.0032165 -0.0025806 -0.0025873 0.0103094 -0.0006412 -0.0057897 0.0083521 0.0057416 0.0019066 0.0038023 0.0031576 0.0012602 0.0075283 0.0240827 0.0097147 0.0036188 -0.0133335 -0.001221 0.0054828 0.0024272 0.0018165 0.0006048 -0.0006048 0.0090335 0 0.0005993 0.0029913 0.001194 -0.0023895 -0.0078055 -0.0030184 0.016787 0.0041531 0.0005919 0.0029542 0.0011792 0.0052895 -0.0029351 -0.0011765 -0.0017673 -0.0100742 -0.0017884 0.0100921 -0.0023655 -0.0035587 -0.0131581 0.0048048 0.0029913 -0.0023923 0.0089419 0 -0.0035672 0.0011905 0.0065224 -0.0023669 -0.0059418 0.0011912 -0.0192314 -0.0140546 -0.0331591 0.0151518 0.0081124 0.0074304 0.0036946 -0.0092622 0.0104907 -0.0067755 -0.0080671 -0.0125393 0 0.0031496 0.0156009 -0.0037221 0.0018628 -0.0099751 -0.0138803 -0.0044572 0.0025494 -0.0006367 0.0025445 0.0119989 0 0.0031338 0.0105821 -0.0130884 0.0050063 -0.0018744 0.0031221 0.0043546 -0.0081023 -0.000626 0.0118271 0.0049383 0.0018456 0.004905 -0.0172737 -0.0163115 0.0012642 -0.0082462 0.0076142 -0.001265 0 -0.0044402 -0.0186082 0.0070991 0.002569 -0.0019262 0.0025674 -0.0266336 0.0111294 0.0122939 -0.003866 0.0115534 0.0050923 0.0063291 -0.0018945 0.0012634 0.0056657 -0.001885 0 0 0.0118789 0.0031027 -0.0012399 0.0012399 0.0030931 0.0055436 0.0036787 0.0012232 0.0151656 0.0036058 -0.0054135 0.000603 -0.0012063 -0.0066606 0.0024272 0.0024213 0.009627 -0.0472046 0.0130965 -0.044987 0.0051713 -0.000645 -0.0321234 -0.0006664 0.0026631 0.0046435 0.0105333 -0.0006551 -0.0026247 0.0026247 0.0032712 0.0013055 -0.0078586 -0.0013158 -0.0186052 0 0 -0.0080809 -0.0027082 0.0174736 -0.0006664 0.0086293 0.0079 -0.0013123 0.0006564 -0.0026281 -0.0019756 0.0032906 0.0072013 0 -0.0052322 -0.0052597 -0.0006594 0.002635 -0.0006581 0 -0.0032971 0.0006603 0 0.006579 -0.0039422 -0.007268 0.0131754 0 -0.0052494 -0.0165841 0.0053369 0.0086122 0.0221796 0.0070717 0.0006404 -0.0070672 -0.000645 -0.0019374 -0.0051847 -0.0097944 0.0032755 0.0058689 0 0.0038936 0.0038785 -0.0019374 0.0025823 -0.0045234 -0.0071499 -0.0026127 -0.0026195 -0.0032841 0.0019717 -0.0006568 0.0078534 0.0006517 -0.0019563 -0.0151269 -0.0160324 -0.006079 -0.0040733 0.0054274 -0.0136242 -0.0013727 0.0034282 0.0027341 0.0054459 0.0067659 -0.0027009 -0.0020305 -0.0013559 -0.0095434 -0.0124054 -0.0027778 0.0048561 0.011696 0.0061371 -0.0027229 -0.0013643 0.0013643 0.009498 0.0033704 0.0020168 -0.0020168 0.0006727 0.0100369 0.0026596 0.0006638 -0.00599 -0.0040134 0.0033456 -0.002006 -0.002681 -0.0020155 -0.0067477 0.0121132 0.0013369 -0.0053584 0 0.0026828 0.0192377 -0.0006572 -0.0099109 -0.008 0.004008 -0.0013342 -0.001336 -0.0026774 0.00067 0.0026756 0.0026684 -0.0013333 0.0026649 -0.0006656 -0.0019993 0.0039947 0.001328 -0.0039894 -0.0026684 -0.0168411 -0.0013596 0.0027174 -0.0040789 0.0054348 0 -0.0047538 0.0013605 0.0020374 0.00271 0.0047249 0.0113828 -0.000666 -0.0060141 -0.0006705 -0.0020141 -0.0040404 0.0020222 0.0013459 0.0006723 0.0020141 0.0033478 -0.0020074 -0.0026828 -0.0060627 -0.004741 -0.0006791 -0.0095564 -0.0055021 0.004816 -0.0006866 -0.00344 -0.0223006 -0.0035298 0 -0.0063853 -0.0165056 0.0014461 0.0064818 0 -0.0086518 -0.0190064 0.0066201 0.0188822 -0.0036036 0.001443 0.0143166 0.0007105 -0.002845 0.0049734 0.0014164 -0.000708 -0.0085349 0.006408 0.0049558 0.0070373 0.0055944 0.0124742 0 -0.0006889 0 0.0068682 0.0115687 0.0006764 -0.0020305 0.0027064 0.009415 0.002006 -0.004687 -0.0006714 0.0033523 0.008 0 -0.0013289 0 0.0053051 0.002642 -0.0006598 -0.001321 0.0144359 0.0103695 -0.0090674 0.004544 -0.0032436 -0.0045588 -0.0045797 0.0026195 0.011057 0.002584 -0.0058234 -0.0025991 -0.0130978 0.000659 0.0026316 0.0039344 -0.0105264 0.0059347 0.0006572 0.0058959 -0.0013072 -0.0006542 0.0065232 0.0019487 -0.0006491 0.007762 0.0140757 -0.0006355 -0.007658 0.003198 -0.0070491 -0.0234233 0.0143793 0.0058234 0.004506 -0.0025723 -0.007757 0.007757 0.0057785 -0.0025641 -0.0038585 0.0051414 0.0095695 0.001903 0.0037951 0.0006311 0.0006307 -0.0018933 0.0088051 0 -0.0037641 -0.0012579 -0.0101203 0.0069687 0.0056657 -0.001885 -0.0031496 0.0006307 0.0006303 0.0050283 0.0068729 0.0055883 -0.0043438 0.0031046 -0.0055953 0.0099256 0.0079927 -0.0024525 -0.0049231 0.0006167 -0.003706 0.0012369 -0.0024752 -0.0006198 -0.0062189 -0.0176216 0.005698 0.0075472 0.0112151 0.0024752 -0.0068217 0.0049659 0.0024737 -0.0055745 0.0024814 -0.0055918 -0.0018709 0.0024938 0.0055883 0.0080173 0.0079535 0 -0.0012195 0.0024375 0 -0.0006088 0.0018254 0.0072684 0.0042156 0.0018013 0.0005997 -0.0011998 -0.0012012 -0.0030093 -0.0036232 -0.0024228 0.0090553 0 -0.0036123 0.0048135 0.0011998 0.0065731 -0.0017884 -0.0059845 0.01134 0.0047365 0.002949 0.0064573 -0.0005853 -0.0029317 0.003517 -0.0194984 -0.0053844 -0.0012005 0.0041954 0.0083383 -0.0005933 0.0011862 0.0017767 0.0023641 -0.0011813 -0.0035524 -0.0071429 -0.0005976 0.0053651 0.004745 0.0070755 0.0017611 0 0.0105018 0.0034762 0.0034642 -0.0017306 -0.0052099 -0.0011614 0.0040592 -0.0023175 -0.0011608 -0.009335 0 -0.0041116 0.0093732 0.0046539 -0.0017427 -0.0017457 0.0023269 0.0040592 -0.0011581 0.0011581 -0.0034783 0.0011608 -0.0005802 0.0034762 0.0023108 -0.0005772 -0.0069525 -0.0005816 -0.0070053 0.001171 0.0029214 -0.0011675 0.0075648 0.0115275 0.0022896 -0.0022896 0.0022896 -0.0028629 0.0005732 0.0057143 0.0005696 0 0.0028433 -0.0085544 0.0040011 -0.0051473 -0.0080599 -0.0005782 0.0028877 0.0108977 0.0011403 0.004548 0.0084722 0.0022472 0.0016821 -0.005618 0.0106473 0.0022272 -0.001113 -0.0055835 0.0011192 0.0083543 0.0011086 -0.0066704 0.0016718 0 -0.0072646 0 -0.0039337 0.0056148 0.0055835 0.006106 0.0082668 -0.0060556 0.0087961 -0.0082441 0.0055036 0.0060192 -0.0032787 0 0.0010941 0 -0.0060324 0.0010995 0.0032913 0.0098093 0.004329 0.0021575 0.0064447 0.002139 -0.0064309 0.0058966 -0.0010695 0 -0.0010707 -0.0010718 0.0037463 0.0032 -0.0005326 0.001065 -0.0101632 0.0149416 0.0026448 0.0110324 0.00625 0.0072427 -0.007762 -0.0141253 -0.0026378 0.0021108 -0.0026392 -0.0047682 0.0089876 0.0083858 -0.0010444 -0.0553161 -0.0111051 0.0111051 -0.0376979 0.0142331 -0.0028305 0.009591 0.0055991 -0.0134909 -0.0045377 -0.0154687 -0.026325 -0.0107272 0.0107272 -0.0113265 0.0225261 0.0174322 0.0142982 -0.0011364 -0.0062732 -0.0144053 0.0023188 0.01323 0.0107986 0.0084436 0.0100391 -0.0038921 0.0022259 0.0083034 0.0147746 0.0027122 0.0080928 -0.00701 -0.0108815 0.0005469 0.0016389 0.0010911 0.0108461 0.0075229 0.0010701 -0.0010701 0.0074667 -0.0015953 -0.0133943 -0.0005395 0.0005395 -0.0059508 -0.0005427 0.0070328 0.0069836 -0.0075229 0.0026932 0.00857 -0.0074947 0.0138743 0.0115913 0.0047034 0.0057188 0.0041387 -0.0031024 -0.0051921 0.0082945 0.0036073 -0.0010293 -0.0145231 0.014008 0.0005151 0.0015436 0.0122638 -0.0015248 0.0171462 -0.0055152 0.0114973 0.0019861 -0.0079682 -0.0110609 0.0040363 -0.0005037 -0.0065707 -0.0005072 0.009091 0.0060151 0.0004996 -0.0030015 0.0025019 -0.0025019 0.005994 -0.0014951 -0.0221895 0.008126 0.0010111 -0.0091371 -0.0040879 0.0015349 0.0086537 0.0060637 -0.0035327 -0.0214622 0.0102776 0.0116901 0.007551 0.0035044 -0.0075245 -0.0020161 -0.0050582 0.0070743 0.0050226 -0.0015041 -0.0025119 0.0139862 0.0079052 -0.0019704 -0.0049432 -0.0312054 -0.0097612 0.0072017 0.007659 -0.0061225 -0.0280247 0.0161841 0.007224 -0.002574 0 0.0051414 0.0112189 -0.0020305 -0.0005083 -0.0122764 -0.00516 0.01591 0.0106357 0.0055263 0.0005009 0.0005006 0.0044944 -0.0075019 0.0188966 0.0039331 0.0024504 -0.0009794 0.0174847 -0.0038591 0.0086622 0 0.000479 0.0057307 0.005698 -0.0128665 0.0161754 -0.0037825 -0.0004738 0.009434 0.0074837 0.0041851 -0.0069849 -0.0018709 0.0023381 -0.0108008 0.00377 -0.0047148 -0.0061626 0.0108774 0.0126199 0.0064815 0.0032251 -0.0036866 0.0050656 0.0086897 0.0054496 0.0054201 -0.0036101 -0.0058944 0.0045372 0.003615 0.0018026 -0.0013517 -0.0027088 -0.0054397 0.0058917 0.0009033 -0.0145523 -0.001834 0.0032073 0.002741 0.0018232 -0.0013671 -0.0077821 0.0018365 0.002291 0.0036546 0.0004559 -0.0068603 0 0.0032073 0.0041087 0 -0.001824 -0.0096309 -0.0134542 -0.0075012 0.0018806 0.016306 0.0013854 -0.0050891 -0.001857 0.0055607 0.0041503 -0.0120372 0.0027907 -0.0009294 -0.0116906 0.0032872 0.0070077 -0.0037313 -0.0037453 -0.0028182 0.0065635 0.0134604 0.0013822 -0.0018433 0 -0.0013847 -0.000462 0.0087417 0.0118398 0.0049673 -0.0072333 0.002266 0.0018091 -0.0040752 0 0.0004536 0 -0.00409 0.0004553 0.008611 0.0103256 0.0017849 0 0.0044484 0.0039867 0.0083646 -0.0017552 -0.0035196 -0.0026478 -0.0008842 0.001326 -0.0057586 -0.0080286 -0.0049383 -0.0018018 -0.0191176 -0.0032221 0.0100918 -0.0184252 0.0018579 -0.0041851 -0.0046707 -0.0094074 -0.005212 -0.0009506 0.0023747 0.006148 0.006579 0.007931 -0.0018605 -0.0112361 0.0042283 0.0070077 0.0037175 -0.003252 0.0055685 -0.0041734 0.0013931 0.0133673 0.0091158 0.0004536 -0.0013615 -0.005008 -0.005951 -0.0106163 -0.0121383 0.0004696 0.003281 -0.012715 -0.0066572 0.0066572 0.0061422 0.0191282 0 0.0041503 -0.0046126 0.0023089 0.0055198 0.008223 -0.0114392 0.0087057 -0.0018265 -0.0018298 0.0018298 0.0100046 0.0152675 -0.0053619 0.0066979 0.0026667 0.0044287 -0.0102155 0.0048987 0.0136777 0.0013138 0.0069778 0.0008688 -0.0043516 -0.0039327 -0.0021915 0.0004387 -0.0043956 0.0039569 0.0035042 0.0030561 -0.000436 -0.0043706 -0.0035103 0.0065718 -0.0008737 -0.001312 0.0021858 0.0078295 0.0069085 0.0017197 0 0.0059957 0.0021327 0.0025532 0.0038176 -0.0050934 0.0042463 0.0046502 -0.0008439 -0.0029592 -0.0012709 0 -0.0008482 -0.0072387 -0.0042827 0.0034276 0.0008551 -0.005571 -0.0004298 0.0089879 0.0072172 0.0063251 -0.0029468 0.0025263 -0.0004206 -0.0008418 -0.0042194 -0.0016928 0.0038047 0.0042105 0.0020986 -0.0033599 -0.0033713 -0.0008446 -0.0148971 -0.0081809 -0.0165653 0.0039482 0.0082843 -0.0030441 -0.0065545 -0.0159084 0.0106337 -0.001323 0.0122809 0.0069505 -0.0073865 -0.0083206 0.0035119 -0.0145666 -0.0008897 0.0123841 0.006135 -0.0043783 0.0026293 -0.0004377 -0.000876 0.000876 -0.0048277 -0.0022022 -0.0017652 -0.0106573 -0.0044743 0.0058127 0.0102019 -0.002209 0.0026502 0.0092207 0.0026189 0.0030468 0.0056338 -0.0030296 0.0116356 0.0017123 0.0012823 0.0004271 -0.005137 0.0029998 0.0008554 -0.0008554 -0.000428 0.0021381 0.0034115 0.0033999 0 -0.0025489 0.0008503 0.0004249 -0.0042571 0.0089192 0.0016899 0 0.0033713 0.0012613 0.0033557 0.0016736 0.0008358 -0.0012539 -0.0037712 -0.0033642 0.005042 0.0050167 0.0033306 0.0041477 -0.0041477 0.0012461 0.0045558 0.002064 0.0032935 0.005329 0.0081434 -0.0048781 0.0008147 -0.0004072 0.001628 0.000813 -0.0016267 -0.0139347 -0.0037213 0.0066061 0.0045165 -0.0119515 -0.0004147 0.0028992 -0.0028992 0.0053775 0.0004125 -0.0057899 -0.0079118 -0.0020925 -0.000419 -0.0008386 -0.0042035 -0.0161362 -0.0116255 0.003027 0.0085985 -0.0055806 -0.0034498 0.0012951 0.0047342 -0.0012889 0.0051458 -0.0038569 0.0166067 0.0012661 -0.0008439 0.0012656 0.0021057 -0.0071776 0.0008471 0.0046463 0.0008425 0 0.0033628 0.0037696 -0.0020925 -0.0020969 0.0029344 0.0016729 0.0004178 -0.0004178 -0.0058676 -0.0004204 0.0087922 0.0078888 0.0065952 0.0012318 -0.007827 -0.0024845 0 -0.0041546 -0.000833 -0.0083682 0.0046112 0.0012539 0.007076 0.0016577 -0.0083161 -0.0126052 -0.0029642 -0.0072356 0.0038371 0.0004254 0.0076272 -0.0046541 -0.0042499 -0.0021317 0.0046838 0.0016978 -0.0012731 -0.002551 -0.0072634 -0.006453 0.016692 0.0012725 0.002963 0.0004226 0.0058972 0.0020978 -0.0008386 -0.0016793 -0.0021031 0.0012624 -0.0042141 -0.0033841 -0.0016964 0 0.00212 0.005491 0.0016835 0.0054519 -0.0008368 0 0.0020907 -0.0025094 -0.0016764 0.0008386 -0.0025178 -0.0008407 0.0071234 0.0062435 0.0066171 0.004524 -0.0057613 0.0032963 0 0.0024651 -0.0028765 0.0012338 0.0041017 0.0032693 0.0032587 -0.0012208 0.0016273 0.0024361 0.003643 0.0032271 0.0052219 0.0063898 -0.0023914 -0.0003991 -0.0031987 -0.0004006 -0.0040145 -0.0020133 0.0068287 0.0019996 0.0051803 0 -0.0043816 -0.0080161 0.0040161 0.002002 0.0043903 0.0051639 -0.0031746 0.0015886 0.0023781 0.0043453 0.0011818 0.0019666 -0.0007862 0.001179 -0.0007859 0.0031397 0.0011749 -0.0011749 -0.0082629 -0.001186 0 -0.0031696 -0.0103711 -0.0020068 0.0024077 0.0012017 0.0004002 -0.0048135 -0.0016097 0.0044203 0.0012022 0.0024 0.0047828 0.0039683 -0.0003961 -0.0011893 -0.0039746 -0.0100061 -0.0068618 0.0012143 -0.0004046 -0.0105778 0.0032666 0.0020362 -0.0028519 0.002445 0.0008137 0.0044634 0.0036371 0.0008065 -0.0032297 -0.0020239 -0.0056888 -0.002448 0.0016327 -0.000816 -0.002452 -0.001638 0.00735 -0.0004069 -0.0008143 -0.0028554 -0.0173057 -0.0062539 0.0120559 -0.0028968 -0.0024896 -0.0112807 0.0029369 0.0066806 0.0024938 0.0016591 0.0008285 0 0.0152047 0.0032573 0.0028415 0.0040453 0.0004036 -0.0004036 -0.0048563 0.0024311 0.0016175 0.0020182 0.0144118 0.006734 -0.0019759 -0.0003956 0.0059183 -0.0023631 0.0062893 0.0054709 0.0007791 0.0023337 -0.0011662 -0.0038971 0.0003904 0.0054496 0.0065777 0.0019264 -0.0007701 0.0030769 0 0.0011514 -0.0011514 -0.0003841 0.0045995 0.0057197 -0.0041913 0.0007634 0.001525 0.005698 0.0071712 -0.0007524 -0.0011297 0.0045113 -0.0067746 -0.0041627 -0.001518 -0.0095402 -0.0084714 0.0061681 0.0023033 0.0019153 -0.0042186 -0.0003844 0.0049856 -0.0019146 0.0011492 -0.0019161 -0.0019198 0.0011523 0.0030663 0.0026753 0.0068467 0.0049159 0.001131 -0.0045317 -0.0102721 -0.0130872 -0.0046602 -0.0027285 0.0007803 0.0038926 -0.0035026 -0.0058651 -0.0007846 0.003526 0.0023438 0.0046711 0.0061944 0.0015426 -0.0019286 0.0011576 0.0026959 -0.0084975 0.0003878 0.0019369 -0.0003871 0.0030924 0.0080723 0.0003828 0.0019117 0.0015267 0.0041865 -0.003424 -0.0007625 -0.0015267 -0.0061303 0.0057482 -0.0026784 -0.0057637 0.0015402 -0.0147289 -0.0125738 -0.0015829 -0.0007924 -0.0248809 0.0040552 0.0088639 -0.0020076 -0.0024145 -0.0020165 0.0036268 0.0040145 -0.0020052 -0.0117102 0.004458 -0.0024292 -0.0085488 -0.0110998 0.0004133 0.0057685 0.007368 0.0065041 -0.0024341 0.004458 0.0108587 0.0011993 -0.0011993 -0.004008 0.0024067 -0.0020052 -0.006848 -0.0004043 0.0048407 -0.0004025 -0.0036298 -0.0020222 0.0092687 0.0052011 -0.0011978 -0.0015994 -0.0048135 -0.0092911 -0.007332 0.0032653 -0.0160201 0.0028944 -0.0016529 -0.0062228 0.0024938 -0.0033264 -0.0172237 -0.0025456 0.0088814 0.002943 -0.0084318 -0.002968 0.0126584 -0.0004194 0 0.0050209 0.0066556 -0.0012446 0.0041425 0.0008264 -0.0028956 0 0.0041339 0.0028836 0.0020547 0.0008207 0.0053181 -0.0004081 -0.0028612 -0.000819 -0.0098807 -0.0037306 0.0029028 0.0012415 0.007006 -0.0053531 -0.0024804 0.001241 0.0016522 0 -0.0066253 0.0016604 0.0062022 0.009436 0.0105606 0.0036298 -0.0024184 -0.0040437 0.0048505 -0.0008068 -0.0012114 -0.0012129 0.0024242 -0.0020198 -0.004458 -0.00244 -0.00408 -0.0061513 -0.000823 0.0024671 -0.010735 -0.0066639 -0.0029295 -0.0029381 -0.0021039 -0.01785 0.004279 0.00596 -0.0021245 0.0025489 0.0016956 0.0016928 -0.0101998 -0.0116006 -0.0187574 0.0083316 0.004792 0.0026042 -0.0052151 -0.0030548 0.0138891 0.0012923 0.0004304 0.0025784 0.0064171 0.0017043 -0.0059778 0.0059778 0.0042481 -0.0046739 -0.0038404 0.0080903 0.0016949 0.001692 -0.0038111 0.0046561 0.0113375 0.0079019 0.0008282 0.0004138 0.0008271 0.004537 0.0020555 -0.0016441 -0.0020589 0.0012358 0.0118684 -0.0016287 0.0048781 -0.0061013 0.0052899 -0.0012183 0.0020296 -0.0118296 0.0036863 0.0032653 -0.0065413 -0.0053465 0.0016481 0.0045184 0.001638 -0.0032787 0.0057307 0.000816 0.0056934 0.004047 0.0008074 0.0068369 0.0008013 0.0004004 -0.0012017 -0.0032116 -0.001207 -0.0024184 -0.0008074 -0.0028311 0.0008097 0.0100665 -0.0008016 0.0020028 -0.0016019 -0.0076444 -0.0028311 0.0044453 -0.0036356 -0.0064962 0.0085176 0.0020173 0.005627 0.005994 0.0015924 -0.0031873 -0.0052011 -0.0052282 0.0052282 0.0056 0.0047752 0.0094825 0 0.0097829 0.0027221 0.0015522 0.0023238 0.00309 0.0061515 -0.003071 0.0003844 0.0023033 -0.0034569 -0.002697 0.0034662 0.0072783 0.0038095 -0.0026651 -0.0022901 -0.001147 -0.0030651 0.0022997 -0.0030675 -0.0088718 0.0019354 0.0038595 -0.001542 -0.0034783 0 0.0030924 0.0092202 0.0038168 0.0026631 0 0.0034136 0.0041564 -0.002643 0.0022659 0.0022607 0.0045062 0 -0.0045062 -0.0003764 0.0022565 0.0041237 0.0029884 -0.0007463 -0.0071175 -0.0048992 -0.0018907 0.005285 0.003758 0.0011246 0.0093232 0.0085013 0.0014711 0.0018359 -0.0092133 0.0036955 0.0099102 0.0072781 -0.0003626 0.0025358 0.007569 0.0032264 -0.0064632 -0.0003603 -0.0039718 0.0014461 0.0036062 0.0035932 -0.0043135 0 0.0150164 0.0028349 -0.0017709 0.0024783 0.0003535 0.0077465 0.0048985 -0.0010477 -0.0045526 0.0080406 -0.0055866 0.0083682 0.0013879 0.0003467 -0.0045162 0.0034758 0.0058814 0.0003449 -0.0024167 0.0082617 -0.0041223 0.0048077 0 -0.0010283 -0.000343 -0.0017167 -0.0037872 -0.0226767 -0.0067269 0.0067269 0.0084329 0.0013986 0.0073107 0.0072577 -0.0027586 0.0027586 0.0006885 0.000688 0.0017179 0.0044528 -0.0020527 0.002736 0.0051099 -0.0075034 0 0.0129254 0.0110907 0.0006682 0 0.0066578 -0.0006638 -0.0033256 0.0023291 0.0033179 -0.0043154 -0.0026649 -0.0046807 0.0063471 0.0079602 0.0013206 0.0009893 0.0059152 0.001964 0.0035907 0.0061719 0.0035558 -0.001938 -0.0009704 -0.004216 -0.0127557 -0.0085951 0.0082659 0.0114586 -0.0042408 0.0042408 0.0106849 0.0022519 -0.0009645 0.002249 0.0016033 -0.0067514 -0.0042024 -0.0071522 -0.0026135 0.0029397 -0.0101624 -0.0172819 0.0070152 0.0076273 0.0075696 0.0052322 0.0006521 0.0016284 0.0035732 0.0090382 0.0051282 0.0003196 0.0054183 0.0079152 -0.0044248 0.0069445 0.0065841 0.0056092 0.0068133 0.0040043 0.0049065 -0.0058291 -0.0058633 -0.0006192 0.005559 0.0049155 0.0039761 -0.002139 -0.000612 -0.0079902 -0.0040192 -0.0003098 -0.0121592 -0.0053468 0.0037772 0.0025102 0.0081149 -0.0012442 0 -0.0053051 -0.000626 0.0025016 -0.0043819 -0.0062933 0.0034662 0.0202405 0.0116459 -0.0033572 0.0094326 0.0039293 0.0009046 0.0087022 0.0020892 -0.0020892 0.0029833 0.0017857 -0.0056657 0.000299 0.0038789 0.0133118 0.0055678 0.0095973 -0.0002895 -0.0087235 -0.0073282 0.0055743 0.0090287 0.0077979 0.0045924 -0.0017197 -0.0048886 -0.0037545 0.0008677 -0.0069626 0.0060949 0.0106491 0.0025733 0.0088131 0.0014142 -0.0011312 0.0008485 -0.0085179 0.0102129 0.0087116 0 0.0066927 0.021175 -0.0090202 -0.0250222 -0.0136057 0.0082422 0.0129361 -0.0030782 -0.0028066 -0.0042248 -0.0042427 -0.0200408 0.0063419 0.0045872 0.0048509 0.0087857 0.0022548 -0.0002816 0.0123147 0.001112 0.0055417 0.0120847 0.002454 -0.0030001 -0.0046544 0.0141692 0 -0.0136205 0.0079225 0.0089395 0.001886 -0.0070233 0 -0.0032582 0.0019019 0.0013563 -0.0010849 -0.0008144 -0.0054466 -0.0013663 0.0051821 0.0019024 0.008651 0.0037614 0.0061489 -0.0064171 -0.0189553 -0.0098902 0.00633 -0.0174351 -0.0243018 0.0212262 0.0075325 0.0038835 0.0016598 -0.0063774 0.006101 0.0129105 0.0078837 0.000812 -0.0035235 0.0005429 -0.0089956 0.0016416 0.010064 -0.0032529 0.006765 0.0024242 0.0045632 0.0026745 0.0058589 0.0013268 0.0021192 0.0044885 0.0081333 -0.0013074 0.0015686 0.0010444 -0.0081227 0.0026274 0.0052342 -0.0052342 -0.0113473 0.0074035 0.0021053 -0.0089781 -0.0015928 0.0047707 0.0018492 0.0010551 -0.0021114 -0.0114257 -0.0058966 0.0064309 -0.0112813 -0.0013515 0.0083502 0.0056172 0.0066463 -0.0069131 -0.0005338 0.0037304 0.0066269 0.0021114 -0.0005274 0.001318 0.0034188 0.0073241 0.0083053 0.0069543 0.0066513 -0.0053688 0.0061334 0.0093826 -0.0012628 0.0080544 0.0017533 0.0034974 0.000997 0.0091755 0.0022192 0.0036878 0.0051401 0.0007322 -0.0053816 0.0004904 0.0058666 0.003892 0.0120658 0.0351161 -0.0139928 0.0014081 0.0025764 0 -0.0120016 0.0002367 0.003544 -0.0009438 -0.0061568 0.0030831 0.0096619 0.0084073 0.0111009 0.0022973 0.0041218 -0.0059592 0.0004597 -0.0136497 0.0023267 0.0013934 -0.0170864 0.0047103 -0.0058914 -0.013324 -0.0002395 0.0093002 0.0018971 -0.0009481 -0.0073784 0.0009551 -0.001433 0.0042929 -0.0009524 0.0134865 0.0014091 0.0044491 0.0044294 -0.0006981 -0.0009315 0.0060395 0.0043905 0.0052892 0.0059456 -0.000228 0.0006839 0.0002279 0.006812 0.0137096 0.0042321 -0.0053488 0.007569 0.0015512 -0.0006645 0.0057446 0 0.0052736 -0.0684764 0.0225094 0.0166121 -0.0063392 -0.0082099 -0.0273926 0.0077365 0.0039622 -0.0067686 -0.0075224 -0.0294526 -0.0085418 0.0174932 -0.0031359 -0.0041157 0.0031488 0.0072289 0.0100335 0.0122846 0 0.0074854 -0.0065467 -0.0080076 -0.0035532 0.0054432 -0.0007083 -0.0014181 0.0016543 0.0207976 0.0165141 0.0043128 0.0103651 0.0024628 0.0115608 0.0255333 -0.0043187 -0.0065133 -0.0069946 -0.0010973 -0.0070516 0.0096832 0.0013132 -0.0008753 -0.0065891 0.0039587 -0.0010981 -0.0035219 0.0019826 0.0057055 0 -0.0032877 0.0059101 0.0015266 -0.0102947 0.0006603 -0.008396 -0.0002219 0.0015523 -0.0024404 -0.0015561 0.0086389 0.0015427 0.00198 -0.0061729 -0.0037665 0.0022173 0.0072824 -0.0070609 -0.0035492 -0.0011117 0.004218 -0.0140549 -0.0078945 0.0049695 0.0083025 -0.0017893 -0.0119357 0.0074484 -0.006769 -0.0102402 -0.0115023 -0.0025484 0.0124483 0.0016024 -0.0059647 -0.0025343 0.0034542 0.0073294 0.0047809 0.004306 0.0125844 0.0006697 -0.0046975 -0.0099145 -0.0113871 -0.0004582 -0.0013758 -0.0036782 0.0141781 -0.005008 0.0158482 -0.0015736 0.0024716 0.0087142 0.0081977 -0.0011039 0.0035281 -0.001983 0.0044014 0.0059113 0.0054425 -0.0004343 -0.0006518 0.0023879 0.0124975 0.0091656 -0.0014864 0.0099377 0.0096316 0.0031208 0.0093043 0.005746 -0.0131825 0.0101084 0.0022553 -0.0043099 -0.0076391 0.0053741 -0.0006186 0.0045277 -0.0034969 0.0055481 -0.0047243 0.0057483 -0.0049251 -0.0140877 0.007897 -0.006021 -0.0014588 0.0002085 -0.0006257 -0.003972 -0.0035673 0.0039862 -0.0023058 -0.0082184 -0.0036036 0.0084585 0.0104735 0.0080938 -0.0045577 0.0002076 0.003523 0.0035106 -0.0059961 -0.0041563 -0.0016674 -0.0164042 -0.0008485 -0.0055331 -0.0105117 -0.0069249 0.0120873 -0.0047312 -0.0086599 -0.0160003 -0.0053168 -0.009373 0.0004483 -0.0117224 0.0226442 0.0019931 0.0083719 0.0059062 0.0002181 -0.0050279 0.0078586 -0.0186552 0.0125483 0.0141199 0.0012934 -0.0023725 0.0012948 -0.0043225 0.0010824 0.0041023 0.0068714 -0.0030004 -0.003871 0.0066574 0.0074635 0.0012739 -0.0034006 -0.000852 0.0082759 0.0100926 0.0050084 0.0043618 0.0059924 0.0030855 -0.0022617 0.0028777 0.0085837 0.0034535 -0.0002028 0.0004056 0.0006081 -0.0004054 0 0.0022274 0.0008087 -0.0081169 -0.0016313 0.0079277 0.0006072 0.0064542 -0.0020125 -0.0158379 0.0061212 0.0040601 -0.0008107 -0.0046743 -0.0104434 0.0065655 0.0018388 -0.0022479 -0.0012282 -0.0117442 -0.0074891 -0.0098626 0.0121569 -0.0010422 -0.0060663 -0.0018902 -0.0044243 -0.0089078 0.01207 0.0079665 0.0027109 0.0016646 -0.0060474 -0.0052428 -0.0037919 -0.0069893 -0.0012761 0.0046709 -0.0004237 -0.0085125 -0.0118243 -0.000649 0.007975 -0.0038718 -0.0141077 0.0015289 -0.004813 -0.0054975 -0.0144367 0.0181783 0.0165581 0.0002161 0.0034505 -0.0004307 -0.004966 0.0137577 -0.0006407 0.0040507 -0.0029832 -0.0051348 -0.007752 0.0017279 -0.0021603 -0.0002163 -0.0023822 -0.0041282 -0.0017433 0.0091186 0.0028057 -0.0006468 -0.0171837 0.0204133 0.0098397 0.0131108 -0.0103475 -0.0080989 -0.0083808 0.0032317 -0.0047434 -0.005635 -0.0063229 0.0004373 -0.0098869 -0.0088712 -0.0049129 0.0104666 -0.0059994 0.0008911 -0.0107456 -0.001126 0.0156498 0.0197678 -0.0030494 0.0119268 0.0090129 0.0049014 -0.0051151 -0.0068611 -0.0075586 0.0079888 0.0008598 0 0 -0.0023664 -0.0077838 0.0064907 0.0004312 -0.0008626 0.0045205 0.0023598 -0.0101218 0.0086207 0.0012867 -0.0051569 -0.0036689 -0.0019478 0.0023802 -0.001947 -0.0069535 -0.0149388 0.0011061 -0.0002211 -0.0129091 -0.0053908 0.0029236 0.0076063 0.0035595 -0.0046745 -0.00739 0.0049327 0.0044633 -0.0042397 -0.0022386 -0.0020191 -0.0144766 -0.0015962 -0.0045746 -0.0069013 -0.0174646 -0.0042373 0.0152174 -0.0011624 0.0120233 -0.0011498 0.0006901 0.003214 -0.0034439 -0.0023026 0.0016123 -0.000921 -0.0034614 0.0110346 0.0072893 0.0036248 0.0024845 -0.0027106 -0.0031717 -0.0066022 -0.0006855 0.0066067 0.000681 -0.0004539 -0.0045506 0.0043236 0.0013615 0.0002267 -0.0011342 -0.0040937 0.0006834 0.0040909 0.0020392 -0.0015857 0.0006799 0.0063234 0.0026978 -0.0022477 0.0011245 -0.0022502 0.0089707 0.004233 -0.0008897 0.0022227 -0.0020002 0.0015561 0.0013319 0.0072937 0.0015403 0.0037309 0.0015322 -0.0035057 -0.0013178 0.0050422 0.0002187 0.0061029 0.0080078 -0.0010784 -0.0015117 -0.0030303 0.0038944 0.0010791 0.0049489 0.0062052 -0.0044896 0.0034225 0.004049 0.002761 0.0025418 0.0012685 -0.0040224 0.0002121 0.0012717 -0.00915 -0.0019258 0.0089553 0.0067696 -0.0012658 -0.0019017 -0.0002115 0.0069569 0.0010499 -0.0052604 0.011328 0.0022919 0.0018713 0.0002077 0.0018674 -0.0041546 -0.0066834 -0.0060957 -0.0059209 -0.0078782 0.0078782 -0.0012733 0.0036036 0.0023248 0.0012658 0.0098606 0.0116232 0.004735 0.0043037 -0.0036878 0.0067506 -0.0038811 0.0044926 0.0010182 -0.0051015 -0.0061564 -0.0010298 0.0010298 -0.0022669 0.0018551 0.0010291 0 -0.0032969 -0.0109994 0 -0.0002087 -0.0025078 -0.0023044 -0.0088478 -0.0125627 0.0076841 -0.002768 0.0004263 -0.0126543 -0.0006477 -0.0123874 0.0004373 0.0017471 -0.0202784 0.0084258 0.0044063 -0.0072808 -0.0144979 -0.0140274 0.0162715 0.0006723 -0.0040404 0.0169496 0.0048533 -0.0086198 -0.0051185 -0.0031285 -0.0089929 -0.0093024 0.0088506 0.0125731 -0.0004463 -0.0049228 0.001345 0.0011194 -0.0065103 -0.0161202 -0.0231545 0.0067702 -0.0121724 0.0025873 -0.0004699 -0.0030599 0.0079831 0.0079199 0.0009276 -0.0081462 -0.0134104 -0.0064156 0.0009531 -0.0248355 -0.0004884 0.0073011 0.0103728 -0.0081928 -0.0165898 -0.0079032 -0.0296952 -0.0043517 0.0439162 -0.0004912 -0.002952 -0.004197 0.0066577 0.0080774 0.0009747 -0.015215 -0.0017325 0.0014851 0.0059186 -0.0118725 -0.0002488 -0.0145402 -0.0012634 -0.0027852 0.0233064 -0.008208 -0.0057608 0.0027593 0.0139306 0.0095883 0.0075564 -0.0268258 0.0285242 0.0113295 -0.0086664 0.0002418 0.0041008 -0.0004816 -0.0050706 -0.0094857 -0.0088366 -0.0012335 0.0009869 0.0044291 -0.01509 -0.0176017 -0.0010152 0.0106088 -0.0080727 0 0.0010127 0.0100706 -0.0035132 -0.0050403 0.0103055 0.0084662 0.0133007 -0.0046597 0.0078355 -0.0002439 -0.0058723 -0.0093689 0.0029681 0.0044357 0.0078374 0.0017063 0.0009737 0.0060643 -0.0012099 -0.0024242 0.003876 0.0084267 -0.0028812 0.0009613 0.0059873 -0.004787 0.0004797 0.0081204 0.0099409 -0.0063792 -0.0021355 -0.0088274 -0.0060089 -0.00896 -0.0043881 0.0002443 0.009481 -0.0053372 0.0014584 -0.0004859 -0.0058494 -0.0007336 -0.0056421 -0.0009845 0.0076046 -0.0058824 0.0039254 0.0070758 0.0053346 0.0028979 0.0126993 0.0016653 0.0033223 0.0070822 -0.0023552 0.0011783 -0.0030664 -0.0068745 -0.0035744 0.004763 0.0004751 0.0073347 0.0037647 -0.0032933 -0.0033042 -0.003078 0.0007112 -0.0023725 -0.0040462 -0.0079014 -0.0028888 -0.0036228 0.0072324 0.0004803 0.0011998 0.0009588 0.0062097 0.010186 -0.0078079 0.0035566 0.0108287 0.0051378 -0.0030328 0 0.0079125 0.0050867 -0.003234 -0.0051032 0.0101806 0.0022994 0.0034392 0.0022862 0.0050114 -0.0018194 0.0013649 0.0002273 -0.005698 -0.0029759 -0.0115288 0.0050891 0.0004614 -0.0027714 0.0085205 -0.0013768 0.0052674 0.0020536 -0.000456 -0.0013692 0.0013692 0.0054583 0.0049774 0.0033795 0.0008993 0.001123 0.0020182 -0.0015693 -0.0020213 0.0002248 0.005827 0.0060154 0.0035477 -0.0053262 0.0088614 -0.0162316 0.0053655 -0.0035738 -0.0038112 0.0024678 0.0046943 0.0013372 0.0075439 0.0008838 0.000883 0.0033043 0.0032934 -0.0048341 -0.0033094 0.0037499 0.0065833 -0.0127671 -0.0006648 0.0030987 0.006608 0.0048182 0.0121608 0.0017253 -0.0002155 0.0053735 0.0068362 0.0038249 -0.0040378 0.0027645 0.0021213 0.0063372 0.0094311 -0.0039712 -0.0060918 0.0065106 0.0058443 0.0027019 -0.0093839 0.0016747 0.0020894 -0.0085945 -0.0059122 0.0016928 0.0004227 0.0065298 0.0020973 0.0002095 0.0033459 0.0002087 -0.0052318 0.0018866 0.0052219 0.003743 -0.0016618 -0.0027064 0.0033299 0.006833 -0.0031001 0.0068077 -0.0022641 0.0088215 0.0079341 -0.0004054 -0.0050808 0.0064988 -0.0040568 0.0072904 0.0044292 -0.0042275 0.001814 0.0042198 0.0038027 -0.0015994 0.0037943 0.0039785 0.0061356 0.0057059 0.0017642 -0.0001959 0.0066381 0.0044656 -0.0069985 -0.0133545 0.0070922 0.0101563 -0.003699 0 -0.0039085 -0.00196 -0.003144 -0.0077053 0.0037613 0.011395 0.0015616 0.0011696 0.0044708 0.0090743 0.0080399 -0.0036291 0.0059144 0.0077689 0.0013204 -0.0041557 0.0049094 0.0028214 -0.0020683 0.0013167 0.000188 -0.0096309 -0.0263401 -0.0060577 0.0171011 0.0111134 0.0039935 -0.0043747 0.0013335 0.0003807 -0.0017141 0.0011431 0.0056959 0.0120438 -0.0020597 -0.0024397 0.0028145 0.0037404 0.0065123 0.0042565 -0.0014785 -0.0066803 -0.005414 0.0128338 0.0115757 0.0034649 0.0050844 0.0041573 0.0039604 -0.0012584 -0.0126721 0.0092484 0.0066565 0.0001793 -0.005573 0.0027005 0.0037685 -0.0003583 -0.002332 0.0007181 0.0057266 -0.0012499 0.0005359 -0.0041156 0.0001793 -0.0111773 0.0007249 0.0039776 -0.0037964 0.0012671 -0.0039877 -0.0045508 -0.0080601 -0.0146367 0.0137166 0.0005521 -0.0064606 0.0077477 0.001469 -0.0038607 0.0038607 0.0094961 0.0090466 -0.0007207 -0.0043353 0.0018086 0.0012641 0.0057585 0.0092874 0.0017762 0.0014187 -0.0039063 -0.001068 0.0028455 0.0007101 0.0044267 0.001236 -0.0108224 0.008172 -0.0023027 -0.0008871 0.0008871 -0.0092643 0.0016096 -0.0014306 -0.0021498 -0.0055751 -0.0001804 0.0044992 0.0055511 0.0078264 0.0028309 -0.0021224 -0.0047919 -0.0007119 0.0008898 0.0037284 0.0049496 0.0043987 0.0082175 0.0084959 0.004307 -0.001032 -0.0065608 -0.0022544 0.0062305 0.0031008 -0.0037911 -0.0039789 -0.0017349 0.0010413 0 0.0017331 -0.0024272 -0.0127524 0.0077058 0.0041783 0.0015624 0.0055354 0.0068764 -0.0036042 -0.000172 0.0029192 -0.0039516 0.0008604 0.0032626 -0.0025749 -0.0015481 0.00172 0.0034311 0.0049543 -0.0008524 -0.0068458 0.0003434 -0.0107008 -0.0020844 -0.013127 -0.0070722 0.0146194 0.0010486 0.0006984 -0.0052503 -0.0075738 0.0093269 -0.0007009 0.0014013 0 -0.0001751 0.0050642 0.0055585 0.0043212 0.0067039 0.0017117 0.008515 0.0052431 0.0062222 0.0060171 0.0003332 -0.001 -0.001001 -0.0083809 0.0023537 0.0006715 -0.0030252 -0.00371 -0.0047418 0.0084517 0.0033608 0.001006 -0.0003352 0.0061837 0.0049859 0.0049611 -0.0019815 0.0001653 0.0032998 -0.0016485 -0.0051278 -0.0009955 -0.006161 -0.0210996 0.0130499 -0.0023601 -0.0016892 0.0023641 -0.002026 -0.0093387 -0.0059886 0.0148201 -0.0010151 -0.0035608 0.0020363 0.0013552 0.0096033 -0.0025183 0.0018473 -0.012324 0.000849 -0.0112648 0.0047945 -0.0144531 -0.0071311 -0.0052503 0.0073427 -0.0073427 -0.0054544 0.0007055 -0.0054804 -0.0056889 -0.0147273 -0.0023549 0.0122568 0.0170519 -0.000881 0.0073762 0.0062795 -0.0110151 0.0010543 0.0045558 -0.0010495 -0.0008754 -0.0026309 -0.0022857 0.0033389 0.0055983 -0.0027952 -0.0079038 0.0028174 0.0080561 -0.0055974 -0.0061582 -0.0019433 -0.0097735 0.0099503 0.0066961 0.0083946 0.0006964 -0.0008705 0.0019142 -0.0019142 -0.0026162 0.0010473 0.004873 -0.0017376 -0.0003479 0.000174 -0.0055817 -0.0056131 -0.0111437 0.0028419 0.0107613 -0.0008777 0.0005267 0.001929 0.0047191 0.0015681 0.0045162 0.0100018 0.0071807 -0.001705 0.002216 0.0020412 0.0018674 0.0064244 -0.0062548 0.0008475 -0.0023749 0.0027137 -0.0023741 0.0011877 -0.0018671 0.0047458 0.0016895 -0.0016895 -0.0030483 0.0006782 -0.000339 0.0054109 0.0078946 0.0020057 0.0003339 0.0079801 -0.0043146 -0.0073444 -0.0031882 -0.0123448 -0.0061444 -0.0056657 0.0054945 -0.0003425 -0.0084287 -0.0107677 -0.0034983 0.0024501 0.0029671 -0.0105117 0.001408 -0.0024652 -0.0104565 -0.0093074 0.0062741 0.0152512 -0.0088387 -0.0008882 -0.005167 -0.01186 0.009356 -0.0062876 -0.0056023 0.0050615 -0.0052427 -0.0080073 0.0054665 0.0138954 0.0078544 -0.0053486 -0.0035817 0.0034029 0.0041039 -0.0007125 -0.001962 -0.0069874 -0.0152177 -0.0038409 -0.0101299 -0.0102336 0.0106038 -0.0038936 0.0075877 0.0014738 0.0077022 0.0054655 -0.0014545 0.0009093 0.0010901 0.003987 0.008106 0.0042965 0 -0.0021459 -0.0014332 -0.0021536 -0.0057658 0.001625 0.0019825 0.0059241 0.0113901 0.0001769 -0.0023027 -0.003909 0.0023117 0 0.0023064 0.0028314 -0.0081619 -0.0123691 0.002702 -0.0030628 -0.0101561 0.0032757 0 -0.0087592 -0.0034885 -0.004424 0.0128489 0.0038227 -0.0032757 -0.0020071 0.0009128 -0.0069585 0.0027525 0.0051179 0.0081707 -0.0009046 0.0037937 -0.0003607 0.0043197 0.0026903 -0.0012546 -0.0010766 -0.0005387 0.0007183 0.0005384 0.0016133 0.0010741 0.004285 0.00178 0.0116692 0.0094472 0.0079778 0.0018984 -0.0005174 0.0003449 -0.0013805 -0.0058885 -0.0012167 -0.001044 -0.0048866 -0.0008751 0.0029723 0.0053974 0.0015616 -0.0060864 -0.006826 0 -0.0003513 0.0024566 -0.0007013 -0.001404 0.0052549 0.0024429 -0.0089278 -0.0109619 -0.0026702 0.0003564 -0.0012481 -0.006264 0 -0.0016171 -0.0092133 -0.0069204 -0.0099174 0.0060723 -0.0062569 0.007357 0.0170789 0.0003602 -0.0088632 -0.0058309 0.0031019 0.0099702 0.001442 0.0057471 0.0041105 0.0037383 0.0067293 -0.0008828 0.0019412 0.0021134 -0.0005279 0.0035143 0.0031524 0.0097443 0.0055258 -0.0048334 -0.0032932 -0.0027816 -0.0105006 0.002109 0.0022797 -0.0015777 -0.0089876 -0.012469 -0.0008966 0.006616 -0.006078 0.0010753 -0.00701 -0.0039761 -0.001994 -0.0229431 0.0027811 0.0103151 -0.0038557 -0.0084981 -0.0157071 -0.0022642 -0.0087271 0.0026641 0.0169591 -0.002994 -0.0069582 0.0075202 0.0061619 0.0057541 0.0020338 0.0014766 -0.0012919 0.0077263 0.0053002 -0.0042013 -0.0051386 -0.0018416 -0.0072149 -0.0100766 -0.011696 -0.0076191 0.0142385 0.0106873 -0.0039241 -0.0003745 0.0102489 0.0051775 0.0038656 0.0085979 0.0038178 0.0043455 0.0139938 -0.0046429 -0.0050242 0.0039497 -0.0019729 -0.0026966 0.0048487 0.0019687 -0.0037618 0.0014347 0.0058966 -0.0017832 -0.0035759 -0.0052079 -0.0043306 0.0016262 -0.0014453 0.0028886 0.0098664 0.0023179 0.0088653 0.0035242 0.0005276 -0.0007035 -0.0028189 0.0091325 -0.0012245 -0.0007004 0.0080252 -0.0027841 0.0008709 0.0013918 0.00451 0.004662 0.0010331 -0.0093362 0.0136291 0.0035919 -0.0015378 0.0056271 0.0027169 0.0028787 0.003039 0.0047091 -0.0003356 -0.0040363 0.0057133 0.0015069 0.0031738 0.0054886 0.0026503 0.0013225 0.0014858 0.0101757 0.0118498 -0.0030707 0.0019405 0.0064412 -0.0012849 -0.0074206 -0.0017827 0.0090425 -0.0030588 -0.0084197 -0.0058709 0.0044064 0.0082705 0.0061182 -0.0032154 0.0035364 0.0006416 0.0036815 0.0039863 0.0072935 0.0022092 -0.0001576 0.0065996 0.0015649 0.0015625 -0.0090967 -0.0004728 0.0009453 -0.000315 0.0028315 -0.0044081 0.0029933 0.0100173 0.0060554 0.0040167 -0.0018519 -0.000618 -0.002631 -0.0017061 -0.0010872 0.0004661 0.0085067 0.0020002 0.0082658 0.0009142 -0.0030506 0.0022889 0.0053204 0.0086045 0.0013519 -0.0046641 -0.0007543 0.0016588 0.0046599 -0.0072246 -0.0059087 0.0001519 -0.0007599 -0.0210502 0.0138784 0.0038212 -0.0013739 -0.0022941 -0.0021459 0.007186 0.008193 0.003921 0.0012034 -0.001655 0.0009031 -0.0009031 -0.0003012 0.0009033 0.0057023 0.0037339 0.0046107 -0.0059533 0.004171 -0.0062631 -0.0025462 -0.0063187 -0.0037802 0.0063425 0.001955 0 0.0025508 0.0052313 -0.0028365 -0.0037445 0.0004501 -0.00015 -0.0076802 -0.0053051 0.0027318 -0.004405 -0.007794 -0.0092479 0.0087875 -0.0001535 -0.0036912 0.0039982 -0.0106458 0 0.0018596 -0.0010843 0.0018582 0.0087794 0.0064201 0.0027389 -0.000608 -0.0009127 -0.0003044 -0.0056484 -0.0070672 0.0064546 -0.0075344 -0.0058824 0.0044923 0.0001545 0.0023154 0.0001542 0.0055342 0.0093081 0.0116272 0.0015002 0.0007492 0.0090957 -0.0064031 0.0052149 0.0057791 -0.0001478 0.0022142 -0.0011803 0.0030953 0.0016175 -0.0050081 -0.0025135 0.0026611 0.0055948 0.0026393 0.002048 0.0001461 -0.0067439 -0.0057535 0.0011829 0.0004432 -0.0022181 0.0038416 0.0038269 0.0017613 -0.0033786 0.0073303 -0.0016081 -0.0069001 -0.0088784 0.0100563 0.0007355 -0.0070828 0.0017754 -0.0065253 -0.007917 0.0041904 0.0004479 -0.0040386 -0.014341 0.000152 0.0104349 0.0016535 0.0022504 0.0005993 -0.0005993 0.006721 0.008744 0.0029468 -0.0004415 0.0024991 0.0008805 -0.0001467 -0.0017621 -0.0027964 0.0002947 0.0049971 0.0035124 0.0004382 -0.0061521 -0.0011761 0.0052817 0.0017544 -0.0017544 0.0011699 0.0029189 0.0016017 0.0055137 0.0051956 0.0077431 0.0122091 -0.001412 0.0042301 0.0028102 0.0054572 0.0001395 -0.0006979 0 0.0013953 0.0008362 -0.0011151 0.0019507 0.0001392 -0.0013928 -0.0006971 -0.005314 0.0064291 0.0031991 -0.0011116 0.0008338 -0.0040365 0.0047308 0.0048466 0.0034476 -0.0015155 -0.007612 0.0004167 -0.0034778 -0.0069921 -0.0019666 -0.0036625 0.0007054 0.0015501 0.0088316 0.0005581 -0.0019548 -0.0082802 0.0023929 -0.0069126 -0.0139703 -0.0077821 0.0004339 -0.0027514 0.0059279 0.0034537 -0.0020132 -0.0057745 -0.0109179 0.0010241 0.0052501 0.0008723 -0.0075857 0.0016095 -0.0007313 -0.0032239 -0.0033816 0.0039686 0.0097804 0.0060826 0.0079097 0.0010022 0.0011442 0.0065537 0.0022695 -0.0014178 -0.0002838 -0.0001419 -0.0004259 0.0045339 -0.0021227 -0.0025532 0.0035443 -0.0048234 -0.0022779 -0.0057176 0.0018618 0.0010011 0.0034247 -0.00057 -0.0021403 -0.0032907 -0.0012906 0.007149 0.0032715 -0.0002841 0.0028369 0.0043813 0.0021131 -0.0016901 -0.0012695 -0.0026853 -0.0021251 -0.0015613 0.00071 -0.0079807 -0.0027223 0.0048662 -0.0004284 -0.0065922 -0.0025914 -0.0081054 -0.0046613 0.0061136 -0.0010163 -0.0077288 0.0036531 -0.0021903 -0.0102851 0.0028022 -0.0044281 0.0044281 0.0054344 0.0046763 -0.0008751 -0.001022 -0.0110158 -0.0097953 -0.0112487 -0.0161171 0.0070261 0.0044043 0.0081498 -0.0043685 -0.0033268 -0.0129585 -0.0140619 -0.0107957 -0.014578 0.0071571 0.0186833 -0.0003111 -0.0053042 -0.0017221 -0.0036104 -0.019853 -0.0199278 -0.0080506 -0.0191529 -0.069089 0.0454383 0.0263374 -0.0042013 -0.0361805 0.0052247 0.014143 0.0001712 0.0008558 -0.010837 -0.02593 -0.0150217 -0.0213065 0.0283089 -0.0026875 -0.0035945 -0.0137783 -0.0219627 -0.0171266 -0.0043755 -0.0024816 0.0053374 0.0338318 0.0062294 0.0200712 0.0112151 0.0056487 -0.0113296 0.0067424 0.0114287 0.0092231 0.0051831 -0.0034524 0 -0.0183235 -0.0102674 0.0039069 0.0068887 -0.000176 -0.0077766 0.0017727 0.0054756 0.0075459 0.0109538 0.006893 -0.0082773 0.0039748 0.0024117 -0.0063865 -0.0067762 0.0026116 -0.0006958 0.0013911 0.0013891 0.0107008 0.007014 -0.000341 0.0062899 0.0060821 -0.0042198 0.0111019 -0.0013391 -0.0020121 -0.0005037 -0.0128445 -0.0022137 0.0003409 0.0074703 -0.0095174 -0.007542 0.0041209 0.0003426 0.0011983 0.0023923 0.0042579 -0.0023822 0.0032316 0.0032212 -0.0008467 -0.0013562 -0.0069793 -0.0146264 -0.018545 0.0058104 -0.0143226 -0.0067906 0.0089254 -0.0139587 0.010933 0.0010689 0.0095695 0.0065044 0 0.0022753 0.0006991 -0.0033249 -0.0017544 0.0056032 -0.0033231 -0.0033342 -0.0097148 -0.0134014 -0.0113977 -0.0271109 0.0316494 -0.0094632 -0.0027465 0.0214048 0.0146092 -0.0003538 0.0105598 0.010969 0.010336 0.0061507 -0.006665 0.0078566 0.0136861 -0.002184 0.0117039 -0.0031632 0.0031632 -0.0056676 0.0104765 0.0059377 0.0119331 -0.0029292 0.0060119 0.006298 0.0046575 -0.0024064 -0.005153 0.0112379 0.0039831 0.0006358 0.0020637 -0.0126069 0.0008026 0.004962 -0.0033587 0.0024002 -0.0032015 -0.0048216 0.008183 0.0038278 -0.0028694 -0.0001597 0.0062077 -0.0014291 0.0004766 0.0022212 -0.0065188 0.0162965 0.0064138 -0.0001559 0.0096229 -0.0023196 0.0018561 0.0021612 0.0053826 -0.0013813 -0.0067807 0.0070879 0.0007674 0.001533 0.002448 0.0027468 0.0019791 0.0025822 0.0048426 -0.000151 -0.0057541 0.005301 0.0016603 -0.0021135 -0.0009072 0.004377 -0.0034699 0 -0.0062154 0.0010639 -0.0103834 0.0030651 0.0160902 0.001655 -0.0048222 -0.0056048 0.0013662 -0.0070026 0.0001528 -0.0070509 -0.011137 -0.0029597 0.0096259 0.000309 0.0016977 0.0063024 0.0010721 0.0027515 0.0024394 0.003648 -0.0047145 0.0050179 -0.0048654 -0.0021361 0.0073049 -0.0015175 0.00515 0.0003021 0.0028655 0.004208 -0.0015008 -0.0001502 0.0041973 -0.0001496 0.0077497 0.007248 0.0063175 0.0035088 -0.0010221 -0.0023402 0.0070043 0.0046424 0.0007234 -0.003187 -0.0004354 0.0049233 0.0010106 0.0033134 0.0027289 0.0005736 -0.0008605 -0.0007176 0.0021513 0.0024326 0.0028543 -0.0019971 -0.0071654 -0.0012952 0.008175 0.0048447 0.0024136 -0.0005674 -0.0038382 0.0031286 -0.002559 0.0005692 -0.0047059 0.0025696 0 -0.0005705 -0.0011419 -0.0021445 0.0020017 0.0045604 0.0066606 -0.0015549 0.0001415 -0.0024074 0.0007087 -0.0024115 -0.0066976 0.001286 0.0054116 -0.0025597 0.0002847 -0.0044226 0.0011432 0.0009992 -0.001142 0.0034222 -0.000712 -0.0022818 -0.0090356 -0.0049105 0.004334 -0.007379 0.0086756 0.0068867 0.0039954 -0.0068591 0.0042925 -0.0021439 -0.0018618 -0.0017217 -0.0063383 -0.0008674 -0.0030419 -0.0064037 -0.0020462 -0.0066055 0.0001473 0.0054336 -0.000293 0.0040936 0.0018949 0.0082663 -0.0015899 -0.0008683 0.0033244 0.0058989 0.0065771 -0.0029972 0.0008573 0.0065481 0.0015595 0.0028293 0.0039476 0.0043524 0.0015399 -0.0006996 -0.0008402 -0.0012617 0.0035007 0.0030705 0.0020881 -0.0054382 0.0072444 0.0016644 0.0047007 0.0022045 -0.0002753 0.0049437 -0.0021942 -0.0035759 0.005633 0.002873 -0.0006833 0.0002734 -0.0013676 0.000684 0.0092568 -0.0078901 0.001092 -0.0046493 0.0046493 -0.0056092 -0.0085424 -0.0019391 -0.0059793 0.0072263 0.0011071 0.0073038 0.0002746 -0.0020611 -0.0013765 -0.0058019 0.000277 0.0009691 0.000415 0.0013822 0.0078421 0.0039664 0.0008187 0.000818 -0.0057401 0.0005481 0.0038283 0.0099125 0.0063304 -0.0002686 -0.0089033 0.0028415 -0.0024351 -0.0051603 -0.0087516 0.0034277 0.0040978 0.0021787 -0.0039523 0.000819 -0.0046499 -0.0082588 -0.0072132 0.000974 0.0091375 -0.0130394 -0.0284661 0.0390218 -0.0017977 0.0134728 0.0058547 -0.0005432 0.002442 0.006483 -0.0037766 -0.0005407 0.0004055 -0.0012171 0.0001353 0.0020274 0.0032354 0.0059045 -0.0014729 -0.0030866 -0.0016142 -0.0063475 0.0021654 0.0047205 0.0016133 0.0016107 0.0061506 0.0054503 0.0009276 0.0022491 0.0002643 0.0040873 0.0036774 -0.0005245 -0.0002624 0.0018351 0.0036601 -0.001175 0.0001306 -0.0019612 0.0027446 0.0053368 0.0007786 0.0002594 -0.0003891 0.0002594 -0.0061146 0.0009131 0.0044231 -0.000909 -0.00117 -0.0016924 0.0023425 0.0032444 -0.0016858 0.0036274 0.0030988 -0.0006448 -0.0005161 -0.0002582 0.0001291 0.0010321 0.0009022 0.0007727 0 0.0024429 -0.0032156 0.0023163 0.0021827 0.0032012 -0.0019195 -0.0001281 0.0031975 0.0002554 0.0033138 0.0045703 0.0016453 0.0007584 0 0.0022719 0.0007561 -0.0010083 -0.0048034 0.0001267 -0.0017753 0.0022819 0.002782 -0.0006316 -0.0020238 0.0032866 0.0057884 0.0030068 0.0010003 -0.0035053 0.0001254 -0.0006272 0.0018803 -0.0010024 0.0027541 0.0012494 0.0013725 0.0043546 -0.0006209 0.0004968 -0.000621 -0.0013676 -0.0078686 -0.0050283 0.0069074 -0.0025063 -0.0030158 0.0088956 0.0037351 0.0050821 0.002223 0.0011097 -0.0018501 -0.0012353 0.0032087 -0.0023438 -0.0013595 0.0018533 -0.0035862 -0.0052168 0.0044732 0.0004958 0.0003717 -0.002108 -0.0021125 -0.0016184 0.0013696 -0.0032403 -0.0051311 -0.0026384 -0.0103693 0.0044391 -0.0048205 0.006338 0.0037836 0.0036439 -0.0016318 0.0046375 0.0053626 0.0050865 -0.0002475 0.001237 0.0027161 -0.0042006 0.003584 0.0018488 0.0030737 0.0022072 0.0006123 0.0070749 0.0040032 0.0045899 0.0016857 0 0.0012024 0.0016809 -0.0006 -0.0030054 0.0033654 0.0035932 0.004414 -0.0032191 -0.0023912 -0.0002394 -0.000479 -0.0002396 -0.0045635 -0.0027723 0.0008445 0.0020481 0.0010826 -0.0021663 -0.0126093 0.0015849 -0.0091783 0.0063726 -0.0009778 -0.0002446 0.0050021 0.0029165 -0.0007283 0.0001214 0.0004856 -0.0009713 -0.0046268 0.0015853 -0.0019515 -0.0057545 -0.0014746 0.004662 0.0035433 -0.0019534 0.004268 0.0015806 0.0030327 0.0024196 0.0013283 0.0021697 0.0006019 0.0042029 -0.0027599 -0.0026471 0.0028874 0.0065857 -0.0037066 0.0045417 0.0003577 0.0002384 0.001072 0.0024969 0.0008309 -0.0004747 -0.0007125 -0.0011886 0.0033246 0.0044944 0.0005899 0.0001179 0.0028262 0.0021144 0.0002347 -0.0032902 -0.0020029 -0.006389 0.0068607 0.0011781 0.0029393 -0.0009396 -0.0018819 0.0023518 -0.0016457 0 -0.0036537 0.0004722 0.0015331 0.0037638 -0.0004697 0.0002349 0.0008216 -0.0004694 -0.0041169 0.0028249 0.0012921 0.0002347 0.0051504 0.0044268 0.0022061 -0.000464 0.0011597 -0.0032505 -0.0031445 -0.0033884 -0.0032825 -0.0087275 -0.0103591 0.0028684 0.0046437 0.0020174 -0.0002371 -0.0039209 -0.0064493 -0.0001198 0.0025133 -0.0025133 -0.0027599 0.0039576 0.0041804 0.0046376 0.0010672 -0.0005927 -0.0021368 0 -0.0009511 -0.0030975 0.0058295 0.0053239 -0.0061546 0.0047377 0.0030675 0.0043491 0.0012893 0.0003513 0.002456 0.002683 0 0.0043011 0.0032426 0.0016174 -0.0003464 -0.0009242 0.0025395 0.0013825 0.0009206 0.0033301 0.0028619 0.0009141 0.0002284 -0.0003426 0.0009133 -0.0006849 -0.0032026 -0.0039027 0.0033297 -0.0089811 -0.0106978 0.007338 -0.0011612 -0.0046582 0.0011666 0.0032592 0.0018577 0.0049754 0.0060986 0.0003441 0.0026341 -0.0020609 0.0017177 -0.0016031 -0.003214 -0.0020716 0.0003456 -0.0016136 -0.0017318 0.0041513 0.003561 0.0003439 -0.0012617 -0.0012633 -0.0024162 0.0003455 -0.0001152 0.001151 0.0018389 -0.0028747 -0.0073972 -0.0019741 0.0019741 -0.0004641 0.0018553 0.0024299 0 -0.0003468 0.0005779 0.0056455 0.0059565 0.0043305 0.0011365 0.0022691 -0.0010205 0.0040756 -0.0005651 -0.0018104 0.0054213 0.0011257 0.0001125 0.0016861 -0.0004493 -0.0007868 0.002022 0.0013457 0.003133 0.0022319 0.0023381 -0.0007788 -0.0021169 -0.0012276 0.0043457 0.0036624 -0.001885 -0.0062347 -0.0008939 0.0023447 -0.0054795 -0.0048334 -0.0074644 0.0057728 -0.0033918 -0.0052231 0.0065812 -0.0079483 -0.0072079 -0.002184 0.0024137 -0.0026438 -0.0109948 -0.0104113 -0.003652 0.0045923 -0.0131262 0.0056973 0.0083682 0.006318 -0.0046762 -0.003404 0.0018795 -0.0063575 -0.0131964 -0.0060017 -0.017734 0.0098775 0.0205376 0.0042705 0.008017 -0.0019982 -0.0037723 0.0084677 0.0037405 -0.0002334 -0.0011677 0.0032661 -0.0017484 -0.00035 -0.0007004 -0.0126926 -0.0056933 -0.0026203 0.0026203 -0.0002379 -0.0021439 0.0019059 0.0077056 0.0067087 0.0019921 0.0004682 0.003854 0 0.0032585 -0.0024429 0.0001165 0.0030233 0.0028984 0.0045048 0.0011518 0.001955 -0.0005746 -0.0023018 -0.0011529 -0.0015007 0.0017314 0.0011526 0.0037942 0.0006883 0.0001147 -0.0004588 0 0.0054914 0.0046668 0.003401 0.0033895 0.0025908 0.0025841 0.0029132 -0.0039236 0.0054887 0.0055698 0.0003332 0.0003331 -0.0030018 0.0045548 -0.0039982 0.001779 0.0069741 -0.0024299 -0.0045442 -0.0006667 -0.0006672 0.0020002 0.0060871 -0.0009935 -0.0007734 0.0041915 0.0057074 -0.0002189 -0.0001095 -0.0016436 0.0020814 0.0032776 0.001308 -0.0002179 0.0017418 0.000435 -0.003376 0.005765 0.0033566 -0.0032482 0.0022748 -0.0020579 0.000867 0.0016236 -0.0009739 -0.0015168 -0.003258 -0.0010884 0.0030445 0.0047655 0.000864 -0.0023779 0.0020539 -0.0041121 0.0002168 -0.006526 0.0015266 0.0017418 0.0009784 -0.0025023 -0.0020719 -0.0012015 -0.0031744 0.0006576 -0.0074783 0.0087922 -0.0012044 0.0030628 0.0026178 0.0003267 0.0005443 0.0015226 0.0010861 -0.0004343 -0.0046808 0.0039203 0.0030385 -0.0010841 -0.0072941 0.0001093 0.0030544 0.0042389 0.0024915 -0.0027084 0.0008675 0.0063746 0.0022592 0.0008593 0.0020379 0.0008568 -0.002358 0.0018226 0.0014984 0.0028835 0.0019178 -0.0027713 -0.0035285 0.0011775 0.0025644 0.0014929 -0.0015996 -0.0003202 -0.0038507 -0.0046189 -0.0077821 0.0040067 0.001296 0.0065623 0.0035322 -0.0004275 0.0054368 -0.0024482 -0.0002132 -0.001707 -0.0051386 -0.0001073 -0.0053816 -0.0027017 -0.0058607 -0.0042542 -0.0064704 0.0027468 0.0008774 -0.0127981 -0.0101558 0.003583 -0.002574 -0.0135381 0.0015889 0.0088067 0 -0.0012373 -0.0113187 -0.0057078 0.0058216 0.0035221 0.0040747 0.0075396 0.0029106 -0.0036956 0.0017935 0.002796 0.0008931 -0.003913 -0.0055041 0.0050559 0.0079255 0.0090759 0.0060417 0.0027342 0.002182 0.0003269 -0.003711 0.0009837 0.0035985 0.0013053 -0.004467 -0.0001092 0.0055541 0.0036856 -0.0016243 -0.0020613 -0.0009779 -0.0025034 -0.0068894 -0.0007684 -0.0017586 -0.0116184 -0.0051328 -0.0164678 -0.0010241 -0.0174557 0.0087659 0.0017211 -0.0115302 -0.0088527 -0.0124796 -0.0092836 0.0176597 -0.0011755 0.0048108 0.0089729 0.0065908 0.0034515 0 0.0029817 -0.0138363 -0.0003484 -0.0016273 0.0011627 -0.0074645 -0.006931 0.0011781 0.006689 0.0109342 0.0045017 0.0027602 -0.0039125 -0.0030023 0.0004625 -0.0003468 0.002656 0.0016133 -0.0040381 0.0009244 -0.0057917 -0.0047744 -0.0094999 -0.0014151 0.0102144 0.00245 0.0143455 0.0036689 0.0026287 -0.0018279 -0.0065393 -0.0066983 0.0060074 0.0029902 -0.0010341 -0.007616 -0.0095438 0.0001169 -0.0012871 -0.0186723 -0.001552 0.0047676 -0.0039316 -0.0020314 -0.0155509 0.000243 0.0099106 0.0093369 0.0008337 -0.0029806 -0.0031093 -0.0045618 -0.0010835 0.0018052 -0.0051835 -0.0135063 -0.0055279 -0.0126443 -0.0067593 -0.0174843 -0.0016629 0.0122154 -0.0128558 -0.0213642 -0.0249118 0.0176878 0.0162137 0.007752 -0.0036101 -0.0059593 -0.0080888 -0.003806 0.0031508 0.0210124 0.0052487 0.0102891 0.0119341 -0.0011245 -0.0050132 -0.0069344 -0.0169701 0.0029554 -0.0034702 0.0024433 0.0030777 -0.0127571 -0.010429 0.0032708 -0.0219209 0.0026667 -0.0054743 -0.0086057 -0.0115451 0.0180063 0.0050857 0.0280374 -0.0019489 -0.0037788 0.0112937 0.0154982 -0.0080393 -0.0026942 0.0044863 0.0029372 0.0061022 0.0085816 0.0081347 0.0001246 -0.0004986 0.0075772 0.0008659 -0.0039643 0.0030985 -0.0009905 0.0080193 0.0062473 0.0006104 -0.0069806 0.0039249 0.0082897 -0.006944 -0.0066234 -0.0145029 -0.0052579 0.0067551 0.0079474 -0.0017331 -0.0035996 0.000373 -0.0046097 0.0006242 0.0013718 0.0074497 0.0108269 0.00403 0.0010963 0.0104155 -0.0032583 -0.0010885 -0.0121745 -0.0007352 -0.0038072 -0.0038217 0.0051743 0.0038021 -0.0026967 -0.0057857 -0.0048264 -0.0029817 -0.0004978 0.0006222 0.0021127 0.0129512 0.0070827 0.0076369 0 0.0079385 0.0052575 0.0073617 -0.002606 0.0109703 0.0064316 0.0003496 0.0029088 0.003711 0.0013881 -0.0076584 -0.000466 0.0040705 0.0057864 -0.0005771 -0.0020804 0.003465 0.0072377 -0.0020626 -0.0026417 0.0088167 -0.0041124 0.001487 0.0010282 0.0067141 0.0011335 -0.0046557 0.0003414 -0.0055907 -0.0006867 0.0012587 -0.0004575 -0.0109278 0.0036943 0.0103176 0.0054595 0.0014735 -0.0021543 0.0006808 0.001247 0.0029412 0.0040582 -0.0051884 -0.0009051 0.0094627 0.0100402 0.0017744 -0.0005542 -0.0022198 0.0027739 0.0076164 -0.00077 0.0004401 -0.0019819 -0.0003307 -0.0055279 -0.0107001 -0.0002241 0.0063684 0.0016692 -0.0064696 -0.0126128 0.0072268 -0.0011257 0.0076302 0.0107845 0.0070524 0.0086372 0.0008705 0.0018473 0.0020606 0.003461 0.0052765 -0.0009671 0.0084569 0.0021297 -0.00181 -0.0018132 0.0025589 0.0043564 0.0012715 0.0014813 -0.0104157 -0.0026745 0.0042758 -0.0028842 -0.0082712 0.0046274 -0.0038726 -0.0026982 -0.0049838 -0.004354 -0.0048114 -0.0115761 0.0111376 -0.0023055 -0.0054004 -0.0157045 0.0128271 -0.0048884 -0.0152623 0.0201507 0.007508 0.0053755 0.001749 0.0052288 0.0062818 -0.0023781 0.0009736 0.0005405 -0.0003242 -0.000757 -0.0025997 -0.0024977 0.0003261 -0.0039207 -0.0037171 0.0001095 -0.0050505 -0.0023142 0.0029744 0.0049377 -0.0004379 0.0040435 0.0039186 0.0046605 -0.0008654 0.0002164 0.0034565 0.0001078 0.0080537 0.001603 0.0021333 0.0020225 -0.0033019 0.0001067 0.0034079 0.0030784 0.0014827 0.0027478 0.0065222 0.0042898 -0.0012537 0.0017756 -0.0026122 0.0011502 0.0009401 -0.0026136 -0.0039857 -0.0053744 0.0013727 -0.0023241 0.0008458 0.0015839 -0.0056076 -0.0054258 -0.0013878 -0.0055704 -0.0041983 -0.0006475 0.0025873 0.0020436 0.0061057 0.0004271 0.0056416 0.0019088 -0.0006359 0.000318 0.0019058 0.0047486 0.0104724 0.0021853 0.0007274 0.0026971 -0.0037364 -0.000416 0.0064289 0.0025806 0.0060641 -0.0085413 0.00031 0 -0.0008269 -0.0040408 0.0034202 -0.0022788 0.0024858 0.0060847 0.0025671 -0.0068948 -0.0048652 -0.0064543 0.0026076 -0.0078432 -0.0026281 0.0026281 0.001888 -0.0005241 -0.0044132 -0.0057028 0.0010585 0.0044337 0.0002106 -0.0017918 -0.0094335 -0.012754 -0.0039989 -0.006083 -0.003274 -0.0037236 0.0049253 0.0067465 -0.0026061 -0.0063264 0.0040404 0.0091127 0.002373 -0.0126852 0.0156972 0.0058902 0.002666 0.0028713 0.0031807 0 -0.0049875 0.0053051 0.0063291 0.001366 0.0042961 -0.0011508 -0.0011521 -0.0031489 -0.0011571 0.0034673 0.0013626 -0.0046194 -0.0027397 -0.0014784 0.00548 0.0024143 -0.001889 0.0006301 0.0068003 -0.0002086 0.0060304 -0.0037387 -0.0045886 -0.0032456 0.0060638 0.0070628 -0.0012428 0.0002072 0.0010355 0.0010344 -0.0031066 -0.0062422 -0.0018803 -0.0008368 -0.0033543 -0.0127861 -0.0039427 -0.0052454 0.0013943 0.0016064 -0.0010707 -0.0049399 -0.0070221 0.0034632 -0.003138 -0.0043445 0.0003265 0.0017395 -0.0126805 -0.0115071 -0.0088303 0.0119414 0.0017734 -0.0037723 0.0038831 0.0057414 0.0045038 -0.0038434 -0.0078423 0.0038736 -0.0049831 -0.008025 -0.0028016 -0.0134443 -0.0022774 0.0174035 -0.0017941 -0.0007859 0.0122797 0.0011089 -0.002219 -0.0191764 0.0087928 0.0054844 -0.0067197 -0.0001124 -0.0073318 0.0010184 0.0002262 0.0055252 0.0081752 -0.0010043 0.007009 0.024963 0.0017286 0.0089195 0.0039507 -0.0058783 0.0176375 0.0075543 0.0089491 0.0006214 0.0003105 0.0019645 0.0027851 -0.0127509 -0.0055448 0.0120961 0.00145 0.0031001 0.0029877 0.0025685 0.001333 0.0038863 0.0063085 0.0007098 -0.0031471 0.0055767 0.0001011 -0.0052712 0.0011174 -0.0031522 -0.0007132 -0.0005097 -0.004804 -0.007198 -0.0046548 0.0049643 0.0025759 -0.0021633 0.0018545 -0.0016483 0.0064745 0.0030684 0.0077315 0.0131879 0.0038928 -0.0048934 0.0075796 0.0061411 0.0013815 0.0024622 -0.0040412 -0.0011859 -0.0099375 -0.0013992 0.005187 0.0014913 -0.0026859 -0.0030927 -0.0009997 -0.0040088 -0.0018092 0.0034147 0.0116622 0.0101554 0.0028408 0.0015639 -0.0004884 -0.000782 -0.0054913 -0.0025598 -0.0097079 -0.011312 -0.0012088 -0.0128838 0.0040758 -0.0070412 0.0009212 -0.0047175 -0.0067042 0.0022741 0.0041216 -0.0021617 -0.0003092 0.0102554 0.0052916 -0.0046796 0.0062008 0.0032376 -0.0004041 -0.0026308 -0.0001013 0.00253 -0.0013148 -0.0007087 0.0012146 0.0046423 0.0070232 0.0071728 0.0045558 0.0002964 -0.0049515 -0.002087 0.0033767 0.0037605 0.0025649 0.0008863 0.0006888 0.0056891 0.0034175 -0.0022445 -0.0004886 0.0035125 0.0018489 0.0046557 0.003574 -9.64E-05 0.0003857 -0.0043472 -0.0010655 0.0013559 0.0020305 0.0046256 0.0077575 0.0016205 -0.0040084 -0.0070055 0.0034609 -0.0028832 -0.0057915 0.0010643 -0.0033903 0.000388 0.0016475 0.0022247 0.0043384 0.0064247 0.0048629 0.0006656 0.0054982 0.0013226 0.0020749 -0.0016029 0.0031093 0.0016919 0.0072986 0.0046507 0.0056448 -0.0023096 -0.0009253 -0.0032454 0.0024119 -0.0025048 -0.002511 -0.000652 0.0024197 -0.0044718 -0.0041168 0.0029022 -0.0059069 -0.0106832 -0.0016171 0.0010467 -0.0039068 -0.0090151 0.0005779 0.0006738 0.0005771 -0.0147247 -0.0122737 -0.004158 0.004158 -0.0028692 -0.005265 0.0072446 0.0048335 0.0054956 -0.0014691 -0.0033379 -0.0005902 0.0034379 0.0044029 -0.0004883 0.0001953 9.77E-05 0.000976 0.0003901 0.0044756 -0.0011656 0.0002915 0.0027169 0.0032892 -9.66E-05 0.0011584 -0.000193 0.0007717 -0.0009647 -0.0113566 -0.0102042 -0.0074239 -0.0085812 -0.0119967 -0.0063079 0.0047854 -0.0031538 -0.0001019 0.0025444 0.0095094 0.003919 -0.010181 -0.0005067 0.0034406 0.0033281 -0.0027222 -0.0066856 -0.0039717 0.0025478 0.0024398 0.0072838 0.0063301 -0.0021056 -0.0013057 0.0016067 0.0072982 0.0070475 0.0040472 -0.000887 -0.0063304 -0.0009928 -0.0078776 0.0024996 0.0087493 0.0052328 0.0009843 -0.0007873 -0.0003939 -0.0089039 0.0014895 0.004554 -0.0067394 0.0021854 0.0001984 0.0046519 0.0044337 0.0030429 0.0074212 0.0087176 -0.0017375 0.0047227 0.0035514 0.0046838 -0.0018136 0.0040997 -0.0004759 -0.0015242 0.004281 0.0077542 -0.0029244 0.0008499 -0.0091983 -0.0088992 0.0041245 0.0012436 -9.56E-05 -0.0022015 -0.0075987 -0.0029976 0.001935 -0.0050388 -0.003016 -0.0003898 0.0016557 -0.0062476 -0.0090498 -0.0077374 -0.0087014 -0.013043 0.0039612 -0.0033508 -0.0037703 -0.0014303 -0.0058447 -0.005879 -0.004562 0.0112634 -0.0031905 0.0024709 0.0008223 0.0038966 0.0037796 0.0087301 0.006749 -0.0058397 -0.014238 -0.0077117 -0.0156042 0.0040806 -0.0128207 -0.0032841 0.0099251 0.0060752 -0.0084946 -0.0151751 -0.0042863 -0.0034423 -0.0090929 -0.0192134 -0.0081251 0.0050165 0.0209075 0.0177015 -0.0051486 0.0045064 0.005445 0.000745 -0.0005321 -0.0061933 -0.0078499 0.0007554 0.0068803 0.007046 0.0060455 0.0052732 0 0.0029409 0.0059602 -0.0103747 -0.0066586 0.0020128 0.0042243 0.0065126 0.0003141 -0.0058787 -0.0082462 -0.0059625 -0.0100892 0.0073087 0.0166732 -0.007718 0.0013788 0.0054963 0.0008429 -0.0033759 0.0028492 0.0030512 0.0046117 0 -0.0013603 -0.0076733 -0.0064574 -0.0079971 -0.0031094 -0.0064641 0.007752 -0.0005364 0.0018226 -0.0028962 0.0062112 -0.0068559 0.0056809 0.0105259 0.0120895 0.000209 0.0067677 -0.0011421 0.0020756 0.0076423 0.0064606 -0.0037892 0.0067492 -0.0018362 -0.002863 -0.0087418 0.0012388 0.0031931 -0.000926 0.0006174 0.0044137 0.0003072 0.0060226 0.0007121 -0.0026477 -0.0018371 -0.0048129 -0.0035992 -0.0068224 -0.0002075 -0.0050965 -0.0103769 -0.0062358 -0.0115164 -0.0032227 0.0035444 0.0057729 -0.0063092 -0.0061333 -0.010852 0.003268 -0.0023955 -0.0120642 -0.0008831 -0.0007734 0.000442 0.0031986 -0.0029777 -0.009098 -0.0058127 0.0156835 0.0084621 -0.0087932 -0.0038715 0.0104736 0.0077566 -0.0069892 0.0038283 0.0050093 0.010159 0.004934 -0.0068714 -0.0020491 0.0005396 -0.0030257 -0.0076046 0.000981 -0.0015264 0.0003273 -0.0083243 -0.0140668 0.0020058 0.0008902 0.0004448 -0.0098314 -0.0101558 -0.0062575 -0.0095179 -0.0127553 -0.0078496 0.0085496 0.0118249 -0.0061268 -0.0039503 0.0049933 0.0078459 -0.0105136 0.0097088 -0.0024184 -0.0021931 -0.0008092 -0.0011571 0.0123125 0.003653 0.0030718 -0.0004545 0.0153381 -0.0050491 0.0067265 0.0023436 0.0057797 -0.0021079 -0.0004443 -0.0062417 -0.0104525 0.0027079 -0.0006763 -0.0040673 -0.0053352 -0.0108715 0.0043628 0.0028599 -0.0013717 -0.0041266 -0.0008044 0.0113163 0.0201413 0.0016695 -0.0032303 0 0.0048971 -0.0031135 -0.0044648 -0.0070727 -0.0027076 -0.000339 0.0004519 -0.0032811 -0.0068229 -0.0085946 -0.0018431 -0.0098489 -0.0024483 0.0018659 -0.0052567 -0.013086 -0.0147035 -0.0032567 -0.0159536 -0.0147162 0.0190035 -0.0035511 -0.0009818 -0.0257461 -0.0097488 0.0110079 0.0045198 -0.0048974 -0.0106303 -0.0095878 -0.0171011 -0.0143452 0.0191682 0.0007799 -0.0196831 -0.0260452 -0.0186716 0.0012465 -0.028072 -0.0137597 0.0490032 0.0249708 0.0256696 0.0167113 0 0.0086979 -0.0148835 -0.0155022 0.0015742 -0.0005245 -0.0101497 -0.01374 -0.0032288 0.0022882 0.023518 -0.0019717 0.0066881 0.0070331 -0.0053354 -0.0248362 -0.0106234 0.0006757 -0.0074582 -0.0079257 -0.002335 0.0043908 -0.0016443 -0.0157571 -0.0076918 0.0245454 0.0144161 0.0068627 -0.0012076 -0.0008059 0.0108254 0.014647 0.0175295 0.0003861 -0.009567 0.0006493 0.0125139 -0.0023104 -0.0021869 0.0015442 0.0034658 0.0003843 -0.0002562 -0.0132845 0.0022048 -0.0001296 -0.0012965 0.0025913 -0.0140737 -0.0049994 -0.0052896 -0.0087895 0.0056023 0.0019932 0.011483 0.0099243 0.008797 0.0203985 0.0218445 0.0016038 0.0011089 -0.0016021 0.0095741 -0.0041621 -0.0070167 0.0001235 0.013861 0.0089741 0.0025321 -0.0030151 -0.0059362 0.0026696 -0.0054681 -0.0086888 0.0052712 0.0060946 0.0040022 -0.0086307 -0.0030568 0.014226 0.0129545 0.0007148 -0.0013109 0.0052331 -0.0010682 0.0013054 0.0099128 0.0152657 0.004385 0.0004605 -0.0108772 -0.0101737 -0.0107534 -0.0013077 0.0015453 0.005449 -0.0043805 -0.0134984 0.0058757 0.0002391 -0.0033525 0.0046665 -0.0055064 -0.0022832 0.0037226 -0.0008394 -0.0013204 0.0031183 0.008466 0.0020165 -0.0034423 0.0014259 0.0053289 0.0014163 0.0028265 -0.0104032 -0.0093124 -0.0015605 0.0012006 -0.0066213 0.0014484 0.0097222 0.006192 0.0063898 0.0036499 0.0098235 0.0146713 0.0030915 0.0114807 0.0047356 0.0062795 0.0053512 -0.0052394 0.0007821 0.0042349 0.003774 -0.0051094 -0.0015602 0.000669 0.0035603 0.0019971 -0.0031084 0.0011112 0.0006661 0.0056444 0.0052834 0.0108097 0.0020613 -0.0013014 -0.0109112 0.0071058 0.0059734 0.0003248 -0.0020588 -0.0022805 0.008013 -0.0017271 0.0025896 0.0024754 0.0040764 0.0037399 0.0002133 0.0043624 0.0072989 0.004207 0.0032483 -0.0073499 0.0033667 0.0070124 0.0056162 0.0001037 0.0020719 -0.0001035 0.0032033 0.0053504 0.0006155 -0.0012314 0.0053252 0.0052969 0.002334 -0.0046734 -0.0065386 -0.0084406 -0.0105997 0.003858 0.0066383 0.0019623 -0.0017556 0.0025806 -0.0002062 -0.0003094 0.0099554 0.0105649 0.0042352 0.0008047 -0.00161 0.0009059 0.0018094 0.0113842 0.0049525 -0.0008896 0.000692 -0.0017804 -0.0038685 -0.0033848 -0.0066033 -0.0001004 0.0034075 0.0008001 0.0022967 0.0004986 0.0007972 0.001692 0.0022846 0.0071182 0.0046194 0.001176 0.0076105 0.0009715 0.00378 0.00145 -0.0002898 0.0050121 -0.0038532 -0.0024158 0.0019331 0.0047204 -0.0010577 0.0043201 0.0036336 -0.0013372 -0.0065203 -0.0063694 0.0048291 -9.64E-05 -0.0053138 -0.0034935 -0.00497 0.0025368 0.0027248 -0.0020429 -0.0046852 -0.014983 0.0013894 0.0023774 0.0023718 -0.0031636 -0.0085522 -0.0066133 0.0012057 -0.0019096 0.0023112 0.0057049 0.0075562 0.0004951 0.0028669 -0.0015807 -0.0081406 -0.0002991 0.0034838 0.0042636 -0.0084456 0.0009973 0.0019916 -0.000199 -0.015341 -0.0111767 -0.002865 0.0083674 -0.0024418 -0.0018352 -0.0025545 0.0109891 0.0088657 0.0008021 0 -0.0002005 0.0028028 0.0029943 0.0034821 0.0012903 -0.0131791 -0.002818 0.0006045 -0.0017138 -0.0018178 0.0039344 -0.0004028 -0.0017138 -0.0017167 -0.0027327 -0.0090609 -0.0072877 -0.0108759 -0.0045929 0.0039678 -0.0152258 -0.0065818 0.0021279 0.0016991 -0.0076686 0.0001069 0.0119024 0.0140567 -0.0032344 0.0315789 0.0123775 -0.0139989 -0.0044725 0.0017304 0.0102191 0.0106139 9.96E-05 -0.0016945 0.0023914 -0.0096001 -0.0049358 0.0004038 0.0022182 0.0140016 0.0045581 0.0018766 -0.0053428 -0.003777 -0.0034914 -0.0073216 0.0043192 -0.0011031 0.0030057 -0.0028051 -0.0034167 -0.0087964 -0.0009144 -0.0023406 -0.0054145 0.0026598 0.0002043 0.0044843 0.0059817 0.0028263 -0.0010085 0.0071382 0.0020016 -0.0066205 -0.0020149 0.0041262 -0.0054381 -0.0091297 -0.0034708 -0.0045096 -0.0036018 -0.0140153 -0.0005229 -0.0009419 -0.004302 -0.0037927 -0.0100781 0.0018109 0.0028694 -0.015292 0.0040865 0.018396 -0.0012652 -0.0034875 -0.0007413 0.0007413 -0.0111781 -0.0139063 0 -0.0033709 0.0097551 0.0015089 -0.0077847 -0.0056602 -0.0089913 -0.0069633 0.0018838 0.0176666 0.0158622 0.00619 0.0163566 -0.0073537 0.0231381 -0.0056827 0.0037232 0.000516 0.0004126 0.0075007 0.0028621 -0.0030669 0.0088681 0.0121042 0.0052 0.0127845 0.0024588 -0.006109 -0.0043582 0.0020824 0.0098572 0.002547 -0.0042159 0.0030412 -0.0041225 0.0041225 0.0095536 0.0042599 -0.0003865 -0.0014507 0.0031889 -0.000579 -0.0058089 0.0038763 0.0029939 0.0033694 -0.0016352 0 -0.0022165 -0.0104743 0.0020453 -0.002728 0.0097088 0.0063566 -0.0021144 0.0006732 0.006421 -0.0003822 0.0021002 0.0064639 -0.0076089 0.0077037 0.0003789 -0.0048417 -0.004674 0.0041981 0.0056017 -0.0002841 -0.0029402 9.50E-05 0.0008544 0.000664 0.0068989 9.42E-05 0.0035721 0.0072925 -0.0002795 0.0057605 0.00766 0.0009189 0.0008263 -0.0001836 -0.005246 -0.0096431 0.0026054 0.0013001 -0.0023229 0.0038994 -0.0030625 -0.0084003 0.001405 0.0084813 -0.0021369 -0.0020482 -0.0012123 -0.0063653 0.0066452 0.0026085 0.0059369 0.0081062 0.0038458 0.0018262 -0.001552 0.0028283 0.0038192 -0.0024535 -0.0006371 -0.0030089 0.0023714 -0.0052062 -0.0014663 -0.0013766 -0.0064493 -0.0099392 -0.0021494 0.0014957 0.005775 -0.0091436 -0.0057339 -0.0008488 0.0024501 0.0035701 -0.0046059 -0.0132779 0.0064713 0.0033146 0.0057507 0.004502 -0.0018734 0.0021541 0.0097752 0.0095889 0.0064938 0.0008202 0.0048162 0.0013589 0.001809 -0.0028053 -0.0074586 0.0014597 0.0003646 -0.0083277 -0.0056214 -0.0051886 -0.003443 -0.0039227 0.0014027 0.0050336 0.00778 0.0004612 -0.000738 -0.0023098 0.0041538 0.0021164 -0.0010116 -0.0037797 -0.0073233 -0.001024 -0.0032651 -0.0018706 0.0029912 0.0032614 0.0056589 0.0086581 -0.003215 -0.0053506 -0.0073342 -0.0040148 -0.0057231 0.0048808 -0.0086515 -0.0004723 0.0029249 -0.0031139 0.0080012 0.011744 -0.0029696 -0.0006508 -0.0023276 0.0009317 9.31E-05 0.009361 0.0081768 0.0077474 0.0026296 0.0016287 0.000723 0.0015346 0.0017124 0.0080718 0.0053452 -0.0043631 -0.0035759 -0.00287 0.0037651 -0.000358 0.0061572 -0.0013353 -0.0111072 -0.0031576 -0.0039837 0.0016316 0.0014481 0.0046919 0.0037736 -0.0025141 -0.0061322 -0.0023546 -0.0012702 -0.0058272 -0.0095422 0.0039564 0.0002754 -0.0011022 -0.0018398 -0.0005526 0.0004605 -0.0015666 0.0008297 -0.0043404 0.00111 0.0136806 0.0062725 0.0018108 -0.0035341 0.0012701 -0.0019057 -0.01096 0.0066816 0.002551 0.0008186 -0.0044649 -0.0082531 -0.0062812 -0.0107132 0.0068139 0.0063981 -0.0012949 0.0109532 0.0101098 0.0041599 -0.0008125 0.0024356 -0.0033392 -0.0002712 0.0089122 0.0097214 0.004958 0.0087053 -0.0021034 -0.0055426 0.0013225 0.0020244 0.0014937 0.0091764 -0.0039224 0.0054871 0.003122 0.0003463 0.0058687 0.00592 0.0031601 -0.0047011 -0.0021442 0.0004292 0.0012865 0.0060671 0.003317 -0.0016146 0.0036504 0.0049871 0.0021898 0.0021851 -0.0038691 -0.0008431 -0.0027027 0.0001691 -0.0115667 -0.0048019 -0.0033579 -0.0072709 0.0062354 0.0040495 0.0054024 0.0095328 0.0088552 0.0039385 -0.0014228 0.0039286 -0.0001669 -0.0010018 -0.0025088 0.0067593 -0.0078484 -0.0072348 -0.0025361 0.0045604 0.0014314 -0.0005892 -0.0048103 8.46E-05 -0.0126837 -0.0024016 -0.0037856 -0.0015528 0.0017252 -0.0110058 -0.0035791 -0.00105 0.0019241 -0.0069265 -0.0044088 0.0133429 0.0119617 0.0061845 -0.0144905 -0.0056633 0.0046202 0.0036462 -0.0061715 -0.0021822 -0.0112479 -0.0086089 -0.011565 0.0070087 -0.0056571 0.0110152 0.0035562 0.0125233 0.0030628 -0.0019241 -0.0038593 0.000615 0.0054305 0.0043581 -0.0075077 -0.0050953 -0.0121396 -0.0019632 -0.0131273 -0.0150461 0.0003674 0.0087784 0.0155378 0.0005377 0.0097179 -0.0106142 -0.0120886 -0.0085681 -0.0043117 -0.0023011 0.0069789 0.0143547 0.012104 0.0041798 -0.0008879 -0.0044512 -0.0057266 -0.0044968 0.0053938 0.0056323 -0.0053634 -0.0142627 -0.015115 0.0050638 -0.0153621 -0.0024276 0.0012146 0.0123418 0.0163736 0.0070518 -0.0042432 0.0064929 -0.0073075 -0.0081826 -0.0125857 -0.0212088 0.0063068 -0.0013146 -0.008208 -0.0162357 -0.0109397 0.0082401 0.0047195 0.0290726 0.0074391 -0.0039917 -0.0149942 -0.0091056 -0.0097665 -0.0092799 0.0158971 -0.0029675 0.0145613 0.0111806 -0.003088 0.0147917 -0.0063922 -0.0112151 -0.0122933 -0.0143749 0.0037574 0.004318 -0.011847 0.0047364 -0.0140813 0.0102166 0.003093 0.0102732 -0.0041158 -0.0131301 -0.0100602 -0.0008839 -0.0049247 0.0084555 0.0134204 0.0217857 -0.0028396 -0.013455 0.0150651 0.0004731 0.0059415 0.0018788 0.005522 0.0035405 0.0057498 0.0137756 0.0019135 -0.0023697 -0.0031073 -0.0094726 -0.0129274 -0.0014988 -0.0016889 0.0022512 -0.0016879 -0.0094296 0.0005683 -0.0079856 -0.0101689 -0.0096891 0.0029166 -0.0070142 0.0001955 -0.0068655 -0.0071111 -0.0035746 0.0136339 -0.0028497 0.0078416 0.0058411 0.0097562 -0.0014429 0.0035555 0.0024909 0.0012431 0.004862 -0.0037159 -0.0087245 -0.0060849 -0.0015513 0.0029067 0.0103947 -0.0027806 -0.0036553 0.0201295 0.0082769 0.0041129 0.0014914 0.0064064 0.0071929 0.0022945 -0.0059768 -0.002031 0.0053456 -9.19E-05 -0.0034072 0.0131955 0.0034533 -0.0009076 -0.0082973 0.0169765 0.0031456 -0.0125515 0.0012713 -0.0019985 0.0003637 0.0019071 -0.0096637 0.0053904 0.0047269 0.0020836 0.0079323 -0.0020671 -0.0165098 -0.009558 -0.0055561 -0.0057739 -0.0145823 -0.0053212 0.0079712 0.0114652 -0.0162023 -0.0082007 -0.0007663 -0.0184716 -0.0001952 0.0140567 -0.0309913 -0.0205655 0.0110877 -0.0032129 -0.0291828 -0.0091534 0.0201714 -0.0034879 -0.0139703 -0.0217011 -0.0033068 -0.0153973 0.0242267 0.0218937 0.0148105 -0.0196924 -0.026055 -0.0127993 0.0098024 -0.0058052 0.0212286 0.0008441 -0.0028516 -0.0107396 -0.0068655 0.0301125 0.0206747 -0.0020483 0.0001025 0.0013318 0.0214714 -0.0090589 -0.0084277 -0.0200841 -0.028492 -0.0110867 0.0136525 -0.0025657 0.0086331 0.0151662 0.0168942 -0.0180447 -0.0016757 0.0119824 0.0053714 -0.0025788 -0.0019643 -0.005604 -0.0008329 0.010877 -0.0050612 -0.0130285 -0.0215267 -0.0031134 0.0027918 0.0004288 -0.010451 -0.0182529 0.0030837 0.0004398 -0.0003298 0.0144092 -0.001627 0.0142274 0.0135001 0.0071542 -0.0037811 0.0101556 0.004158 -0.001869 -0.0071969 0 0.0185642 0.0067589 -0.0106711 0.0086278 0.0111869 0.0027269 0.0059329 -0.0009028 -0.0037199 -0.0124666 -0.0083982 0.0034908 -0.0023601 -0.0007194 0.0037966 0.0031699 -0.0139819 -0.0184949 -0.0088984 -0.0077979 0.0010718 0.0104434 0 -0.0140923 -0.0105924 0.0062825 -0.0022701 -0.0030349 -0.0007602 0.0173393 0.0074461 0.0044412 -0.0109268 -0.0039545 -0.016956 -0.0165838 -0.008117 0.0067872 -0.001998 0.0034385 0.0209288 -0.0014107 -0.0087251 -0.0018639 0.0037244 0.0019661 0.0143014 -0.0161582 -0.0088948 0.0003309 -0.0026499 -0.0081035 -0.0169734 -0.0039757 0.0005689 -0.0093715 0.0022938 0.0146702 -0.0023736 -0.0168896 0.0061955 -0.0017171 0.020638 0.0116047 0.0018842 0.0181055 0.0063953 0.0059251 -0.0088468 -0.0023869 0.0030369 -0.0113266 -0.0138968 -0.0065742 -0.0068428 -0.0071167 -0.0085388 0.0026263 0.0146038 -0.0148319 -0.0156343 -0.0035982 0.0002325 -0.020198 -0.0005933 -0.0070276 -0.0312013 0.0047979 -0.018456 -0.0012509 0.0399955 0.0075481 -0.0116455 0.0106902 0.0009553 -0.0028688 0.0032268 0.0099728 0.0040085 -0.0119549 -0.0189932 -0.0178773 -0.005451 -0.014893 -0.0070859 -0.0020338 0.0088676 0.0153936 0.0261092 -0.0131533 -0.0087423 -0.0138225 -0.0159255 -0.0226785 -0.0056198 -0.0082912 -0.0146435 0.0050829 -0.0193998 -0.0097055 -0.0173194 0.0084894 -0.0170514 -0.0025406 -0.0109415 0.0303949 -0.0228509 -0.0262927 0.0312436 0.0077307 -0.0240907 -0.0069085 -0.0100153 -0.0272085 -0.0228954 0.0161269 0.0167618 0.0050333 0.0343986 0.0007131 -0.0103182 -0.0203732 -0.0066377 -0.0165638 -0.0231365 -0.0217941 -0.0023635 -0.0001578 -0.017508 0.0009629 0.0410145 -0.001695 0.0449344 0.0286336 0.019159 0.0219667 -0.0177585 -0.0156595 0.0118729 0.0154761 0.0167379 -0.0050467 -0.0291364 -0.0114692 0 -0.001853 0.0383478 0.0201176 -0.0055327 -0.0002707 -0.0108874 0.027399 -0.0048045 0.006135 -0.0039968 0.0031987 -0.0198905 -0.0043532 -0.0039615 -0.0158657 -0.0374034 -0.0155673 -0.0044085 0.0041152 0.0105049 -0.0010165 0.0092553 0.0067427 0.0004288 -0.0269425 -0.0138973 0.0035667 -0.0191709 -0.0170814 0.0090346 0.0252873 0.0057799 -0.0032564 -0.0056497 -0.0091366 0.0167118 0.004724 -0.0036887 -0.0109989 -0.0142999 0.0138515 0.0083383 -0.0044583 0.0002978 0.0206314 0.0240663 0.0068114 0.0050783 -0.0007038 -0.013895 0.0160049 0.0200313 -0.0041402 -0.0087507 0.0063969 -0.0012484 -0.015244 0.0016897 -0.0053604 0.0146029 0.0045894 0.0125476 0.0322239 0.0087187 0.0160484 -0.0136837 0.010053 0.0108528 -0.0027022 0.0171185 -0.0049521 0.0008906 -0.0034397 0.0028036 0.0169089 0.0135465 0.0060304 -0.0070184 0.006282 0.0094104 0.0049748 -0.0143852 -0.0237322 0.0105067 0.0049646 0.0101011 0.0174953 0.0063629 -0.0079299 0.0094844 0.0072624 0.007681 -0.0069695 -0.0091695 0.0017929 0.012107 0.0146398 -0.0102841 -0.0093233 -0.0086931 -0.0026347 -0.0239075 0.0078297 0.0184732 0.0031056 -0.0058609 -0.0086748 0 -0.0137681 -0.0077591 -0.0065745 0.0079336 0.0225853 0.0111639 0.0048824 0.0167279 0.0081443 0.0034702 0.0074777 -0.010948 0.0107187 -0.0016062 -0.0112004 -0.0009294 0.0067184 -0.0045126 -0.0068657 0.019198 0.0091221 0.0126327 0.0095929 -0.0161149 0.0049516 0.0053739 0.0107725 0.0008833 0.0106483 0.0075062 -0.0093642 -0.0107788 0.0011052 -0.0050941 -0.0112768 0.0036985 0.0132246 -0.0026531 -0.0069981 -0.0003345 0.0162587 0.0155666 0.0033429 -0.0031269 0.0009715 -0.0022682 -0.0138279 -0.0084779 0.0012155 -0.005204 0.0048727 0.0103309 -0.0096683 -0.0020998 0.0178723 0.0063912 0.0108469 0.00607 0.0045549 0.002006 0 0.004 -0.0035782 -0.0070889 0.0019094 -0.0087281 -0.0016049 0.0149851 0.0001055 -0.0015834 0.0055834 0.0044025 -0.0105142 -0.0104123 -0.0046031 -0.0081879 -0.0107674 -0.0139847 -0.0012205 -0.0086976 -0.0067424 -0.0056536 0.0072309 -0.000901 -0.0086003 -0.0095924 -0.0106126 0.0002319 0.0005795 -0.0032498 0.0061425 0.0065642 -0.0132881 -0.0043131 0.0088393 -0.0018544 -0.0146073 -0.0205751 -0.0018041 0.014461 0.0092123 -0.0130164 0.0055823 0.0230649 0.0055402 -0.0162454 0.0064136 0.0019741 -0.0067513 0.0031485 -0.0151331 -0.0096206 -0.004066 -0.0017991 -0.0050548 -0.0095776 0.0034051 0.0203095 0.0214201 -0.0094765 -0.0015293 0.0093743 -0.001167 0.0064017 -0.01355 -0.0137362 -0.0112711 0.0106748 0.0250941 0.0107621 -0.0012669 0.0133938 0.0048778 -0.0018122 0.0140713 -0.0020141 -0.0005602 0.0015677 -0.005723 0.0107456 0.0082049 0.001655 0.0058258 -0.0155744 -0.0011138 0.0086552 -0.0124515 -0.0008954 -0.0030278 -0.0107267 0.0047565 0.0072048 0.0044768 -0.0024598 0.0001119 0.0059149 0.0145811 -0.0016463 -0.0007692 0.0053719 -0.0050422 -0.0112721 -0.0037858 -0.0012279 0.001897 0.0111968 0.0025323 0.0032934 -0.0062669 -0.0148892 -0.0195564 0.002736 -0.01168 0.0028754 0.0026381 0.008895 -0.003184 0.0003416 0.0029559 0.0094905 0.0024708 0.0031359 -0.0070695 -0.0074602 0.0066716 0.0081935 0.008792 -0.0013305 -0.0040022 0.0046677 0.0078414 0.0183131 0.0102091 0.0044805 0.0066833 0.0039044 0.0144294 -0.0079208 0.0161913 -0.005368 0.0040287 0.0135165 0.0054772 -0.0062912 -0.0020379 0.0118633 0.0047262 -0.0061384 -0.0054656 0.0159085 0.0074638 9.91E-05 0.0030685 0.0072871 -0.0151256 -0.009307 0.0016074 0.0084962 0.0029815 -0.0051736 -0.0058023 -0.00624 0.0080443 0.0155026 0.006781 -0.0048108 0.0041249 -0.0033379 -0.0156594 -0.0040036 0.0031042 0.0053844 -0.0057844 -0.0106587 0.0019189 0.010838 0.003885 0.0035729 0.0093675 -0.0101604 -0.0105652 0.0111599 -0.0005947 -0.0040733 0.0012933 0.0012917 0.0150779 0.0114754 -0.0055268 0 -0.0042873 -0.0039135 0.0074226 -0.0051705 9.78E-05 0.0122474 -0.0014502 -0.0111885 -0.0091406 -0.0092249 -0.0014959 0.0084473 -0.0073501 0.0035824 0.0076196 0.0139986 0.0043649 -0.0032962 -0.0067229 0.0013677 -0.0055803 0.0026472 0 -0.0048094 -0.007109 0.0053365 -0.0057329 0.0027717 0.0070922 0.0119037 -0.001456 -0.00175 -0.0059533 -0.008059 -0.00247 0.0016803 -0.0007904 0.0080717 -0.0072813 -0.018137 0.0005027 -0.0015088 0.0004026 0.0080177 -0.0032995 0.0036987 -0.0008984 -0.0098355 -0.0052584 0.0017221 -0.0006075 0.0082703 0.0135676 0.0101544 -0.0048179 0.0054062 0.015563 0.0014467 0.004999 -0.0077979 -0.0021285 0.0052164 -0.0006747 -0.0027999 0.0041488 0.0040358 -0.0066388 0.0050072 -0.00549 0.0027969 0.0014436 0.0095713 0.0087254 -0.0021742 0.0026463 -0.007104 -0.0049552 -0.0037326 -0.0054805 0.0009637 0.001059 0.0012501 9.61E-05 -0.0056854 -0.004164 -0.0011652 0.0049426 -0.0024198 0.0091642 0.0027808 -0.0055694 -0.0005779 -0.0028946 0.0088505 -0.0033578 0.0015364 0.0002878 0.0017251 0.0035368 -0.0022927 -0.0112528 -0.0099145 -0.0040131 -0.0067904 0.0074767 -0.0069831 0.0015779 0.0057971 0.008196 0.0111128 -0.0013463 0.00365 0.0069747 -0.0008573 -0.0051591 0.0023918 -0.003446 -0.0033617 0.0025943 0.0107851 0.0087898 0.0004704 0.0141025 -0.0034372 -0.0050378 -0.001123 0.0042979 -0.0125717 -0.0052061 -0.0012345 -0.0102193 -0.0013449 -0.0077198 -0.0025218 0.0055203 -0.00951 -0.0090108 -0.0081996 0.012911 -0.0125143 0.0002974 0.0058315 -0.0001971 0.0028545 -0.0095798 -0.0080706 0.0010998 0.0098445 0.0069027 -0.0014751 0.0126157 0.0019417 -0.0115112 0.0047962 -0.0156476 -0.0121746 -0.0024125 -0.0055508 0.0083649 -0.0040225 0.0066285 0.0014004 0.0056816 0.0126421 0.0002944 0.0065523 -0.0061599 0.0044038 0.0071999 -0.006907 -0.0033245 0.0038125 -0.0036166 0.0062476 0.007755 -0.0006762 0.0056848 0.0041229 0.0018164 -0.0006688 0.0041965 0.000666 -0.003239 -0.005166 -0.0058679 0.0054842 0.0046906 0.0012408 0.0115696 0.006672 -0.0040355 0.0050652 0.005412 -0.0042899 -0.0122239 -0.0089329 0.0024788 -9.52E-05 0.0018077 -0.0103192 -0.0069391 0.0077072 -0.0018251 -0.0026957 -0.0039604 0.0051166 -0.0085099 0.0033933 -0.0006777 -0.0011629 -0.0076897 -0.0053887 0.0013744 0.0009806 0.0049861 -0.001757 -0.0049949 0.0002945 9.81E-05 -0.0028503 -0.0085999 0.0008931 -0.005969 0.0051752 0.0029735 0.0045423 -0.0057307 -0.0042699 0 -0.0029898 -0.0059062 -0.0012055 0.0034119 0.0083799 -0.0026859 0.0048691 0.0031671 0.0004939 -0.0037601 -0.0085624 0.0065777 -0.0001987 0.0076212 0.0055064 0.0018614 -0.0008813 -0.0021575 -0.0054142 -0.0030646 -0.0079523 -0.0050025 -0.0064399 -0.0006059 0.0069455 -0.0116028 -0.0012185 0.0079948 -0.0099271 -0.0022422 -0.0010208 0.0044839 0.0053744 0.0127621 9.98E-05 0.0083516 0.000396 -0.0049608 -0.0046857 0.0032923 -0.0064952 -0.0132198 -0.013191 -0.0004118 0.0087149 0.002447 0.002441 0.0049653 0.0050413 0.0053162 0.0014995 -0.0062124 -0.0031208 0.0029197 -0.0069609 -0.0005063 0.003034 0.0044333 0.0030114 0.0052982 -0.0041962 -0.0043145 -0.0131581 -0.0049025 -0.0092574 0.002477 -0.0076573 -0.0015593 0.0083917 -0.0019621 0.0097722 -0.0047199 0.0051293 0.0047976 -0.0006112 0.0032553 0.0028398 0.0112791 -0.0024063 0.0023061 0.0012011 0.0044912 0.0031815 -0.0027833 0.0015914 0.0056489 -0.0020775 -0.0083533 -0.0002996 0.0036891 -0.003789 -9.99E-05 -0.0051084 0.0035086 -0.001402 -0.0024079 -0.001005 0.0014068 0.0059068 0.0076568 0.0082865 -0.0005896 -0.0013771 0.0007872 -0.008098 -0.0057677 -0.0163897 0.0015195 0.0006072 0.0027277 -0.0062747 -0.0013207 0.0037543 0.0002025 -0.0078272 0.0006121 0.0088339 -0.0077126 -0.0028566 0.0030603 -0.004594 0.0001023 -0.0006141 -0.0017419 0.0028674 -0.0017399 -0.0040031 -0.0111698 -0.0009365 0.0089129 -0.0055872 0.0040383 0.0006198 0.0063826 0.0026645 0.0030656 -0.0074761 -0.0093985 -0.0035343 0.0006246 0.0047758 0.002586 -0.0033113 -0.0065513 0.0004172 -0.0082727 -0.0001052 -0.000526 0.0035711 -0.0014689 0.0007347 0.0056497 0.0070694 0.0021731 -0.0073663 -0.0036514 0.0038596 -0.0008332 -0.002295 -0.0086009 -0.0094196 -0.0061867 0.0010694 -0.0009624 -0.000107 -0.011623 0.0031343 -0.003784 -0.0075021 -0.0068992 0.0120154 0.0026025 0.0030277 -0.0030277 -0.0107791 -0.0070307 0.0005511 0.0089942 0.0077229 0.0018403 0.0056083 0.0184352 0.0133202 -0.0069002 0.0063791 -0.0050162 -0.0030429 0.0017849 -0.0008395 0.0087802 0.0041541 0.0020706 -0.0067452 -0.015636 0.002957 -0.0014774 -0.0002112 -0.0042342 -0.0153931 -0.0005388 0.0019382 0.0073951 -0.0002136 -0.0007479 0.0050109 -0.0051178 -0.0016047 -0.0076308 -0.0020519 0.0059283 0.0080279 0.0094435 0 0.0006334 0.0020033 0.0016839 -0.0135509 -0.0032027 -0.0083754 -0.0121503 -0.0102025 -0.0057503 -0.0047802 0.0008911 -0.0014484 -0.0029031 0.0050193 0.0075372 -0.0052034 -0.0022225 -0.0072573 0.0001121 0.0015674 -0.0091027 0 0.0085432 -0.0010079 0.0075902 0.0022215 -0.0056746 -0.0013399 0.009231 0.00552 -0.0058522 -0.0024393 -0.0024453 -0.0091672 -0.0023613 -0.0084789 -0.0013633 -0.0042153 -0.0003426 0.0009132 0.009652 -0.0087396 -0.0077821 0.0017219 0.0014899 0.0014877 -0.0063092 0.0052795 0.0054795 0.0005691 0.0112011 0.0007873 0.0044868 -0.0025775 0.0043666 0.0076791 0.0068501 -0.0114059 -0.0035702 -0.0012302 -0.0054985 0.007064 0.001563 -0.0025691 -0.0022394 -0.0084427 0.0045116 0.0087396 0.001672 0.0042232 0.0035426 -0.0026558 -0.0015525 0.0096086 0.0210992 0.0163317 -0.0108581 0.0045918 0.0072187 -0.0021177 0.0150442 0.0090433 0.0018609 -0.0099648 0.0100681 0.0086376 -0.0043095 -0.0102321 -0.0034341 0.0062351 -0.0035284 -0.0030194 0.0002085 0.0132562 0.0089108 0.0070112 0.0059563 0.0025132 -0.0098881 -0.0050829 0.0098373 -0.010551 -0.0099422 -0.0028884 -0.0022753 0.002895 0.0039155 0.0011306 0.0080823 0.018275 0.003695 -0.0019956 0.0008985 -0.002798 -0.0038099 0.0002009 -0.0009043 -0.0115258 -0.0093993 0.0007183 -0.0101032 -0.0051943 0.0023927 -0.0040606 -0.013127 0.0040089 0.0044122 0.0017804 -0.0004186 -0.0046165 -0.0086608 0.0005303 0.0060251 0.0039966 0.0069038 0.0032263 0.0001039 0.0137236 0.0020475 -0.0093502 0.0128213 -0.0009177 -0.0028604 -0.000307 0.007341 0.0064804 0.004632 0.0046106 0.006777 -0.0001987 0.0222035 0.0057162 0.0039531 -0.0035668 0.0044325 0.0047 -0.0080708 0.0028899 9.62E-05 -0.0011548 0.0076739 0.0041005 -0.0033364 -0.008053 0.0040346 0.0057356 0.0016191 -0.0017144 -0.0090013 -0.005498 0.0007735 -0.0017411 0.0037687 0.0077821 0.0084815 0.0003795 0.0129119 0.0017776 9.35E-05 -0.0060939 -0.0117292 -0.0093682 -0.0087783 -0.0066103 -0.0078332 0.0016697 -0.000589 0.0001964 0.0074335 -0.0093989 0.0029467 0.0056724 0.0040876 -0.0035026 0.0044734 0.0020356 0.0024179 0.0102831 -0.0012437 0.0088635 -0.0048509 -0.0020998 -0.0197816 -0.0132439 -0.0076332 -0.0116106 -0.0139905 0.0023454 -0.0070527 -0.001848 -0.0132411 -0.0151089 0.0049565 -0.0202972 0.0389523 -0.012886 0.005944 -0.0103465 -0.0141771 0.0063728 -0.0003177 0.0037 -0.0174565 -0.0068958 0.0023758 0.0107286 0.007548 0.0087521 -0.0025229 0.0049347 0.0032415 0.0020857 -0.0087894 -0.0148229 0.0100823 0.0165466 -0.0013511 0.0133273 0.000513 -0.0042144 -0.0046461 0.0049551 -0.0053691 -0.0055022 -0.0002082 -0.0074202 -0.020025 0.0085252 0.0046581 0.0003168 0.0167526 0.0124853 -0.0088578 -0.0039391 -0.0017672 0.0064302 0.011001 0.0079438 0.0055637 -0.0033345 0.00535 -0.0056537 0.0033355 0.0083405 0.0075765 -0.0122909 0.0002011 0.0024096 0.0003008 0.0015026 0.0069826 -0.0043834 0.010231 0.0065994 -0.003048 -0.0049358 -0.0111455 0.0003002 -0.0046125 -0.0142722 -0.0004079 -0.0091184 0.0050306 0.0022504 0.0033661 0.0074063 -0.0006067 -0.001417 -0.0006079 0.0075724 -0.0035266 -0.0074975 -0.0056091 -0.0011256 -0.015893 0.0015592 0.0064189 0.0007221 0.0111779 -0.0019395 0.0058072 0.0115141 -0.0004018 0.0013052 0.0017042 -0.0013029 0.0015032 0.0082773 0.0036679 -0.0055567 0.007435 0.0041396 -0.0006887 -0.0055271 0.0141512 -0.0035191 -0.0008817 -0.0043218 -0.0068152 0.0147568 0.0024384 0.0059249 -0.000775 -0.003009 0.0045585 -0.0100171 -0.0030346 -0.0086649 0.001186 0.0045334 -0.0041383 -0.0004938 0.0033531 0.0061835 0.0029311 -0.004792 -0.0020607 -0.000393 -0.0007865 0.0003933 0.0008844 -0.0110618 -0.0167246 0.0015137 0.00292 -0.009496 0 -0.00468 0.0008155 0.002849 0.015326 -0.0001001 0.0020993 0.003688 -0.0062878 0.0005005 0.0028978 -0.0016977 -0.0094397 -0.0003027 0.0009079 0.0015114 0.0130041 0.0067354 0.0048255 -0.0029516 0.0041298 0.0091815 -0.0052642 -0.0010757 -0.0010769 -0.005205 0.0001969 0.0004921 0.004516 0.0053729 -0.0053729 -0.0042209 0.0059825 0.005169 0.0010695 -0.0089801 0.00098 0.0033249 0.0115507 0.0081696 -0.0025878 -0.0053888 -0.0092086 -0.0036096 0.0040964 -0.0088968 -0.0013758 -0.000787 0.0020646 -0.0022614 0.0037335 0.0108267 0.000194 0 0.0004848 0.0063781 0.0034619 -0.0006722 -0.0005765 0.0024959 0.0128604 0.0031187 -0.0046342 0.0085894 0.0095408 0.0009305 0.0067665 -0.0014792 0.0019409 0.0048819 0.0007348 0.0007343 -0.0033085 -0.0002762 0.0049601 -0.0011001 0 0 0.002748 -0.0173468 -0.009727 0.0042204 0.0075521 0.004726 -0.0061202 0.0028793 0.0002782 0.0084022 0.0007353 -0.0077477 0.0025892 0.0203855 -0.000362 -0.0078154 0.0006384 0.0025496 0.002271 -0.0081083 -0.0069763 0.0094431 0 0.0052785 0.0099351 -0.0125708 -0.030024 -0.0125515 -0.002377 -0.0053451 -0.0108733 -0.0016461 0.0019363 0.0021256 -0.0195903 -0.0087984 -0.0042788 0.0015943 -0.0043903 0.0056838 0.0013911 0.0192749 -0.0083134 0.0073389 -0.0005851 -0.0067538 -0.0061078 -0.0132294 0.0042964 0.0119916 0.0195109 -0.0055219 0.004362 0.0071319 -0.0032705 0.0042304 -0.0051943 0.001927 0.0074799 0.0201454 -0.0039403 0.0036594 0.0003746 -0.0061042 -0.0031134 0.0090303 0.0042983 0.0069687 -0.0044544 0.0013941 -0.0016732 0.0002791 0.0013941 0.0115427 0.0037572 -0.0094657 -0.0009238 0.0005544 -0.006208 0.0006504 0.001114 0.0016687 -0.0011121 0.0009269 -0.0204031 -0.005119 0.0122794 0.0027188 0.0198375 0.0009174 0.0076734 0.000273 0.0041761 0.0068617 -0.0008101 -0.0031567 0.0033368 0.0092307 -0.0052771 0.0171598 0.0022893 -0.0007919 0.0108554 -0.0068146 0.0098575 -0.0090688 0.0083741 -0.0065363 0.0025324 0.0092023 0.0048276 0.0142597 -0.0070618 0.0066378 0.0045697 -0.0146286 -0.0112869 -0.0070432 0.0161859 -0.0102698 -0.0020841 -0.014976 0.0057191 -0.014137 -0.000267 0.0115925 -0.0102583 0.0024858 -0.0147383 -0.022569 -0.0162379 -0.0036549 0.0118532 -0.008479 -0.0117654 -0.0018005 -0.0305286 0.0178334 0.0020153 -0.0114739 -0.0078859 -0.0300633 -0.0009069 -0.0051549 -0.0046724 0.0247373 0.0139076 0.0008812 0.0048814 -0.005175 -0.0193739 0.0100304 0.0186976 0.0093635 -0.0027902 -0.0091952 -0.0020441 -0.0106775 -0.0048374 -0.0049603 -0.0074869 0.0357269 0.0028963 0.0064383 0.0072533 0.0045541 0.0020804 0.0040537 -0.0078395 0.0011372 0.0075486 -0.0012228 0.0087149 -0.0098449 -0.0133746 0.0005728 0.0144024 0.0051607 0.0013094 0.0033592 0.0029765 -0.0004645 0.0009288 0.0119044 0.0146613 0.0070264 0.0059071 -0.0161025 0.0087581 -0.0043243 -0.0022597 0.0188245 0.0015085 0.0037171 0.0044952 0.0083199 0.0117914 -0.0043189 0.0025072 0.0024148 -0.000517 0.0019803 -0.0138578 -0.0052466 0.0039375 0.0054866 0.0136291 -0.0045511 -0.0016366 -0.0152887 0.0060217 0.0065045 0.0152701 0.0070414 -0.0038115 0.0011873 -0.0087686 0.0075813 0.0182473 -0.0059337 0.0027623 0.0150167 0.0049285 0.0038438 -0.0026154 -0.0021301 -0.0011489 -0.0083275 0.0053673 0.0079564 -0.0013899 -0.0045921 -0.0037879 -0.0018993 -0.0019858 0.0066862 0.0142947 0.002511 0.0094207 -0.0079656 -0.0041284 0.0158535 0.0037455 -0.0187071 -0.006423 0.009498 0.013562 0.0044536 -0.0068477 -0.00256 -0.0106298 -0.0117265 0.0024544 0.0110516 0.0190512 -0.0055657 -0.0043148 -0.0126518 0.0061444 0.0059467 0.0067873 -0.0009554 0.001035 0.0084783 0.0166664 -0.0036538 0.0065981 0.0088581 -0.0074665 0.0072364 -0.0127371 -0.0185837 -0.0224908 0.015422 0.0132232 0.007523 0.0096341 0.0183871 -0.0055571 0.0049496 -0.0046443 -0.0057399 0.0132664 -7.57E-05 0.0126451 -0.0111313 -0.0053083 0.0082536 -0.0058234 0.0006066 -0.0182832 0.0024674 -0.0152876 0.0013285 -0.0010939 -0.012746 0.0093002 0.0122414 0.0175908 -0.0185988 0.0020923 0.0023196 0.0136537 0.025053 0.0140182 0.0048239 0.0043652 0.0140568 -0.0045918 0.00959 -0.0092305 -0.0057674 0.0073477 0.0060108 0.0024939 -0.0238372 -0.0017507 -0.0019 -0.0016838 -0.0181144 -0.0258479 -0.0009958 -0.0171605 -0.0070417 0.014576 0.0017009 0.0088445 0.0173825 0.0008274 0.0052494 0.0154374 -0.0035414 0.0042776 0.0050652 -0.0113403 0.0022193 0.0031724 0.0042631 0.0118845 0.0010866 -0.0222557 -0.015067 0.0031515 0.0002996 -0.0017241 0.0013495 0.0056035 0.0040894 -0.0029724 -0.0204503 -0.0022052 -0.0084092 -0.0002303 -0.0029992 0.00981 -0.0059665 -0.0007675 -0.005312 -0.0205887 0.0121394 0.0010115 0.0080552 0.007455 -0.010236 -0.0002321 -0.0077676 -0.005944 -0.0039299 0.0065152 0.0052285 -0.0146618 -0.000237 0.0060647 0.000314 0.0088313 0.0122189 0.0089529 0.0056214 -0.0110448 0.0022952 -0.0071322 -0.0006159 0.009733 -0.0050463 -0.0039169 0.0246269 -0.0006008 0.0117257 -0.005659 0.0022376 -0.0056784 0.0046348 0.0119362 -0.0075455 0.0179562 -0.0061453 -0.0119594 -0.0027516 0.0127277 0.0041824 -0.0018322 -0.0061072 -0.0115806 -0.0001493 0.0029826 0.0026768 -0.0011888 -0.0101622 -0.0035361 0.0111674 0.0039424 0.0055525 -0.0090478 -0.0006707 -0.0014921 0.0089193 0.0025127 -0.0085246 -0.0095745 -0.0018055 -0.0006779 -0.0155666 -0.0026821 0.0035236 0.0067823 -7.60E-05 -0.0149217 0.0077564 -0.0013013 0.0055762 0.0067565 0.0027955 -0.003401 -0.0006816 -0.0018957 -0.0031929 0.0109051 0.0075036 -0.002395 -0.0064652 -0.0013585 -0.0136108 0.0006888 0.0019108 0.0095753 0.0001513 -0.0020438 0.0026486 0.0107492 -0.0019458 0.0008985 -0.0109875 0.0088146 -0.0126813 0.0047744 -0.0024222 0.0105542 -0.0051878 0.0011301 -0.0018842 -0.0050671 -0.0051691 -0.0110354 -0.0087458 -0.0099216 0.0068073 0.0006236 0.0076081 0.0005412 0.0020849 7.71E-05 0.0044636 0.0008443 0.0032172 -0.0157241 -0.0029565 -0.0094728 0.0021216 0.0082858 0.0111474 -0.0058678 0.0001549 0.0065594 0.0069751 -0.0033665 0.0053505 0.0112944 -0.0002262 -0.0067325 0.0059783 0.0098353 -0.0033676 0.0008242 -0.0076692 -0.0096319 -0.0084951 0.0029163 0.0015315 -0.0112343 -0.029288 -0.0029526 -0.0013595 -0.0116716 0.0046044 -0.0104509 0.0018714 0.0038132 -0.0183881 -0.0096971 -0.0175598 0.0035536 0.014589 0.0121615 -0.0078425 -0.0074034 -0.0075428 -0.0145753 -0.0076261 0.0083941 -0.004788 -0.0088668 -0.0055493 -0.0196687 0.0241799 0.0035426 0.0020679 0.0077167 0.0192867 0.0012559 -0.0010046 0.0159538 0.0082096 -0.0070562 -0.0019781 -0.0035539 -0.0165293 0.0076307 -0.0043533 -0.0017634 0.0108669 -0.0014976 -0.0038375 -0.0087307 -0.0037168 0.0095179 0.0013404 -0.0032703 0.0234914 0.0187742 0.0048193 -0.0004809 -0.0096666 -0.0070672 0.0050415 -0.004797 0.0017914 0.0021941 -0.0124154 -0.0118227 0.0075397 -0.0073734 0.0037349 0.0082502 -0.0009042 0.0155852 0.0043626 0.0083488 0.0100224 -0.0019806 -0.0112446 0.0034426 0.00907 -0.0085107 -0.0029599 0.0052737 0.0018313 -0.0062241 -0.0173594 0.0017089 -0.0046453 0.0057017 0.0071221 -0.0053368 -0.0037365 -0.0046495 0.0018787 -0.0022058 -0.0049193 0.0051646 0.0020421 0.0015492 -0.02216 -0.0072734 -0.0020999 0.0051996 -0.0234429 -0.0041188 -0.012285 0.0057287 0.0068142 0.0076215 -0.010721 -0.0060543 0.0041555 -0.0032017 0.00026 -0.0019081 0.0047634 0.0271047 0.0123685 -0.0220011 0.0019509 -0.0130498 -0.0005152 0.0071893 -0.0226841 -0.0083221 0.0085837 -0.0020079 -0.000437 -0.0028016 -0.0032492 0.0011428 -0.0052854 -0.0145014 -0.0007172 0.0174242 -0.002294 -0.0008837 0.0017666 -0.0055755 -0.0157427 -0.0094204 -0.0049266 -0.0184609 0.0137857 0.0053153 -0.0004571 -0.0068817 0.0077043 -0.0015544 -0.0018318 0.0111224 0.0028066 0.0193398 0.0068929 -0.005121 0.0021222 -0.0112815 0.0032108 -0.0002672 -0.002765 0.016213 0.0116204 -0.0033935 0.0054761 0.0008665 0.0065608 -0.0018948 -8.62E-05 -0.0013804 0.0044793 0.0039458 -0.0009421 -0.0108556 0.0024226 0.0126231 0.0122971 0.0052123 -0.0106214 -0.0062909 -0.0096834 0.0026659 0.0031726 0.0055492 0.0017862 0.0085467 0.0066345 -0.0091655 0.0087469 -0.0020956 -0.0080037 -0.0017779 -0.0110771 -0.0074823 -0.0082348 -0.0026146 0.0026146 -0.0008708 -0.0034033 -0.0113403 -0.0039864 -0.0069476 -0.0017892 0.0032183 -0.0016079 -0.0159499 0.0002725 -0.0044596 -0.0058549 0.0056725 0.0147614 -0.0115734 -0.0024585 -0.0075037 -0.0117339 -0.0029784 -0.000746 0.0102089 0.0168471 -0.0028186 -0.0063023 0.0102098 -0.0004536 -0.005459 -0.0082448 -0.0097986 -0.0033498 -0.0006527 0.0028871 0.0120172 0.0067766 -0.0010958 0.0090046 0.0002716 0.0054166 -0.0030658 0.0072885 -0.0010764 0.0004487 -0.0026949 -0.0073128 -0.0084627 -0.015657 -9.28E-05 -0.0058657 0.0174948 -0.0106085 -0.0157969 -0.009276 -0.0138845 -0.0060932 -0.002331 -0.0023364 -0.0017559 0.0138655 0.0023084 0.0464589 -0.0046882 0.0057881 0.0347501 0.0269732 -0.0066537 0.0192347 0.0082159 -0.0122211 0.0046854 0.0156009 -0.010599 0.0170213 0.019757 -0.0107356 0.0068153 -0.0018839 -0.0082325 0.0104437 0.0070107 0.0096205 -0.0041925 -0.0099059 -0.0003265 0.0191606 -0.0071524 -0.0014528 -0.0039655 0.0024297 -0.0030787 -0.01315 -0.009998 0.0127895 -0.0037785 0.0038605 0.0321867 0.022217 0.0173181 0.0257622 -0.0002231 0.0167439 -0.0157774 -0.0074588 0.0233825 -0.0010977 0.0192167 -0.0012217 -0.0013673 -0.040786 0.0086632 0.0059312 -0.0125713 0.0008979 0.0130769 0.014801 0.0383839 -0.007165 0.002183 -0.0121728 0.0182041 -0.0130905 0.0042415 -0.0158559 -0.0180798 -0.0118188 0.0183653 0.0029681 -0.0095875 -0.0206467 -0.0096576 0.0071212 0.0074416 -0.0050543 0.0318279 0.0012984 0.0007206 -0.0009369 0.0219648 0.0066786 -0.0063965 -0.0128457 -0.0030762 0.0027189 -0.0184616 -0.0157726 0.0004436 0.0160567 -0.0089864 0.0170994 0.0015859 0.0063903 0.0174534 -0.0099665 0.0033332 -0.0064638 0.0022066 -0.016489 0.0215247 0.0043062 0.0230488 -0.0006197 0.0109605 -0.0068362 0.0062229 -0.0065659 0.0062932 0.0004091 -0.0021152 -0.0077485 0.0069969 -0.0168199 -0.027343 0.0126368 -0.0014826 0.0191042 0.0016622 0.0054519 -0.0162357 0.0018869 0.0071655 0.0129478 0.0053912 -0.0084066 -0.004816 0.0170944 0.000881 0.0087001 -0.004172 -0.0058838 6.78E-05 0.003791 -0.0171737 0.0089644 0.0189621 0.0009354 -0.0112829 0.0188672 0.0093674 0.007718 0.0012372 0 -0.0158072 0.0105877 -0.007024 -0.0036959 -0.0027146 0.0035077 -0.01036 -0.0014029 0.0020702 0.0085689 -0.0035117 0.0141697 0.003658 -0.0045746 -0.0053855 -0.0017137 0.0118042 -0.0028072 0.0003922 -0.0074121 -0.0056119 0.0047556 0.0071567 0.0148709 0.0043736 0.0060783 0.0085112 0.0040396 0.0062169 -0.0064689 0.0125229 -0.0041152 0.0023091 -0.0100869 0.0187143 -0.0022893 0.0093098 0.0089807 -0.014149 0.0014178 0.0059573 0.0059221 0.0110177 -0.0017475 0.000844 -0.0059835 -0.0043134 0.0039496 -0.009138 0.0018954 -0.0026913 -0.0078707 0.0009256 0.0079246 0.0128281 0.0040392 -0.0044017 -0.006183 -0.0126665 0.0009848 0.0087588 0.0026797 0.0024905 -0.0125765 -0.0087003 0.0029085 0.0052387 0.0131902 0.0041771 0.0095597 0.0120147 -5.91E-05 -0.0006506 0.0088942 0.0026938 -0.0024593 -0.0009972 -0.0114503 -0.0166401 0.0057776 0.0087827 0.0047475 -0.0137703 0.0112213 -0.0054756 -0.0028688 0.0061458 -0.0154661 -0.000423 0.0033186 -0.0104149 -0.0020717 0.0053531 0.0266986 -0.0013595 -0.0010061 0.0037823 0.0048252 -0.0163346 -0.0153327 -0.0151407 -0.0032039 -0.0001852 0.0087879 -0.012994 0.0025382 -0.0159545 0.0059503 0.0087668 6.19E-05 0.0037688 0.0095131 -0.0018342 0.0114391 -0.0105828 0.0026257 0.002193 -0.0095993 -0.0093822 -0.0025459 0.0080501 0.0006782 0.0020318 0.0111323 -0.0010346 0.0046776 0.0173635 0.0004169 -0.0011319 -0.0050793 -0.0086643 -0.0041177 0.0033923 -0.0059441 0.0112517 0.008267 0.0096774 -0.0049754 0.0079842 -0.0014738 0.0032982 -0.0096899 -0.0024967 -0.0046534 -0.0069607 -0.0016271 0.0028307 0.0088022 0.015029 0.0030491 0.0107731 -0.01347 -0.0041768 0.0014727 -0.0001177 0.0033501 -0.0154923 -0.0064566 0.0014983 -0.0061875 0.000241 0.0028876 -0.0065693 -0.0032705 -0.0089577 0.0011012 0.0005501 0.0073064 -0.0084682 -0.0061984 -0.0032681 -0.0009269 0.0135697 0.0026798 0.0113699 0.0017424 -0.0073508 0.0043447 0.000301 -0.0062798 0.0057982 0.0047463 0.000719 0.0013168 -0.0038356 0.0081926 -0.0090336 0.0005407 -0.0063267 0.0019927 -0.0018114 0.0026556 -0.0042886 -0.0006661 0.0032052 -0.0041749 -0.0097484 -0.0102155 0.0044436 -0.0004312 -0.0019734 0.0095836 -0.0017746 -0.0003063 0.0093909 0.0035141 -0.0029073 0.0004245 -0.0054108 0.0165653 0.0120982 0.0027803 -0.0022473 -0.0056405 -0.0009531 -0.0002384 -0.0043612 0.0009575 0.0038805 -0.0016697 -0.0030485 -0.0049813 -0.0080948 0.006469 -0.006651 -0.0036465 -0.0018283 -0.0065482 0.00331 -0.0041085 0.0038025 -0.0151112 -0.017744 0.0041664 -0.0183736 -0.0027629 0.0056461 -0.0086748 0.0106562 -0.0023013 -0.0007683 -0.002501 -0.0070881 -0.0021363 -0.0001296 0.020655 0.0113003 -0.0156906 0.0015292 0.0071689 0.0066157 -0.0085139 -0.0104413 -0.0108102 0.0040031 -0.0054274 0.0128104 0.0028104 -6.38E-05 0.0040741 0.011747 -0.0093992 0.0068217 -0.0012598 -0.0124942 0.0010844 -0.001212 0.0040131 0.0162687 -0.0022542 -0.0021337 -0.0075672 -0.0020276 -0.0007614 -0.0159962 0.002834 -0.000193 0.0026982 -0.0055972 0.0174596 -0.0026663 0.0063999 0.0040972 -0.0067536 0.0007597 -0.0077505 0.0079403 0.0037891 0.0103465 -0.002561 0.0010002 0.0101328 0.0013598 -0.004333 -0.01305 0.00226 0.0065627 -0.0025575 -0.0006873 -0.0094823 -0.006266 0.0031696 -6.33E-05 -0.0090285 -0.0050584 -0.0067631 -0.0055086 -0.0047552 -0.012616 0.0025755 -0.0088106 0.0003991 0.0013293 0.0177101 0.0071526 -0.0044807 0.0088123 -0.0005808 0.0016124 -0.0136913 -0.0057003 -0.0003943 -0.0115035 -0.0090843 0.017955 0.005783 0.0145067 -0.0021335 -0.0003237 -0.0031774 -0.0082171 -0.0070314 0.0078823 0.0022221 0.0001306 0.0032584 -0.0061346 -0.0034098 0.0073299 -0.0030694 -0.015357 -0.0035264 0.0056495 0.0047607 0.0051319 -0.0064521 -0.0068264 -0.0054681 -0.0040201 -0.0076154 0.0068094 0.0083638 0.0073688 -0.0066362 0.0031245 0.0224463 0.0250598 0.0272228 0.0015387 0.0006763 -0.0059175 0.0231609 -0.0007252 6.05E-05 -0.006124 -0.0099017 0.0059406 0.0022567 0.004862 0.0173698 -0.0045985 0.0003591 0.0023309 -0.0064082 0.0057513 -0.0017937 -0.0029967 0.0004801 -0.0108579 -0.0035848 0.008244 -0.0077571 -0.0006694 0.001156 0.0013976 0.0196026 0.0049893 0.0005331 -0.0072507 -0.004244 0.0031698 -0.0108064 -0.0023569 0.002055 0.0039771 0.0040811 -0.0051642 -0.0089502 -0.0062765 -0.0070546 0.0029506 -0.0014742 -0.0033866 -0.0028413 0.0027179 0.0041245 0.0085638 0.0096379 -0.00599 -0.0038915 0.0238393 -0.0008332 -0.0035787 -0.0016146 0.0006581 -0.0053372 -0.006152 -0.0030903 0.012424 -0.0045055 0.0083938 -0.000418 0.0069048 0.0107969 -0.0073032 -0.0029007 -0.0064232 -0.001433 -0.0083401 0.0001205 -0.0006026 -0.0108489 -0.0061125 0.0065999 0.0020688 0.0144825 -0.0082414 0.00446 -0.0076666 -0.0067492 -0.0020153 -0.0046569 0.0034335 -0.0078653 0.0040633 -0.0030767 0.0035067 0.0014728 -0.0027019 -0.0050549 0.0054237 0.005639 0.027133 -0.0056671 -0.0046771 -0.0052427 0.007524 -0.0017405 -0.0043345 0.0030722 0.0058771 -0.0112445 -0.0049101 -0.0053619 0.0034155 -0.0015233 0.0072303 0.0187717 -0.0023794 0.0153658 0.0017579 0.0022222 -0.0026907 0.0034498 0.0225662 0.0014257 0.0103181 -0.0033332 0.0036152 0.0002819 0.0100396 0.0011155 0.001337 -0.0055826 0.0095828 0.0014406 -0.0009971 0.0076743 0.0020329 -0.0092639 0.000277 0.0153338 -0.00514 -0.0044504 -0.0014879 -0.0008276 -0.0053127 -0.0047834 -0.0007251 0.0107659 -0.0025423 0.0025975 0.0112512 -0.0064059 0.0009333 -0.0087082 -0.0063305 -0.0022866 -0.0017324 0.0048542 -0.0082158 -0.0019661 -0.0073934 0.0019807 0.0149265 -0.0025654 0.0015066 -0.00173 -0.0059942 0.0025814 0.0062017 0 0.0062188 0.0033708 -0.0040907 -0.0078968 -0.0004468 -0.0056013 0.0010106 0.0067668 0.0042824 0.0019405 0.0021026 0.0015464 0.0026455 -0.0046342 0.0014919 -0.0022664 0.0065089 0.0020871 0.0063989 -0.0068379 -0.0085445 -0.0044388 -0.0081519 0.0035816 0.0059595 -0.0004999 0.0042689 -0.0007748 0.0071717 0.0128893 0.0017892 -0.0040165 0.0036373 0.0059969 0.0094889 0.0121972 -0.0004218 -0.0057113 -0.0051042 0.0036713 -0.0022863 -0.0009586 0.0003729 0.0095416 -0.0012141 0.0037959 0.0006312 0.0047217 -0.0072491 -0.0008966 -0.0024832 -0.0075933 -0.0122273 0.0095052 -0.0030511 0.0043331 -0.0037971 0.0005357 0.0153056 -0.002429 0.0031144 0.0016851 0.0061371 0.0032369 0.0030186 -0.002185 -0.0029208 0.0055734 -0.0030693 -0.0045955 0.0068854 0.0029587 0.0018124 -0.0029533 0.0103243 0.0047647 -0.0065123 0.003851 -0.0040053 -0.0093048 -0.0050504 0.0025023 0.0017687 -0.0146599 0.001739 0.0051989 0.0062136 -0.0032848 -0.0045014 -0.0142124 -0.0013312 0.006744 -0.0033398 -0.0036707 -0.0017603 0.0005871 -0.0008007 -0.0062139 0.0015034 0.0090798 0.0057258 -0.0095613 -0.0010146 0.0007477 0.0042087 0.0038734 0.0005294 -0.0015892 -0.0038243 -0.0028779 -0.0005338 0.0051663 5.31E-05 -0.0071972 -0.0100557 -0.0072684 -0.0042553 -0.000164 -0.0083462 0.001928 0.009203 -0.0073337 0.0122835 -0.0091574 -0.0107907 0.0034811 0.0043482 0.016288 -0.0054723 0.0016286 -0.0062028 -0.0073955 0 0.0035676 0.0014235 0.0081731 0.0112776 -0.0015573 0.0101589 -0.0017038 -0.0033093 -0.0004278 0.00576 0.0055684 -0.0031251 -0.0052125 0.001279 0.0077987 0.0044292 -0.0013162 0.0089682 -0.001463 0.0058391 0.0020253 -0.0007266 0.0056945 0.0182609 0.0039963 -0.0049598 0.0098951 -0.0047839 0.003024 -0.0002013 0.0016094 0.0120881 0.000546 -0.0058228 0.0015959 0.0092756 -0.0018285 -0.0084942 0.0019934 0.0166387 -0.0017152 -0.0043749 0.006188 0.0006852 0.00935 0.0020337 0.0153605 0.0099065 -0.0064826 -0.0039956 0.0010004 0.004371 -0.011299 -0.0068798 0.0024591 0.0093947 0.0050443 0.0028913 -0.008031 0.006136 -0.0010913 0.014843 -0.0276472 -0.0089838 -0.000728 0.0036832 -0.0003871 0.0078092 0.00436 -0.003592 -0.0042794 -0.0084197 -0.0112394 0.0037279 0.0106166 0.0046397 0.0116013 0.0022852 -0.0045756 0.011636 0.0102411 -0.0054833 0.0007516 0.0024389 0.0050931 0.0077995 -0.0014809 0.0002315 0.0065995 0.0107971 0.0121663 -0.0121663 0.0111318 0.0107422 -0.0012473 -0.0024546 0.0011165 0.0121117 0.0006612 -0.0066322 -0.0046243 -0.0008917 0.0042287 0.0019525 0.0044676 0.0223022 0.003662 0.0027913 0.014306 -0.0079793 0.0047189 -0.0007637 0.0039819 -0.013835 0.0087065 -0.0025955 0.0109318 0.0070129 -0.000293 -0.015864 0.0024212 -0.0138411 -0.0163938 -0.0002624 0.0211628 0.0009844 0.0114423 -0.0019474 0.0054938 0.0018947 0.0187108 0.0033385 -0.0026781 0.0096897 -0.0095247 -0.0027676 0.0011162 0.001115 0.0032553 -0.0106289 -0.0209658 -0.0015297 -0.0015746 0.0124441 -0.0020633 -0.0049016 0.0044378 0.0030317 -0.0011358 -0.0049368 0.0047684 -0.013179 -0.0071492 0.0018886 0.0124013 -0.0027992 0.0196402 0.0051094 0.0139891 0.007652 0.0054589 -0.0025438 -0.0093829 0.0019162 -0.0064154 0.0069855 8.14E-05 -0.0235169 -0.0015849 0.0064488 0.0014919 0.0173646 0.0016672 -0.0072582 0.0026158 -0.0038033 0.0142389 -0.0093341 0.0071909 0.0076619 -0.0007636 0.0034515 0.0049556 0.0047725 0.0026152 -0.0035679 -0.031262 -0.010131 0.0050784 0.0007822 -0.0032562 -0.0171137 -0.0188657 0.005761 0.0045003 0.0012277 -0.0005078 0.0081785 0.0020552 -0.0030213 0.0094946 -0.017681 -0.0062054 0.0086599 -0.0019885 -0.0051377 0.004587 0.0043973 -0.0008019 0.0008441 -0.0006752 0.0159146 0.0111147 0.0094063 0.0023581 0.0036482 0.0009302 -0.0035231 0.0131379 -0.0004004 0.0020806 -0.0095583 0.0200946 0.0018177 -0.0018177 0.0003559 -0.0175894 0.0062575 0.0148839 -0.0133256 -0.009346 -0.0018959 -0.002466 -0.0493651 -0.019278 0.0054906 -0.000949 -0.0001726 0.0027156 -0.0003875 0.0116024 0.0031449 0.002585 -0.0190132 0.0017239 -0.0100403 0.0061141 0.0098082 0.0013689 -0.0008981 0.0045679 -0.0015772 0.0096373 -0.003513 -0.00157 0.0018244 -0.0022916 0.0144676 0.0030523 -0.0028848 -0.0120892 -0.0003815 0.0016097 0.0127015 -0.0042719 0.0021382 0.0020501 0.0069971 0.0114311 0.0011073 0.0074319 0.001626 0.0015423 -0.0028835 -0.0004068 0.0014637 0.0038523 -0.0017824 -0.014786 0.0061125 -0.0053309 -0.0267938 0.0037096 0.0183032 0.0155773 0.0064869 0.0029055 0.0024148 0.0018073 -0.0006824 0.0196806 -0.0005907 -0.0031564 -0.0074571 -3.98E-05 -0.0075134 0.0067168 -0.0111796 -0.0033097 0.0034708 0.0073457 -0.0099679 -0.0031557 0.0118831 -0.003932 -0.0096951 0.0016224 0.0006887 -0.009154 -0.0053274 -0.004943 0.0175192 0.0230236 0.0023368 0.0100373 0.0076082 0.0056201 0.0060498 -0.0013455 0.010295 0.0107929 0.0029712 0.0114261 -0.0011145 -0.0044703 0.0224098 -0.0140073 -0.0018158 0.0152388 0.0060093 -0.004221 -0.0005836 0.0086099 -0.0016653 0.0131384 0.0054208 -0.0039915 -0.006736 -0.0111709 0.0089395 -0.006942 0.0146945 0.0204894 -0.0002452 0.0005254 -0.0003152 -0.0109183 0.0017691 0.0039515 -0.003704 0.004408 -0.0042313 0.0039498 0.0157143 0.0065615 0.0004818 -0.0081526 0.0088404 -0.0018927 0.0031297 -0.0045775 -0.0057428 0.0146033 0.0010594 0.0044304 0.013812 0.0099779 0.0015926 -0.0041859 0.0018293 -0.0160791 -0.0236801 0.0086074 0.0023284 0.0042661 0.0228277 0.0051132 -0.0175736 0.0019194 -0.0149125 -0.0012642 -0.0237682 -0.0228772 0.0187372 0.0086462 -0.0028621 0.024105 -0.0202675 -0.0012892 -0.0186513 0.001136 0.0023744 0.0072653 0.0132304 -0.0011451 0.0046069 0.0204556 0.0004401 -0.0025755 -0.0045572 -0.0061545 0.0059159 0.0023158 0.000884 -0.0234164 -0.0027174 -0.0248304 -0.0050553 0.0070203 0.0070777 0.024333 -0.0013152 0.0070062 -0.0022725 -0.0009311 -0.0047381 0.017219 0.005505 -0.0055731 0.0110817 0.0018855 0.0006389 0.0042268 0.0096278 0.0050268 0.0053298 0.0001641 0.0028829 0.0041785 0.0086926 -0.0039477 -0.0051359 0.0068528 -0.005843 0.0024063 -0.0127145 -0.0035258 0.0088405 -0.0023258 0.0081004 0.0028911 -0.0024683 0.0027601 -0.002435 0.0098657 -0.0008372 0.007318 0.0060259 -0.0102241 -0.0091622 -0.0002593 -0.0021419 0.004732 0.0044522 0.0053934 0.0105737 0.0075746 0.0019161 -0.0034264 -0.0041968 0.0069327 0.0113969 0.0028213 0.0153613 0.0160294 -0.002734 0.0067762 -0.0019742 0.0003592 -0.0146529 0.00176 0.0150754 0.0031607 -0.0076805 0.0102672 -0.0065541 -0.0095804 -0.0131833 0.0084039 -0.0195965 -0.0053327 -0.0045802 -0.0110221 -0.0099642 0.0011474 0.0101736 0.0151776 0.0034105 -0.0166665 -0.0091053 0.0002223 -0.0002223 -0.0138154 0.0284446 0.0052756 -0.0045872 0.0013753 0.0094505 -0.004683 0.0004351 0.0169759 0.0022276 3.05E-05 -0.027377 -0.0021325 -0.0138456 -0.0098844 -0.0054154 0.0164451 -0.0299821 -0.0237037 -0.0539666 -0.2280063 0.0519535 0.0870888 -0.0399951 -0.0001209 -0.0864182 0.0239564 0.0003859 0.0480795 0.0282764 0.015605 -0.0194649 -0.0074433 0.02193 -0.0161227 -0.0293388 -0.0172972 0.0120609 0.0270391 -0.0116558 0.0045084 -0.0151902 0.0102746 -0.0226534 0.0080905 0.0040826 0.0138954 -0.0093377 -0.0155234 -0.0426718 0.0073546 0.0062305 -0.0359346 -0.0057445 0.0213846 0.026529 0.0168007 -0.0225214 0.0074645 0.0287763 0.0025155 0.0215132 -0.0207721 0.0251161 0.001524 0.0016417 0.0127608 -0.0045133 -0.0259264 -0.0039987 0.0132807 -0.0031114 0.0351904 0.0104554 0.0010048 0.0083853 -0.0700002 0.0165818 -0.0083991 0.0015879 0.0002847 0.0247839 -0.0006747 -0.0102156 -0.0271996 0.0020998 0.0137246 0.0227415 -0.010364 -0.0007616 0.0155572 0.0148133 -0.007928 0.0020759 -0.0132343 0 -0.0049685 -0.0074391 0.0104629 0.0194349 -0.0027701 0.0065423 0.0085031 -0.002389 -0.0050279 0.0142442 0.0152872 -0.0023367 -0.0022287 -0.0108364 0.0033585 0.0202164 -0.0022428 0.0028401 -0.0003732 -0.0021675 0.0002992 0.0076377 -0.0013742 -0.0195915 0.0041605 0.0053829 -0.0009014 0.0094245 0.0095209 -0.0003688 -0.0088172 0.000372 0.0002603 -0.0208928 -0.0185496 -0.0017423 0.0077587 -0.00772 0.0031724 -0.0108743 0.0094054 0.0266428 0.0025205 0.012211 0.0027058 0.0044688 0.0006631 -0.0444267 7.70E-05 -0.0021581 -0.0049891 -0.0070034 0.0011706 0.0144032 0.0088787 0.0055852 -0.0004927 -0.0045212 -0.0048861 0.0008797 0.0054903 -0.0102424 -0.0058947 -0.0050749 -0.0036574 0.004201 -0.0168716 0.0021295 0.0114761 0.0074881 -0.012916 -0.0159454 0.004842 0.0017801 -0.0086931 0.0106279 0.0009857 0.0034226 -0.0047633 0.0339068 0.0171319 -0.0051126 0.0042123 0.0022493 -0.0070648 0.0236647 -0.0048364 0.0038783 0.0006265 0.0105546 0.0004738 -0.0171629 0.0033676 -0.006449 0.0100998 0.0145801 -0.0030519 -0.0037915 -0.0173533 0.0119696 -0.0048961 0.0092566 -0.0063087 0.014683 -0.0137636 -0.0009194 -0.0064969 0.0019609 -0.0103285 0.0057719 0.0034842 0.0066014 -0.0056768 -0.0075699 0.0056828 -0.0124475 -0.0119211 0.0044682 0.001925 -0.0101955 0.0133204 0.0223041 0.0006982 -0.0005512 0.0033759 -0.0038539 -0.0028725 -0.0043243 -0.0130112 -0.017374 0.0032403 -0.0007615 -0.0148111 0.0072027 0.0008056 0.0009966 -0.0030311 -0.012606 0.000428 0.0155921 -0.0078043 0.002236 0.0101531 0.0006859 -0.0037784 -0.0121955 0.0234504 0.0041881 0.0010537 3.76E-05 0.0036041 -0.0013876 0.0035962 0.0070053 -0.0043912 0.0093545 -0.0067845 0.0033794 0.0015929 -0.0036341 0.0021524 -0.0032675 -0.0023085 0.0030521 0.0129601 -0.0024977 -0.0019511 -0.0028044 0.0045716 0.0019476 0.020638 0.0006112 -0.0011148 -0.0143142 0.0045157 0.0010169 0.0032976 0.0106876 -0.0086637 0.0211136 0.0027536 -0.0048769 0.0003542 -0.0035476 -0.0146782 0.0044979 0.0015785 0.0003226 0 0.0005016 -0.0104049 -0.0086508 0.0044438 -0.0066365 0.0013162 -0.0213077 -0.0007468 0.0023132 -0.0169878 0.00299 0.0070046 -0.0009762 0.0037494 0.0066765 -0.0066017 0.0052625 0.0083776 0.0102829 -0.0044307 -0.0024986 0.0114132 0.0096287 0.0019434 -0.0056247 0.0016619 -0.0018427 -0.0007597 -0.0036257 -0.0037483 0.0073016 0.0094381 -0.0051763 -0.0003244 -0.0018403 0.0036053 -0.0037498 0.0009027 0.0083382 -0.006031 -0.0087157 0.0148541 0.0020735 0.0023543 0.0011039 -0.0021377 0.0057967 0.0041049 0.002469 0.0009507 -0.0020786 0.0104548 0.0012905 -0.0009415 -0.0074589 0.0139272 0.0022506 0.0087806 0.0072757 0.0039741 0.0083719 -0.0012783 -0.0008419 0.0004379 -0.0031365 0.0120538 -0.0032761 -0.0087102 -0.0137398 0.0017791 -0.0024985 0.0082929 0.0019353 0.0065927 -0.0026318 -0.0172779 0.0039111 -0.0169899 0.0024002 0.0036069 -0.0060767 0.0098431 0.0042331 0.0123894 -0.0031936 0.0007143 -0.0005102 -0.0035787 0.0082965 -0.0006097 0.0051706 0.0092937 -0.0228 -0.009509 0.0048516 -0.0028875 -0.0052117 0.005487 0.0035042 0.002603 0.0005813 0.0080015 0.0051416 -0.0036505 0.0031443 -0.003212 0.0063128 -0.0001683 0.004634 0.0016737 -0.0087002 0.0165957 0.0011939 0.014151 0.0036858 -0.0031304 0.0111076 -0.0029759 -0.0063045 0.0005866 0.0085968 0.0001938 -0.0016808 -0.0032402 0.0001298 -0.0012664 -0.00052 -0.0052476 -0.0026506 0.0019968 0.0037536 0.0221984 0.0073651 -0.0027873 0.0069537 0.0015422 0.0102315 0.0023009 -0.0114323 0.0025727 9.40E-05 0.0075536 -0.0079296 0.0045968 0.0045137 0.0109655 -0.0107792 0.0068393 0.0083233 -0.0006119 -0.0001836 -0.0013784 -0.0071676 -0.000247 -0.0116477 0.0039599 0.001679 -0.0019902 -0.0023998 0.005725 0.0174688 -0.0042774 0.005618 -0.0080398 -0.0189939 -0.005332 0.0039234 0.0044072 0.0028341 0.0103952 0.006626 0.0052146 0.0031279 0.0004547 0.0056815 0.0018065 -0.0032842 0.013132 -0.0066344 0.0071406 -0.006661 0.0006292 0.0124122 0.0115877 0.0004677 0.0114207 -0.0067553 0.0017149 0.001161 -0.0023814 0.0158369 -0.0001717 -0.0069224 0.0037688 -0.0101301 -0.0048852 0.0047981 0.0027521 -0.0035067 0.0045765 -0.0156112 0.0015252 0.010235 0.0195921 -0.0028488 0.0044691 -0.0064109 0.0023127 0.0022789 0.0064665 -0.0033131 -0.0094615 -0.0025516 0.0011763 -0.003159 0.002987 -0.0093351 -0.0066801 0.0055215 0.0048281 -0.0005193 -0.0002309 -0.0022249 0.0038975 -0.0081588 0.0002905 0.0022337 0.0100909 0.0015765 0.0049142 0.0108848 0.0062671 8.40E-05 0.0050576 0.0028389 -0.0018639 -0.0059767 -0.004492 -0.0631232 0.0272005 -0.0049415 0.0017572 0.0155906 8.64E-05 -0.0067342 -0.0032824 -0.0034975 -0.0134329 -0.0085292 2.98E-05 0.0156644 0.0024649 -0.0080038 -0.002544 -0.0149504 0.0065926 0.0099264 -0.0046834 0.0074889 0.0013262 -0.0046049 0.0075163 0.0001175 0.0030197 -0.0066377 0.000707 0.0068085 0.0060069 0.0047565 0.0004628 -0.0062956 0.0069317 0.0133217 0.0022221 -0.0052212 -0.0029507 -0.0027581 0.0031597 -0.0003729 0.0090535 0.0028958 -0.0051728 -0.0022537 -0.018593 -0.0035852 0.001109 0.0056427 0.0076279 -0.0017573 0.0057503 0.0053182 0.0077549 0.017642 -0.0025889 -0.0086503 -0.0098041 0.0045043 -0.0118567 -0.0066291 0.0035066 -0.0249846 -0.0086568 0.0110661 -0.0098799 0.0023387 0.0028346 -0.026199 0.0037161 -0.0040794 -0.0127375 -0.0008591 -0.0018433 -0.00685 0.0187105 -0.0008816 0.0064574 0.0028064 -0.0066212 0.0123304 -0.0023698 0.0019803 -0.0106676 0.0028437 0.0029863 0.008637 -0.0065008 -0.0143182 -0.0009761 -0.0060303 -0.0047703 0.0138478 0.004826 0.0049234 0.0025578 0.0083798 -0.0053789 0.0124765 -0.0029042 0.0098049 -0.0069006 0.0021874 -0.007915 0.0025859 0.0035559 0.0112946 0.0047269 -0.0057218 -0.005372 -0.0121117 0.0046666 0.0012151 0.0113971 0.0014631 -0.0035443 -0.0024973 -0.0036544 0.0144798 -0.0074482 -0.001056 -0.0019095 0.003786 0.0020485 -0.0004386 0.0070527 0.001161 -0.0001741 -0.0115554 -0.0077489 -0.0088235 -0.0122193 -0.0020865 0.0050424 0.0026769 -0.0115102 0.0051219 0.0043737 0.0066894 0.0032535 0.0083685 0.0063042 0.0043367 0.0024822 0.0027961 0.0235129 0.0077821 -0.0013258 -0.0007906 0.0013268 0.0004795 0.0094298 0.0012004 0.0023965 -0.0024523 -0.0107436 0.016974 0.0005821 0.0010248 0.0053286 0.0116077 -0.0020707 -0.0045927 -0.0049718 -0.0123017 0.0081073 0.0126946 -0.0036928 -0.005496 2.76E-05 -0.0167553 0.0044454 0.0017559 0.0038078 -0.0140804 -0.0088169 -0.0007099 0.0087105 0.0069869 0.0010899 0.0042366 0.0017229 -0.0125169 0.007674 0.0030643 -0.0084636 0.0132087 0.0115872 0.0051041 0.004455 -0.0038834 -0.0090197 0.0030156 -0.0102074 -0.0175756 0.00135 0.0036472 -0.00331 -0.0069642 0.0059521 0.0016861 -0.0017705 -0.0114287 -0.0190143 -0.0307109 0.0011954 0.0104579 0.0046883 -0.0130876 0.0098465 0.0016219 0.0019722 -0.0228131 -0.0138138 0.0020721 -0.0204506 -0.0166355 -0.030438 0.0143883 0.0313795 -0.0003111 0.00883 -0.0170482 0.0120076 0.0016418 0.0040156 -0.012189 0.0091325 -0.0054881 -0.0018361 0.0046614 -0.0121338 -0.005728 0.0029625 0.0026085 -0.0062973 -0.016304 -0.0005138 -0.021986 0.0121083 -0.0104351 -0.0134979 0.0167379 0.0286337 0.0008569 -0.0121608 0.004134 -0.0038129 0.0063362 -0.027096 -0.015558 -0.0165482 0.015349 0.0106091 -0.0143156 -0.0005354 0.0230945 0.0218054 0.00727 -0.0076541 0.000768 -0.0078039 -0.01776 -0.0093309 0.0071955 -0.0001973 0.0098852 0.0156094 0.0087479 -0.0094857 -0.0181667 0.005215 0.0197319 0.0181301 -0.0056816 0.0085571 -0.0106054 0.0003154 0.0069761 -0.0127001 0.0022809 -0.0029471 0.0044648 0.005011 -0.0004717 -0.0048237 0.0181641 0.0058176 0.0069183 0.0108798 -0.0025797 -0.0040194 0.0034722 -0.0074772 0.0114221 -0.0025776 -0.0076811 -0.0024508 0.0122854 0.0004544 -0.0002423 0.0049254 -0.0055921 0.0028755 -0.0077677 0.001309 0.0045528 -0.0114823 -0.0140048 -0.0028309 -0.0174726 -0.0017134 -0.0108879 0.0097122 0.0022231 -0.0087301 0.0039603 0.0077473 0.0366421 0.0129054 -0.0035279 -0.0083413 0.0057705 0.0137448 0.0038459 -0.000119 -0.0005656 0.0149837 0.0088196 -0.0025619 0.0153028 0.0083477 0.0192018 -0.0043382 0.0079065 0.0253609 -0.0083915 0.0095846 -0.0130928 0.0132012 0.0008938 -0.0115722 -0.0004657 0.0018614 0.0043935 -0.0121908 0.0134969 -0.0018236 0.0092199 -0.0030819 0.0198117 -0.001461 -0.0006914 -0.0025571 -0.0053215 -0.0078871 0.0121946 -0.0028607 0.0002409 -0.0039694 -0.0149455 0.0036215 -0.0036487 0.0024521 0.0063745 0.0173433 -0.0025278 -0.0003464 -0.0105022 0.0218442 -0.0014767 0.0021879 -0.0116802 0.0087531 -0.0135601 -0.0010982 0.0119344 0.0073085 0.0020746 0.0167275 0.0072744 -0.0051097 -0.011027 -0.0084951 0.002124 0.002616 -0.0092125 -0.0006066 -0.0142427 0.0045126 0.0130752 0.0006046 0.0007356 -0.0018925 -0.0072881 0.0031489 0.012445 -0.0197901 0.002711 -0.0137366 -0.0082412 0.0097738 0.0005372 -0.0002954 0.0082127 0.0022354 -0.0032483 0.0066981 0.0117194 0.002223 0.0108348 0.0073894 -0.0045508 -0.000825 -0.0068579 -0.0037985 -0.0110084 -0.0022691 0.0065296 -0.0116142 0.0025985 0.0122646 -0.0056662 -0.0040595 -0.0092878 0.0008794 0.0061872 -0.0181923 -0.0010249 0.0027757 0.0075336 -0.0086915 0.0180493 -0.0011914 -0.0110283 0.0020069 0.0102658 -0.0048538 -0.0009842 0.0032682 0.0086633 0.0056121 -0.0022253 -0.000944 0.0109322 -0.0029886 -0.0034937 -0.0090779 -0.0020579 0.0061085 -7.88E-05 0.0058109 0.0091968 0.0028922 -0.0017808 0.000155 -0.0054905 0.0143361 -0.0001536 -0.00318 -0.0056669 0.0023222 0.004115 0.0007184 -0.001463 -0.0096786 -0.0239103 0.0078318 0.0289883 0.0018928 0.0072311 -0.0008122 -0.0020079 0.0090668 -0.0004287 -0.0026266 fGarch/R/0000755000176200001440000000000013202300166011636 5ustar liggesusersfGarch/R/loglik-aparch.R0000644000176200001440000004107113202300166014501 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # .aparchLLH.internal Internal ARMA-APARCH recursion done by Fortran Code # .aparchLLH.filter Fast approach using the filter function in R # .aparchLLH.testing Simple double loops over time and order in R ################################################################################ .aparchLLH.internal <- function(params, trace = TRUE, fGarchEnv = TRUE) { # A function implemented by Diethelm Wuertz # Description: # Internal ARMA-APARCH recursion done by Fortran Code # Arguments: # params - a named numeric vector with the model parameters # to be optimized # trace - # fGarchEnv - # Value: # Returns the value of the max log-likelihood function. # Note: # The variables '.series' and '.params' must be global available # FUNCTION: # DEBUG: DEBUG = FALSE if (DEBUG) print("Entering Function .garchLLH.internal") # Get Global Variables: .series <- .getfGarchEnv(".series") .params <- .getfGarchEnv(".params") .garchDist <- .getfGarchEnv(".garchDist") .llh <- .getfGarchEnv(".llh") # How to calculate the LLH Function? if (DEBUG) print(.params$control$llh) if(.params$control$llh == "internal") { INDEX <- .params$index MDIST <- c(norm = 10, QMLE = 10, snorm = 11, std = 20, sstd = 21, ged = 30, sged = 31)[.params$cond.dist] if(.params$control$fscale) NORM <- length(.series$x) else NORM = 1 REC <- 1 if(.series$init.rec == "uev") REC <- 2 MYPAR <- c( REC = REC, # How to initialize LEV = as.integer(.params$leverage), # Include Leverage 0|1 MEAN = as.integer(.params$includes["mu"]), # Include Mean 0|1 DELTA = as.integer(.params$includes["delta"]),# Include Delta 0|1 SKEW = as.integer(.params$includes["skew"]), # Include Skew 0|1 SHAPE = as.integer(.params$includes["shape"]),# Include Shape 0|1 ORDER = .series$order, # Order of ARMA-GARCH NORM = as.integer(NORM)) # Now Estimate Parameters: MAX <- max(.series$order) NF <- length(INDEX) N <- length(.series$x) DPARM <- c(.params$delta, .params$skew, .params$shape) fit <- .Fortran( "garchllh", N = as.integer(N), Y = as.double(.series$x), # Z = as.double(rep(2, times = N)), # H = as.double(rep(0, times = N)), Z = as.double(.series$z), H = as.double(.series$h), NF = as.integer(NF), X = as.double(params), DPARM = as.double(DPARM), MDIST = as.integer(MDIST), MYPAR = as.integer(MYPAR), F = as.double(0), PACKAGE = "fGarch") llh <- fit[[10]] if(is.na(llh)) llh = .llh + 0.1*(abs(.llh)) if(!is.finite(llh)) llh = .llh + 0.1*(abs(.llh)) .setfGarchEnv(.llh = llh) if (fGarchEnv) { # Save h and z: .series$h <- fit[[4]] .series$z <- fit[[3]] .setfGarchEnv(.series = .series) } } else { stop("LLH is not internal!") } # Return Value: c(LogLikelihood = llh) } # ------------------------------------------------------------------------------ .aparchLLH.filter <- function(params, trace = TRUE, fGarchEnv = FALSE) { # A function implemented by Diethelm Wuertz # Description: # Fast approach using the filter function in R for ARMA-APARCH models # Arguments: # params - a named numeric vector with the model parameters # to be optimized # trace - a logical, should the frunction output be traced ? # fGarchEnv - # Value: # Returns the value of the max log-likelihood function. # Note: # The variables '.series' and '.params' must be global available # FUNCTION: # DEBUG: DEBUG = FALSE if (DEBUG) print("Entering Function .garchLLH.filter") # Get Global Variables: .series <- .getfGarchEnv(".series") .params <- .getfGarchEnv(".params") .garchDist <- .getfGarchEnv(".garchDist") .llh <- .getfGarchEnv(".llh") # Which conditional distribution function should be used ? if(DEBUG) print(.garchDist) # How to calculate the LLH Function? if (DEBUG) print(c("testing ?", .params$control$llh)) if(.params$control$llh == "filter") { # Retrieve From Initialized Series: x = .series$x # Get Order: u = .series$order[1] v = .series$order[2] p = .series$order[3] q = .series$order[4] max.order = max(u, v, p, q) # Get Start Conditions: h.start = .series$h.start llh.start = .series$llh.start # Get the Index Values and Add Names - Just to be Sure: index = .params$index names(params) = names(.params$params[index]) Names = names(params) # Retrieve From Initialized Parameters: cond.dist = .params$cond.dist # Extracting the parameters by name ... alpha <- beta <- NULL mu = c(mu = .params$mu) delta = c(delta = .params$delta) skew = c(skew = .params$skew) shape = c(shape = .params$shape) leverage = c(leverage = .params$leverage) if(.params$includes["mu"]) mu = params["mu"] if(u > 0) ar = params[substr(Names, 1, 2) == "ar"] if(v > 0) ma = params[substr(Names, 1, 2) == "ma"] omega = params[substr(Names, 1, 5) == "omega"] if(p > 0) alpha = params[substr(Names, 1, 5) == "alpha"] if(p > 0 & leverage) gamma = params[substr(Names, 1, 5) == "gamma"] if(p > 0 & !leverage) gamma = rep(0, times = p) if(q > 0) beta = params[substr(Names, 1, 4) == "beta"] if(.params$includes["delta"]) delta = params["delta"] if(.params$includes["skew"]) skew = params["skew"] if(.params$includes["shape"]) shape = params["shape"] if(DEBUG) print(params) # Iterate z: N = length(x) z = rep(0, N) if(u > 0 & v > 0) for (i in (h.start):N) z[i] = x[i] - mu - sum(ar*x[i-(1:u)]) - sum(ma*z[i-(1:v)]) if(u > 0 & v == 0) for (i in (h.start):N) z[i] = x[i] - mu - sum(ar*x[i-(1:u)]) if(u == 0 & v > 0) for (i in (h.start):N) z[i] = x[i] - mu - sum(ma*z[i-(1:v)]) if(u == 0 & v == 0) z = x - mu # Initialize Variance Equation: deltainv = 1/delta if(.series$model[2] == "garch") { persistence = sum(alpha) + sum(beta) } else if(.series$model[2] == "aparch") { persistence = sum(beta) for (i in 1:p) persistence = persistence + alpha[i]*garchKappa(cond.dist, gamma[i], delta, skew, shape) } names(persistence) = "persistence" attr(persistence, "control") = NULL attr(persistence, "cond.dist") = NULL .params$persistence <- persistence .setfGarchEnv(.params = .params) mvar = mean(z^2) h = rep(omega + persistence*mvar, N) # Iterate Conditional Variances h: if(p == 0) { alpha = 0 p = 1 } if(q == 0) { beta = 0 q = 1 } # R Filter Representation: # Entirely written in S, and very effective ... # own filter method because as.ts and tsp time consuming... # Note, sometimes one of the beta's can become undefined # during optimization. if(!.params$leverage) gamma = rep(0, p) pq = max(p, q) edeltat = 0 for (j in 1:p) { Filter = rep(0, length = p+1) Filter[j+1] = alpha[j] edelta = (abs(z) - gamma[j]*z)^delta edelta = as.vector(filter(edelta, filter = Filter, sides = 1)) edeltat = edeltat + edelta } c.init = omega/(1-sum(beta)) h <- c(h[1:pq], c.init + as.vector(filter(edeltat[-(1:pq)], filter = beta, method = "recursive", init = h[q:1]-c.init))) ### ? remove ? ### DW: May be not . if( sum(is.na(h)) > 0 ) { # We use the testing Version ... warning("Problems in Filter Representation") if(!.params$leverage) { for (i in (h.start):N) { h[i] = omega + sum(alpha * ( abs(z[i-(1:p)])) ^ delta ) + sum(beta*h[i-(1:q)]) } } else { for (i in (h.start):N) { h[i] = omega + sum(alpha * ( abs(z[i-(1:p)]) - gamma * z[i-(1:p)])^delta ) + sum(beta*h[i-(1:q)]) } } } # Calculate Log Likelihood: hh = (abs(h[(llh.start):N]))^deltainv zz = z[(llh.start):N] llh = -sum(log(.garchDist(z = zz, hh = hh, skew = skew, shape = shape))) if(DEBUG) cat("DEBUG - LLH: ", llh, "\n") names(params) = names(.params$params[.params$index]) if(is.na(llh)) llh = .llh + 0.1*(abs(.llh)) if(!is.finite(llh)) llh = .llh + 0.1*(abs(.llh)) # Print if LLH has Improved: if(llh < .llh) { diff = (.llh - llh)/llh if(trace & diff > 1e-2) { # cat(" LLH: ", llh, " norm LLH: ", llh/N, "\n") # print(params) if(persistence > 1) cat("Warning - Persistence:", persistence, "\n") } .setfGarchEnv(.llh = llh) } if (fGarchEnv) { # Save h and z: .series$h <- h .series$z <- z .setfGarchEnv(.series = .series) } } else { stop("LLH is not filter!") } # Return Value: if (DEBUG) print("Entering Function .garchLLH.filter") c(LogLikelihood = llh) } # ------------------------------------------------------------------------------ .aparchLLH.testing <- function(params, trace = TRUE, fGarchEnv = FALSE) { # A function implemented by Diethelm Wuertz # Description: # Compute Log-Likelihood Function for ARMA-APARCH models # Arguments: # params - a named numeric vector with the model parameters # to be optimized # trace - # fGarchEnv - # Value: # Returns the value of the max log-likelihood function. # Note: # The variables '.series' and '.params' must be global available # FUNCTION: # DEBUG: DEBUG = FALSE if (DEBUG) print("Entering Function .garchLLH.testing") # Get Global Variables: .series <- .getfGarchEnv(".series") .params <- .getfGarchEnv(".params") .garchDist <- .getfGarchEnv(".garchDist") .llh <- .getfGarchEnv(".llh") if(DEBUG) print(.garchDist) # How to calculate the LLH Function? if (DEBUG) print(.params$control$llh) if(.params$control$llh == "testing") { # Retrieve From Initialized Series: x = .series$x # Get Order: u = .series$order[1] v = .series$order[2] p = .series$order[3] q = .series$order[4] max.order = max(u, v, p, q) # Get Start Conditions: h.start = .series$h.start llh.start = .series$llh.start # Get the Index Values and Add Names - Just to be Sure: index = .params$index names(params) = names(.params$params[index]) Names = names(params) # Retrieve From Initialized Parameters: cond.dist = .params$cond.dist if(DEBUG) print(paste("Conditional Distribution:", cond.dist)) # Extracting the parameters by name ... alpha <- beta <- NULL mu = c(mu = .params$mu) delta = c(delta = .params$delta) skew = c(skew = .params$skew) shape = c(shape = .params$shape) leverage = c(leverage = .params$leverage) if(.params$includes["mu"]) mu = params["mu"] if(u > 0) ar = params[substr(Names, 1, 2) == "ar"] if(v > 0) ma = params[substr(Names, 1, 2) == "ma"] omega = params[substr(Names, 1, 5) == "omega"] if(p > 0) alpha = params[substr(Names, 1, 5) == "alpha"] if(p > 0 & leverage) gamma = params[substr(Names, 1, 5) == "gamma"] if(p > 0 & !leverage) gamma = rep(0, times = p) if(q > 0) beta = params[substr(Names, 1, 4) == "beta"] if(.params$includes["delta"]) delta = params["delta"] if(.params$includes["skew"]) skew = params["skew"] if(.params$includes["shape"]) shape = params["shape"] if(DEBUG) print(params) # Iterate z: N = length(x) z = rep(0, N) if(u > 0 & v > 0) for (i in (h.start):N) z[i] = x[i] - mu - sum(ar*x[i-(1:u)]) - sum(ma*z[i-(1:v)]) if(u > 0 & v == 0) for (i in (h.start):N) z[i] = x[i] - mu - sum(ar*x[i-(1:u)]) if(u == 0 & v > 0) for (i in (h.start):N) z[i] = x[i] - mu - sum(ma*z[i-(1:v)]) if(u == 0 & v == 0) z = x - mu # Initialize Variance Equation: deltainv = 1/delta if(.series$model[2] == "garch") { persistence = sum(alpha) + sum(beta) } else if(.series$model[2] == "aparch") { persistence = sum(beta) for (i in 1:p) persistence = persistence + alpha[i]*garchKappa(cond.dist, gamma[i], delta, skew, shape) } names(persistence) = "persistence" attr(persistence, "control") = NULL attr(persistence, "cond.dist") = NULL .params$persistence <- persistence .setfGarchEnv(.params = .params) mvar = mean(z^2) h = rep(omega + persistence*mvar, N) # Initial Values to Iterate Conditional Variances h: if(p == 0) { alpha = 0 p = 1 } if(q == 0) { beta = 0 q = 1 } # Test Version Just a Simple Double 'for' Loop: # As You Can Imagine, Slow Version But Very Useful for Testing: if(!.params$leverage) { for (i in (h.start):N) { h[i] = omega + sum(alpha * ( abs(z[i-(1:p)])) ^ delta ) + sum(beta*h[i-(1:q)]) } } else { for (i in (h.start):N) { h[i] = omega + sum(alpha * ( abs(z[i-(1:p)]) - gamma * z[i-(1:p)])^delta ) + sum(beta*h[i-(1:q)]) } } # Calculate Log Likelihood: hh = (abs(h[(llh.start):N]))^deltainv zz = z[(llh.start):N] llh = -sum(log(.garchDist(z = zz, hh = hh, skew = skew, shape = shape))) if(DEBUG) cat("DEBUG - LLH: ", llh, "\n") names(params) = names(.params$params[.params$index]) if(is.na(llh)) llh = .llh + 0.1*(abs(.llh)) if(!is.finite(llh)) llh = .llh + 0.1*(abs(.llh)) # Print if LLH has Improved: if(llh < .llh) { diff = (.llh - llh)/llh if(trace & diff > 1e-2) { # cat(" LLH: ", llh, " norm LLH: ", llh/N, "\n") # print(params) if(persistence > 1) cat("Warning - Persistence:", persistence, "\n") } .setfGarchEnv(.llh = llh) } if (fGarchEnv) { # Save h and z: .series$h <- h .series$z <- z .setfGarchEnv(.series = .series) } } else { stop("LLH is not testing!") } # Return Value: if (DEBUG) print("Leaving Function .garchLLH.testing") c(LogLikelihood = llh) } ################################################################################ fGarch/R/class-fGARCHSPEC.R0000644000176200001440000000242213202277107014541 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: SPECIFICATION: # fGARCHSPEC S4 fGARCHSPEC Class representation ################################################################################ setClass("fGARCHSPEC", representation( call = "call", formula = "formula", model = "list", presample = "matrix", distribution = "character", rseed = "numeric") ) ################################################################################ fGarch/R/dist-snorm.R0000644000176200001440000001453713202277107014102 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # dsnorm Density for the skew normal Distribution # psnorm Probability function for the skew NORM # qsnorm Quantile function for the skew NORM # rsnorm Random Number Generator for the skew NORM # FUNCTION: DESCRIPTION: # .dsnorm Internal, density for the skew normal Distribution # .psnorm Internal, probability function for the skew NORM # .qsnorm Internal, quantile function for the skew NORM # .rsnorm Internal, random Number Generator for the skew NORM ################################################################################ dsnorm <- function(x, mean = 0, sd = 1, xi = 1.5, log = FALSE) { # A function implemented by Diethelm Wuertz # Description: # Compute the density function of the skew normal distribution # Arguments: # x - a numeric vector of quantiles. # mean, sd, xi - location parameter, scale parameter, and # skewness parameter. # FUNCTION: # Params: if (length(mean) == 3) { xi = mean[3] sd = mean[2] mean = mean[1] } # Shift and Scale: result = .dsnorm(x = (x-mean)/sd, xi = xi) / sd # Log: if(log) result = log(result) # Return Value: result } # ------------------------------------------------------------------------------ psnorm <- function(q, mean = 0, sd = 1, xi = 1.5) { # A function implemented by Diethelm Wuertz # Description: # Compute the distribution function of the # skew normal distribution # Arguments: # q - a numeric vector of quantiles. # mean, sd, xi - location parameter, scale parameter, and # skewness parameter. # FUNCTION: # Shift and Scale: result = .psnorm(q = (q-mean)/sd, xi = xi) # Return Value: result } # ------------------------------------------------------------------------------ qsnorm <- function(p, mean = 0, sd = 1, xi = 1.5) { # A function implemented by Diethelm Wuertz # Description: # Compute the quantile function of the # skew normal distribution # Arguments: # p - a numeric vector of probabilities. # mean, sd, xi - location parameter, scale parameter, and # skewness parameter. # FUNCTION: # Shift and Scale: result = .qsnorm(p = p, xi = xi) * sd + mean # Return Value: result } # ------------------------------------------------------------------------------ rsnorm <- function(n, mean = 0, sd = 1, xi = 1.5) { # A function implemented by Diethelm Wuertz # Description: # Generate random deviates from the # skew normal distribution # Arguments: # n - an integer value giving the number of observation. # mean, sd, xi - location parameter, scale parameter, and # skewness parameter. # FUNCTION: # Shift and Scale: result = .rsnorm(n = n, xi = xi) * sd + mean # Return Value: result } ################################################################################ .dsnorm <- function(x, xi) { # A function implemented by Diethelm Wuertz # Description: # Compute the density function of the "normalized" skew # normal distribution # FUNCTION: # Standardize: m1 = 2/sqrt(2*pi) mu = m1 * (xi - 1/xi) sigma = sqrt((1-m1^2)*(xi^2+1/xi^2) + 2*m1^2 - 1) z = x*sigma + mu # Compute: Xi = xi^sign(z) g = 2 / (xi + 1/xi) Density = g * dnorm(x = z/Xi) # Return Value: Density * sigma } # ------------------------------------------------------------------------------ .psnorm <- function(q, xi) { # A function implemented by Diethelm Wuertz # Description: # Internal Function # FUNCTION: # Standardize: m1 = 2/sqrt(2*pi) mu = m1 * (xi - 1/xi) sigma = sqrt((1-m1^2)*(xi^2+1/xi^2) + 2*m1^2 - 1) z = q*sigma + mu # Compute: Xi = xi^sign(z) g = 2 / (xi + 1/xi) Probability = Heaviside(z) - sign(z) * g * Xi * pnorm(q = -abs(z)/Xi) # Return Value: Probability } # ------------------------------------------------------------------------------ .qsnorm <- function(p, xi) { # A function implemented by Diethelm Wuertz # Description: # Internal Function # FUNCTION: # Standardize: m1 = 2/sqrt(2*pi) mu = m1 * (xi - 1/xi) sigma = sqrt((1-m1^2)*(xi^2+1/xi^2) + 2*m1^2 - 1) # Compute: g = 2 / (xi + 1/xi) sig = sign(p-1/2) Xi = xi^sig p = (Heaviside(p-1/2)-sig*p) / (g*Xi) Quantile = (-sig*qnorm(p = p, sd = Xi) - mu ) / sigma # Return Value: Quantile } # ------------------------------------------------------------------------------ .rsnorm <- function(n, xi) { # A function implemented by Diethelm Wuertz # Description: # Internal Function # FUNCTION: # Generate Random Deviates: weight = xi / (xi + 1/xi) z = runif(n, -weight, 1-weight) Xi = xi^sign(z) Random = -abs(rnorm(n))/Xi * sign(z) # Scale: m1 = 2/sqrt(2*pi) mu = m1 * (xi - 1/xi) sigma = sqrt((1-m1^2)*(xi^2+1/xi^2) + 2*m1^2 - 1) Random = (Random - mu ) / sigma # Return value: Random } ################################################################################ fGarch/R/dist-stdFit.R0000644000176200001440000001002413202277107014164 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: PARAMETER ESTIMATION: # stdFit Fit the parameters for a Sudent-t distribution ################################################################################ .stdFit <- function(x, mean = 0, sd = 1, xi = 1.5, scale = NA, doplot = TRUE, add = FALSE, span = "auto", trace = TRUE, title = NULL, description = NULL, ...) { # A function implemented by Diethelm Wuertz # Description: # Fits parameters of a Student-t using maximum log-likelihood # Example: # set.seed(4711); x = rstd(500); .stdFit(x)@fit$estimate # FUNCTION: # Settings: dist = dstd model = "STD Parameter Estimation" scale = "not used" x = x.orig = as.vector(x) # Parameter Estimation: obj = function(x, y = x, trace) { f = try(-sum(log(dist(y, x[1], x[2], x[3]))), silent = TRUE) if (is.na(f) | class(f) == "try-error") return(1e9) # Print Iteration Path: if (trace) { cat("\n Objective Function Value: ", -f) cat("\n Parameter Estimates: ", x, "\n") } f } r = nlminb( start = c(mean = 0, sd = 1, nu = 5), objective = obj, lower = c(-Inf, 0, 2), upper = c( Inf, Inf, Inf), y = x, trace = trace) names(r$par) <- c("mean", "sd", "nu") # Add Title and Description: if (is.null(title)) title = model if (is.null(description)) description = description() # Result: fit = list(estimate = r$par, minimum = -r$objective, code = r$convergence) # Optional Plot: if (doplot) { x = as.vector(x.orig) if (span == "auto") span = seq(min(x), max(x), length = 501) z = density(x, n = 100, ...) x = z$x[z$y > 0] y = z$y[z$y > 0] y.points = dstd(span, r$par[1], r$par[2], r$par[3]) ylim = log(c(min(y.points), max(y.points))) if (add) { lines(x = span, y = log(y.points), col = "steelblue") } else { plot(x, log(y), xlim = c(span[1], span[length(span)]), ylim = ylim, type = "p", xlab = "x", ylab = "log f(x)", ...) title(main = model) lines(x = span, y = log(y.points), col = "steelblue") } } # Return Value: new("fDISTFIT", call = match.call(), model = model, data = as.data.frame(x.orig), fit = fit, title = title, description = description() ) } # ------------------------------------------------------------------------------ stdFit <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Fit the parameters for a skew Normal distribution # FUNCTION: # Start Value: start = c(mean = mean(x), sd = sqrt(var(x)), nu = 4) # Log-likelihood Function: loglik = function(x, y = x){ f = -sum(log(dstd(y, x[1], x[2], x[3]))) f } # Minimization: fit = nlminb( start = start, objective = loglik, lower = c(-Inf, 0, 2), upper = c(Inf, Inf, Inf), y = x, ...) # Add Names to $par names(fit$par) = c("mean", "sd", "nu") # Return Value: fit } ################################################################################ fGarch/R/fGarch-package.R0000644000176200001440000000144313202277107014556 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ fGarch/R/garch-SolverControl.R0000644000176200001440000000745713202277107015703 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ############################################################################## # FUNCTION: DESCRIPTION: # garchFitControl Sets default values for Garch Optimizer ############################################################################## garchFitControl <- function( llh = c("filter", "internal", "testing"), nlminb.eval.max = 2000, nlminb.iter.max = 1500, nlminb.abs.tol = 1.0e-20, nlminb.rel.tol = 1.0e-14, nlminb.x.tol = 1.0e-14, nlminb.step.min = 2.2e-14, nlminb.scale = 1, nlminb.fscale = FALSE, nlminb.xscale = FALSE, sqp.mit = 200, sqp.mfv = 500, sqp.met = 2, sqp.mec = 2, sqp.mer = 1, sqp.mes = 4, sqp.xmax = 1.0e3, sqp.tolx = 1.0e-16, sqp.tolc = 1.0e-6, sqp.tolg = 1.0e-6, sqp.told = 1.0e-6, sqp.tols = 1.0e-4, sqp.rpf = 1.0e-4, lbfgsb.REPORT = 10, lbfgsb.lmm = 20, lbfgsb.pgtol = 1e-14, lbfgsb.factr = 1, lbfgsb.fnscale = FALSE, lbfgsb.parscale = FALSE, nm.ndeps = 1e-14, nm.maxit = 10000, nm.abstol = 1e-14, nm.reltol = 1e-14, nm.alpha = 1.0, nm.beta = 0.5, nm.gamma = 2.0, nm.fnscale = FALSE, nm.parscale = FALSE) { # A function implemented by Diethelm Wuertz # Description: # Sets default values for Garch Optimizer # FUNCTION: # Generate Control List with Default Settings: control <- list( llh = llh, nlminb.eval.max = nlminb.eval.max, nlminb.iter.max = nlminb.iter.max, nlminb.abs.tol = nlminb.abs.tol, nlminb.rel.tol = nlminb.rel.tol, nlminb.x.tol = nlminb.x.tol, nlminb.step.min = nlminb.step.min, nlminb.scale = nlminb.scale, nlminb.fscale = nlminb.fscale, nlminb.xscale = nlminb.xscale, sqp.mit = sqp.mit, sqp.mfv = sqp.mfv, sqp.met = sqp.met, sqp.mec = sqp.mec, sqp.mer = sqp.mer, sqp.mes = sqp.mes, sqp.xmax = sqp.xmax, sqp.tolx = sqp.tolx, sqp.tolc = sqp.tolc, sqp.tolg = sqp.tolg, sqp.told = sqp.told, sqp.tols = sqp.tols, sqp.rpf = sqp.rpf, lbfgsb.REPORT = lbfgsb.REPORT, lbfgsb.lmm = lbfgsb.lmm, lbfgsb.pgtol = lbfgsb.pgtol, lbfgsb.factr = lbfgsb.factr, lbfgsb.fnscale = lbfgsb.fnscale, lbfgsb.parscale = lbfgsb.parscale, nm.ndeps = nm.ndeps, nm.maxit = nm.maxit, nm.abstol = nm.abstol, nm.reltol = nm.reltol, nm.alpha = nm.alpha, nm.beta = nm.beta, nm.gamma = nm.gamma, nm.fnscale = nm.fnscale, nm.parscale = nm.parscale ) # Return Value: control } ################################################################################ fGarch/R/garch-Solver.R0000644000176200001440000001233213202277107014326 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: SOLVER: # .garchRnlminb R coded solver nlmin # .garchRlbgfsb R coded solver optim using method lbgfsb # .garchRnm R coded solver nm as hybrid addon ################################################################################ .garchRnlminb <- function(.params, .series, .garchLLH, trace) { # A function implemented by Diethelm Wuertz # Description: # Port3 nlminb R-code Solver # Arguments: # FUNCTION: # Port3 nlminb R-code Solver: if(trace) cat("\nR coded nlminb Solver: \n\n") # Scale Function and Parameters: INDEX = .params$index parscale = rep(1, length = length(INDEX)) names(parscale) = names(.params$params[INDEX]) parscale["omega"] = var(.series$x)^(.params$delta/2) parscale["mu"] = abs(mean(.series$x)) # Control: TOL1 = .params$control$tol1 # Fit Parameters - par | objective: fit <- nlminb( start = .params$params[INDEX], objective = .garchLLH, lower = .params$U[INDEX], upper = .params$V[INDEX], scale = 1/parscale, control = list( eval.max = 2000, iter.max = 1500, rel.tol = 1.0e-14 * TOL1, x.tol = 1.0e-14 * TOL1, trace = as.integer(trace)), fGarchEnv = FALSE) # to speed up .garchLLH fit$value <- fit.llh <- fit$objective names(fit$par) = names(.params$params[INDEX]) # make sure to save new h and z (important to speed up code) .garchLLH(fit$par, trace = FALSE, fGarchEnv = TRUE) # Result: fit$coef <- fit$par fit$llh <- fit$objective # Return Value: fit } # ------------------------------------------------------------------------------ .garchRlbfgsb <- function(.params, .series, .garchLLH, trace) { # A function implemented by Diethelm Wuertz # Description: # optim[L-BFGS-B] Solver # Arguments: # FUNCTION: # optim[L-BFGS-B] Solver: if(trace) cat("\nR coded optim[L-BFGS-B] Solver: \n\n") # Scale Function and Parameters: INDEX = .params$index parscale = rep(1, length = length(INDEX)) names(parscale) = names(.params$params[INDEX]) parscale["omega"] = var(.series$x)^((.params$params["delta"])/2) # Control: TOL1 = .params$control$tol1 # Fit Parameters - par, value: fit <- optim( par = .params$params[INDEX], fn = .garchLLH, lower = .params$U[INDEX], upper = .params$V[INDEX], method = "L-BFGS-B", control = list( parscale = parscale, lmm = 20, pgtol = 1.0e-11 * TOL1, factr = 1.0 * TOL1, trace = as.integer(trace)), fGarchEnv = FALSE) # to speed up .garchLLH names(fit$par) = names(.params$params[INDEX]) # make sure to save new h and z (important to speed up code) .garchLLH(fit$par, trace = FALSE, fGarchEnv = TRUE) # Print Hessian Matrix: # print(fit$hessian) # Add to Result: fit$coef = fit$par fit$llh = fit$value # Return Value: fit } # ------------------------------------------------------------------------------ .garchRnm <- function(.params, .series, .garchLLH, trace) { # A function implemented by Diethelm Wuertz # Description: # Nelder-Mead as Hybrid Solver # Arguments: # FUNCTION: # Nelder-Mead as Hybrid Solver: if(trace) cat("\nR coded Nelder-Mead Hybrid Solver: \n\n") # Scale Function and Parameters: INDEX = .params$index fnscale = abs(.params$llh) parscale = abs(.params$params[INDEX]) # Control: TOL2 = .params$control$tol2 # Fit Parameters: fit = optim( par = .params$params[INDEX], fn = .garchLLH, method = "Nelder-Mead", control = list( ndeps = rep(1e-14*TOL2, length = length(INDEX)), maxit = 10000, reltol = 1.0e-11 * TOL2, fnscale = fnscale, parscale = c(1, abs((.params$params[INDEX])[-1])), trace = as.integer(trace)), hessian = TRUE, fGarchEnv = FALSE) # to speed up .garchLLH names(fit$par) = names(.params$params[INDEX]) # Make sure to save new h and z: (important to speed up code) .garchLLH(fit$par, trace = FALSE, fGarchEnv = TRUE) # Result: fit$coef = fit$par fit$llh = fit$value # Return Value: fit } ################################################################################ fGarch/R/methods-fitted.R0000644000176200001440000000331613202305444014710 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # METHOD: EXTRACTORS: # fitted.fGARCH S3 fitted values for an object of class 'fGARCH' ################################################################################ setMethod(f = "fitted", signature(object = "fGARCH"), definition = function(object) { # A function implemented by Diethelm Wuertz # Description: # S3 Fitted values method for an object of class fGARCH # Arguments: # object - an object of class fGarch as returned by the function # garchFit # FUNCTION: # Get numeric vector of fitted, optionally standardized fitted = object@fitted # Get original time series class: ans = slot(object, "data") Name = as.character(object@formula[2]) attr(ans, "Name") <- Name # Return Value: ans }) ################################################################################ fGarch/R/methods-formula.R0000644000176200001440000000275513202277107015110 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # formula.fGARCH Extracts 'fGarch' Model formulaficients ################################################################################ setMethod(f = "formula", signature(x = "fGARCH"), definition = function(x) { # A function implemented by Diethelm Wuertz # Description: # Extracts 'fGarch' Model formula # Arguments: # x - an object of class fGarch as returned by the function # garchFit # FUNCTION: # Numeric vector of fitted values: ans = slot(x, "formula") # Return Value: ans }) ################################################################################ fGarch/R/dist-sgedFit.R0000644000176200001440000001022513202277107014317 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: PARAMETER ESTIMATION: # sgedFit Fit the parameters for a skew GED distribution ################################################################################ .sgedFit <- function(x, mean = 0, sd = 1, nu = 2, xi = 1.5, scale = NA, doplot = TRUE, add = FALSE, span = "auto", trace = TRUE, title = NULL, description = NULL, ...) { # A function implemented by Diethelm Wuertz # Description: # Fits parameters of skewed GED using maximum log-likelihood # Example: # set.seed(4711); x = rsged(500); .sgedFit(x)@fit$estimate # FUNCTION: # Settings: dist = dsged model = "SGED Parameter Estimation" scale = "not used" x = x.orig = as.vector(x) # Parameter Estimation: obj = function(x, y = x, trace) { f = try(-sum(log(dist(y, x[1], x[2], x[3], x[4]))), silent = TRUE) if (is.na(f) | class(f) == "try-error") return(1e9) # Print Iteration Path: if (trace) { cat("\n Objective Function Value: ", -f) cat("\n Parameter Estimates: ", x, "\n") } f } r = nlminb( start = c(mean = 0, sd = 1, nu = 2, xi = 1.5), objective = obj, lower = c(-Inf, 0, 0, 0), upper = c( Inf, Inf, Inf, Inf), y = x, trace = trace) names(r$par) <- c("mean", "sd", "nu", "xi") # Add Title and Description: if (is.null(title)) title = model if (is.null(description)) description = description() # Result: fit = list(estimate = r$par, minimum = -r$objective, code = r$convergence) # Optional Plot: if (doplot) { x = as.vector(x.orig) if (span == "auto") span = seq(min(x), max(x), length = 501) z = density(x, n = 100, ...) x = z$x[z$y > 0] y = z$y[z$y > 0] y.points = dist(span, r$par[1], r$par[2], r$par[3], r$par[4]) ylim = log(c(min(y.points), max(y.points))) if (add) { lines(x = span, y = log(y.points), col = "steelblue") } else { plot(x, log(y), xlim = c(span[1], span[length(span)]), ylim = ylim, type = "p", xlab = "x", ylab = "log f(x)", ...) title(main = model) lines(x = span, y = log(y.points), col = "steelblue") } } # Return Value: new("fDISTFIT", call = match.call(), model = model, data = as.data.frame(x.orig), fit = fit, title = title, description = description() ) } # ------------------------------------------------------------------------------ sgedFit <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Fit the parameters for a skew Normal distribution # FUNCTION: # Start Value: start = c(mean = mean(x), sd = sqrt(var(x)), nu = 2, xi = 1) # Log-likelihood Function: loglik = function(x, y = x){ f = -sum(log(dsged(y, x[1], x[2], x[3], x[4]))) f } # Minimization: fit = nlminb( start = start, objective = loglik, lower = c(-Inf, 0, 0, 0), upper = c( Inf, Inf, Inf, Inf), y = x, ...) # Add Names to $par names(fit$par) = c("mean", "sd", "nu", "xi") # Return Value: fit } ################################################################################ fGarch/R/garch-Initialization.R0000644000176200001440000002575513202277107016060 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # .garchInitSeries Initializes Series # .garchInitParameters Initializes Parameters ################################################################################ .garchInitSeries <- function(formula.mean, formula.var, cond.dist, series, scale, init.rec, h.start, llh.start, trace) { # A function implemented by Diethelm Wuertz # Description: # Initialize time series # Arguments: # see function garchFit() # FUNCTION: # Check Mean Formula ARMA - Is it Valid ? mm = length(formula.mean) if(mm != 2) stop("Mean Formula misspecified") end = regexpr("\\(", as.character(formula.mean[mm])) - 1 model.mean = substr(as.character(formula.mean[mm]), 1, end) if(!any( c("ar", "ma", "arma") == model.mean)) stop("formula.mean must be one of: ar, ma, arma") # Check Variance Formula GARCH - Is it Valid ? mv = length(formula.var) if(mv != 2) stop("Variance Formula misspecified") end = regexpr("\\(", as.character(formula.var[mv])) - 1 model.var = substr(as.character(formula.var[mv]), 1, end) if(!any( c("garch", "aparch") == model.var)) stop("formula.var must be one of: garch, aparch") # Determine Mean Order from ARMA Formula: model.order = as.numeric(strsplit(strsplit(strsplit(as.character( formula.mean), "\\(")[[2]][2], "\\)")[[1]], ",")[[1]]) u = model.order[1] v = 0 if(length(model.order) == 2) v = model.order[2] maxuv = max(u, v) if(u < 0 | v < 0) stop("*** ARMA orders must be positive.") # Determine Variance Order from GARCH Formula: model.order = as.numeric(strsplit(strsplit(strsplit(as.character( formula.var), "\\(")[[2]][2], "\\)")[[1]], ",")[[1]]) p = model.order[1] q = 0 if(length(model.order) == 2) q = model.order[2] if(p+q == 0) stop("Misspecified GARCH Model: Both Orders are zero!") maxpq = max(p, q) if(p < 0 | q < 0) stop("*** GARCH orders must be positive.") # Fix Start Position of Series "h" and for Likelihood Calculation: max.order = max(maxuv, maxpq) if(is.null(h.start)) h.start = max.order + 1 if(is.null(llh.start)) llh.start = 1 # Check for Recursion Initialization: if(init.rec != "mci" & model.var != "garch") { stop("Algorithm only supported for mci Recursion") } # Trace the Result: if(trace) { cat("\nSeries Initialization:") cat("\n ARMA Model: ", model.mean) cat("\n Formula Mean: ", as.character(formula.mean)) cat("\n GARCH Model: ", model.var) cat("\n Formula Variance: ", as.character(formula.var)) cat("\n ARMA Order: ", u, v) cat("\n Max ARMA Order: ", maxuv) cat("\n GARCH Order: ", p, q) cat("\n Max GARCH Order: ", maxpq) cat("\n Maximum Order: ", max.order) cat("\n Conditional Dist: ", cond.dist) cat("\n h.start: ", h.start) cat("\n llh.start: ", llh.start) cat("\n Length of Series: ", length(series)) cat("\n Recursion Init: ", init.rec) cat("\n Series Scale: ", scale) cat("\n\n") } # Result: ans = list( model = c(model.mean, model.var), order = c(u = u, v = v, p = p, q = q), max.order = max.order, z = rep(0, times = length(series)), h = rep(var(series), times = length(series)), x = series, scale = scale, init.rec = init.rec, h.start = h.start, llh.start = llh.start) # Return Value: ans } # ------------------------------------------------------------------------------ .garchInitParameters <- function(formula.mean, formula.var, delta, skew, shape, cond.dist, include.mean, include.delta, include.skew, include.shape, leverage, algorithm, control, trace) { # A function implemented by Diethelm Wuertz # Description: # Initialize model parameters # Arguments: # see function garchFit() # FUNCTION: # DEBUG: .DEBUG = FALSE # global variables .series <- .getfGarchEnv(".series") # Determine Mean Order from ARMA Formula: model.order = as.numeric(strsplit(strsplit(strsplit(as.character( formula.mean), "\\(")[[2]][2], "\\)")[[1]], ",")[[1]]) u = model.order[1] v = 0 if(length(model.order) == 2) v = model.order[2] # Determine Variance Order from GARCH Formula: model.order = as.numeric(strsplit(strsplit(strsplit(as.character( formula.var), "\\(")[[2]][2], "\\)")[[1]], ",")[[1]]) p = model.order[1] if (p == 0) stop("The order p must be > 0 in GARCH/APARCH(p,q)") q = 0 if(length(model.order) == 2) q = model.order[2] # Includes: model.var = .series$model[2] if(is.null(include.delta)) { if(model.var == "garch") { include.delta = FALSE } else { include.delta = TRUE } } if(is.null(leverage)) { if(model.var == "garch") { leverage = FALSE } else { leverage = TRUE } } # Distributional Includes: if(cond.dist == "t") cond.dist = "std" skewed.dists = c("snorm", "sged", "sstd", "snig") if(is.null(include.skew)) { if(any(skewed.dists == cond.dist)) { include.skew = TRUE } else { include.skew = FALSE } } shaped.dists = c("ged", "sged", "std", "sstd", "snig") if(is.null(include.shape)) { if(any(shaped.dists == cond.dist)) { include.shape = TRUE } else { include.shape = FALSE } } # Set Names for Parameters: Names = c( "mu", if(u > 0) paste("ar", 1:u, sep = ""), if(v > 0) paste("ma", 1:v, sep = ""), "omega", if(p > 0) paste("alpha", 1:p, sep = ""), if(p > 0) paste("gamma", 1:p, sep = ""), if(q > 0) paste("beta", 1:q, sep = ""), "delta", "skew", "shape") if(.DEBUG) { cat("\nDEBUG - Names: \n"); print(Names) } # Initialize Model Parameters to be Estimated: fit.mean = arima(.series$x, order = c(u, 0, v), include.mean = include.mean)$coef alpha.start = 0.1 beta.start = 0.8 ## if(include.delta) delta = 1.5 params = c( if(include.mean) fit.mean[length(fit.mean)] else 0, if(u > 0) fit.mean[1:u], if(v > 0) fit.mean[(u+1):(length(fit.mean)-as.integer(include.mean))], var(.series$x, na.rm = TRUE)*(1-alpha.start-beta.start), if(p > 0) rep(alpha.start/p, times = p), if(p > 0) rep(0.1, times = p), if(q > 0) rep(beta.start/q, times = q), delta, skew, shape) names(params) = Names if(.DEBUG) { cat("\nDEBUG - params: \n"); print(params) } # Set Lower Limits of Parameters to be Estimated: TINY = 1.0e-8 USKEW = 1/10; USHAPE = 1 if (cond.dist == "snig") USKEW = -0.99 U = c( -10*abs(mean(.series$x)), if(u > 0) rep(-1+TINY, times = u), if(v > 0) rep(-1+TINY, times = v), 1.0e-6*var(.series$x), if(p > 0) rep( 0+TINY, times = p), if(p > 0) rep(-1+TINY, times = p), if(q > 0) rep( 0+TINY, times = q), 0, # delta USKEW, # skew USHAPE) # shape names(U) = Names if(.DEBUG) { cat("\nDEBUG - U: \n"); print(U) } # Set Upper Limits of Parameters to be Estimated: VSKEW = 10; VSHAPE = 10 if (cond.dist == "snig") VSKEW = 0.99 V = c( 10*abs(mean(.series$x)), if(u > 0) rep(1-TINY, times = u), if(v > 0) rep(1-TINY, times = v), 100*var(.series$x), if(p > 0) rep(1-TINY, times = p), if(p > 0) rep(1-TINY, times = p), if(q > 0) rep(1-TINY, times = q), 2, # delta VSKEW, # skew VSHAPE) # shape names(V) = Names if(.DEBUG) { cat("\nDEBUG - V: \n"); print(V) } # Includes: includes = c( include.mean, if(u > 0) rep(TRUE, times = u), if(v > 0) rep(TRUE, times = v), TRUE, if(p > 0) rep(TRUE, times = p), if(p > 0) rep(leverage, times = p), if(q > 0) rep(TRUE, times = q), include.delta, include.skew, include.shape) names(includes) = Names if(.DEBUG) { cat("\nDEBUG - V: \n"); print(includes) } # Index List of Parameters to be Optimized: index = (1:length(params))[includes == TRUE] names(index) = names(params)[includes == TRUE] if(.DEBUG) { cat("\nDEBUG - fixed: \n"); print(index) } # Persistence: alpha <- beta <- NULL if(p > 0) alpha = params[substr(Names, 1, 5) == "alpha"] if(p > 0 & leverage) gamma = params[substr(Names, 1, 5) == "gamma"] if(p > 0 & !leverage) gamma = rep(0, times = p) if(q > 0) beta = params[substr(Names, 1, 4) == "beta"] if(.series$model[2] == "garch") { persistence = sum(alpha) + sum(beta) } else if(.series$model[2] == "aparch") { persistence = sum(beta) for (i in 1:p) persistence = persistence + alpha[i]*garchKappa(cond.dist, gamma[i], params["delta"], params["skew"], params["shape"]) } names(persistence) = "persistence" # Trace the Result: if(trace) { cat("Parameter Initialization:") cat("\n Initial Parameters: $params") cat("\n Limits of Transformations: $U, $V") cat("\n Which Parameters are Fixed? $includes") cat("\n Parameter Matrix:\n") ans = data.frame(U, V, params, includes) rownames(ans) = paste(" ", names(params)) print(ans) cat(" Index List of Parameters to be Optimized:\n") print(index) cat(" Persistence: ", persistence, "\n") } # Return Value: list(params = params, U = U, V = V, includes = includes, index = index, mu = params[1], delta = delta, skew = skew, shape = shape, cond.dist = cond.dist, leverage = leverage, persistence = persistence, control = control) } ################################################################################ fGarch/R/mgarch-FitFromFormula.R0000644000176200001440000001126313202300166016117 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: PARAMETER ESTIMATION: # .gogarchFit Fits the parameters of a GO-GARCH process ################################################################################ .gogarchFit <- function(formula = ~ garch(1, 1), data, init.rec = c("mci", "uev"), delta = 2, skew = 1, shape = 4, cond.dist = c("norm", "snorm", "ged", "sged", "std", "sstd", "snig", "QMLE"), include.mean = TRUE, include.delta = NULL, include.skew = NULL, include.shape = NULL, leverage = NULL, trace = TRUE, algorithm = c("nlminb", "lbfgsb", "nlminb+nm", "lbfgsb+nm"), hessian = c("ropt", "rcd"), control = list(), title = NULL, description = NULL, ...) { # A function implemented by Diethelm Wuertz # Description: # Fits a GO-Garch Model using Independent Component Analysis # Arguments: # The arguments are the same as for the univariate case. # formula - formula for all marginal models # data - multivariate timeSeries object # ... # Value: # S4 Object of class (univariate) fGARCH ... # Notes: # This function has still a preliminary status ... # This function was inspired from the contributed gogarch # package of Bernhard Pfaff. # Example: # require(fEcofin); data(DowJones30) # X = returns(as.timeSeries(DowJones30)); head(X) # N = 5; ans = .gogarchFit(data = X[, 1:N], trace = FALSE); ans # ans@h.t # FUNCTION: # Multivariate ? stopifnot(isMultivariate(data)) # Data: X = data # Marginal Garch Models: garchControl = list( init.rec = init.rec, delta = delta, skew = skew, shape = shape, cond.dist = cond.dist, include.mean = include.mean, include.delta = include.delta, include.skew = include.skew, include.shape = include.shape, leverage = leverage, trace = trace, algorithm = algorithm, hessian = hessian, control = control, title = title, description = description) # Compute fastICA: # ... the following lines of code were borrowed from # Bernhard Pfaff's contributed package gogarch V <- t(X) %*% X / nrow(X) svd <- svd(V) P <- svd$u Dsqr <- diag(sqrt(svd$d)) # set.seed(4711) ica <- fastICA::fastICA(X, n.comp = ncol(X)) Z <- P %*% Dsqr %*% t(P) %*% ica$W colnames(Z) = rownames(Z) = colnames(data) Y <- X %*% solve(Z) # Fit Marginal Garch Models: fit <- apply(Y, 2, function(x) do.call("garchFit", c(list(formula = formula, data = x), garchControl))) # Compute Conditional Variances: # ... the following lines of code were borrowed from # Bernhard Pfaff's contributed package gogarch H <- matrix(unlist(lapply(fit, function(x) x@h.t)), ncol = ncol(X), nrow = nrow(X)) Hdf <- data.frame(t(H)) rownames(Hdf) <- colnames(data) colnames(Hdf) <- rownames(data) H.t <- lapply(Hdf, function(x) Z %*% diag(x) %*% t(Z)) # Add Title and Description: if(is.null(title)) title = "ICA GO-GARCH Modelling" if(is.null(description)) description = description() # Result: ans <- new("fGARCH", call = as.call(match.call()), formula = formula, method = "ICA go-Garch Parmeter Estimation", data = c(Records = nrow(data), Instruments = ncol(data)), fit = fit, residuals = numeric(), fitted = numeric(), h.t = c(Records = length(H.t), Dimension =dim(H.t[[1]])), sigma.t = numeric(), title = title, description = description ) # Multivariate Series: attr(ans@data, "data") <- data attr(ans@h.t, "H.t") <- H.t # Return Value: ans } ################################################################################ fGarch/R/garch-Hessian.R0000644000176200001440000001322113202300166014434 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: PARAMETER ESTIMATION: # .garchRoptimhess Uses R internal optimhess function # .garchRCDAHessian Computes R coded CDA Hessian matrix # .garchRTSHessian Computes R coded Two Sided Hessian matrix # .hessian2sided Function called from .garchRTSHessian # REQUIRED: # Matrix ################################################################################ .garchRoptimhess <- function(par, .params, .series, eps = 1.0e-4) { # A function implemeted by Diethelm Wuertz # Description: # Compute Hessian via R's function optimHess() # Arguments: # par - # .params - # .series - # eps - # FUNCTION: # Take Time: .StartHessian <- Sys.time() # Compute Hessian: H <- optimHess(par, .garchLLH) H <- 0.5 * (H + t(H)) nm <- names(par) dimnames(H) <- list(nm, nm) # Elapsed Time: time = Sys.time() - .StartHessian attr(H, "time") = time # Return Value: H } # ------------------------------------------------------------------------------ .garchRCDAHessian <- function(par, .params, .series, eps = 1.0e-4) { # A function implemented by Diethelm Wuertz # Description: # Compute CDA (central difference approximated) Hessian # Arguments: # par - # .params - # .series - # eps - # Reference: # http://status.sph.umich.edu/computing/manuals/sas8/stat/chap46/sect26.htm # FUNCTION: # Take start time .StartHessian <- Sys.time() # Algorithm: algorithm = .params$control$algorithm[1] .trace = FALSE # Compute Hessian: eps = eps * par n = length(par) H = matrix(0, ncol = n, nrow = n) for (i in 1:n) { for (j in 1:n) { x1 = x2 = x3 = x4 = par x1[i] = x1[i] + eps[i] x1[j] = x1[j] + eps[j] x2[i] = x2[i] + eps[i] x2[j] = x2[j] - eps[j] x3[i] = x3[i] - eps[i] x3[j] = x3[j] + eps[j] x4[i] = x4[i] - eps[i] x4[j] = x4[j] - eps[j] H[i, j] = ( .garchLLH(x1, .trace) - .garchLLH(x2, .trace) - .garchLLH(x3, .trace) + .garchLLH(x4, .trace) ) / (4*eps[i]*eps[j]) } } colnames(H) = rownames(H) = names(par) # Attribute execution time: time = Sys.time() - .StartHessian attr(H, "time") = time # Return Value: H } # ------------------------------------------------------------------------------ .garchTSHessian <- function(par, .params, .series, eps = NA) { # A function implemented by Diethelm Wuertz # Description: # Compute two sided (TS) approximated Hessian # Arguments: # par - # .params - # .series - # eps - not used # FUNCTION: # Take start time .StartHessian <- Sys.time() # Algorithm: algorithm = .params$control$algorithm[1] # Compute Hessian: H <- .hessian2sided(f = .garchLLH, x = par, trace = FALSE, fGarchEnv = FALSE) colnames(H) = rownames(H) = names(par) # Attribute execution time: time = Sys.time() - .StartHessian attr(H, "time") = time # Return Value: H } # ------------------------------------------------------------------------------ .hessian2sided <- function(f, x, ...) { # A function adapted from Kevin Sheppard's Matlab garch toolbox # ... implemented by Alexios Ghalanos in his rgarch package # ... R port for Rmetrics' fGarch by Diethelm Wuertz # Description: # Computes two sided (TS) approximated Hessian # Arguments: # f - # x - # Notes: # requires package Matrix (added as suggestion) # FUNCTION: # Settings: n <- length(x) fx <- f(x, ...) eps <- .Machine$double.eps # Compute the stepsize (h) h = eps^(1/3) * apply( as.data.frame(x), 1, FUN = function(z) max(abs(z), 1.0e-2)) xh = x + h h = xh - x ee <- Matrix::Matrix(diag(h), sparse = TRUE) # Compute forward and backward steps: gp = vector(mode = "numeric", length = n) for(i in 1:n) gp[i] <- f(x + ee[, i], ...) gm = vector(mode = "numeric", length = n) for(i in 1:n) gm[i] <- f(x - ee[, i], ...) H = h %*% t(h) Hm = H Hp = H # Compute "double" forward and backward steps: for(i in 1:n){ for(j in i:n){ Hp[i, j] <- f(x + ee[, i] + ee[, j], ...) Hp[j, i] <- Hp[i, j] Hm[i, j] <- f(x - ee[, i] - ee[, j], ...) Hm[j, i] <- Hm[i, j] } } # Compute the hessian: for(i in 1:n){ for(j in i:n){ H[i, j] = ((Hp[i, j] - gp[i] - gp[j] + fx + fx - gm[i] - gm[j] + Hm[i, j]) / H[i, j]) / 2 H[j, i] = H[i, j] } } # Return Value: return(H) } ################################################################################ fGarch/R/garch-FitFromSpec.R0000644000176200001440000002010613202277107015233 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # fUGARCHSPEC Fits the parameters of GARCH process # .ugarchSpec Specifies a univariate GARCH model # .ugarchFit Fits a univariate GARCH model ################################################################################ .setfGarchEnv(.llh = 1e99) .setfGarchEnv(.garchDist = NA) .setfGarchEnv(.params = NA) .setfGarchEnv(.series = NA) .setfGarchEnv(.trace = NA) # ------------------------------------------------------------------------------ setClass("fUGARCHSPEC", representation( model = "list", distribution = "list", optimization = "list", documentation = "list") ) # ------------------------------------------------------------------------------ .ugarchSpec <- function( model = list( formula = ~ garch(1,1), mean = 0, include.mean = TRUE, delta = 2, include.delta = NULL, leverage = NULL, recursion = c("internal", "filter", "testing")[1], init.rec = c("mci", "uev")[1]), distribution = list( cond.dist = c("norm", "snorm", "ged", "sged", "std", "sstd", "snig", "QMLE")[1], skew = 1, include.skew = NULL, shape = 4, include.shape = NULL), optimization = list( algorithm = c("nlminb", "lbfgsb", "nlminb+nm", "lbfgsb+nm")[1], hessian = c("ropt", "rcd", "rts")[1], trace = TRUE, control = list(), status = NA), documentation = list( call = match.call(), title = NULL, description = NULL ) ) { # Description: # Specifies a garch model to be fitted # Example: # .garchSpec()) # FUNCTION: # Model Slot: Model = list( formula = ~ garch(1,1), mean = 0, include.mean = TRUE, delta = 2, include.delta = NULL, leverage = NULL, recursion = c("internal", "filter", "testing")[1], init.rec = c("mci", "uev")[1]) Model[(Names <- names(model))] <- model # Distribution Slot: Distribution = list( cond.dist = c("norm", "snorm", "ged", "sged", "std", "sstd", "snig", "QMLE")[1], skew = 1, include.skew = NULL, shape = 4, include.shape = NULL) Distribution[(Names <- names(distribution))] <- distribution # Optimization Slot: Optimization = list( algorithm = c("nlminb", "lbfgsb", "nlminb+nm", "lbfgsb+nm")[1], hessian = c("ropt", "rcd", "rst")[1], trace = TRUE, control = list(), status = NA) Optimization[(Names <- names(optimization))] <- optimization # Documentation Slot: Documentation = list( call = match.call(), title = NULL, description = NULL ) Documentation[(Names <- names(documentation))] <- documentation # Return Value: new("fUGARCHSPEC", model = Model, distribution = Distribution, optimization = Optimization, documentation = Documentation) } # ------------------------------------------------------------------------------ .ugarchFit <- function(data, spec = .ugarchSpec()) { # Description: # Fit parameters to a ARMA-GARCH model by GARCH Specification # Arguments: # data - time series or vector of data # spec - garch specification object # Example: # .ugarchFit(dem2gbp[, 1]) # FUNCTION: DEBUG = FALSE # Set Call: CALL <- spec@documentation$call <- match.call() # Parse Data: Name = capture.output(substitute(data)) if(is.character(data)) { eval(parse(text = paste("data(", data, ")"))) data = eval(parse(text = data)) } data <- as.data.frame(data) # Column Names: if (isUnivariate(data)) { colnames(data) <- "data" } else { # Check unique column Names: uniqueNames = unique(sort(colnames(data))) if (is.null(colnames(data))) { stop("Column names of data are missing.") } if (length(colnames(data)) != length(uniqueNames)) { stop("Column names of data are not unique.") } } # Handle if we have no left-hand-side for the formula ... formula <- spec@model$formula # Note in this case the length of the formula is 2 (else 3): if (length(formula) == 3 && isUnivariate(data) ) formula[2] <- NULL if (length(formula) == 2) { if (isUnivariate(data)) { # Missing lhs -- we substitute the data file name as lhs ... formula = as.formula(paste("data", paste(formula, collapse = " "))) } else { stop("Multivariate data inputs require lhs for the formula.") } } # Robust Formula ? robust.cvar <- (spec@distribution$cond.dist == "QMLE") # Parse Arguments: args = .garchArgsParser(formula = formula, data = data, trace = FALSE) # DEBUG - Print Arguments: if(DEBUG) print(list( formula.mean = args$formula.mean, formula.var = args$formula.var, series = args$series, init.rec = spec@model$init.rec, delta = spec@model$delta, skew = spec@distribution$skew, shape = spec@distribution$shape, cond.dist = spec@distribution$cond.dist, include.mean = spec@model$include.mean, include.delta = spec@model$include.delta, include.skew = spec@distribution$include.skew, include.shape = spec@distribution$include.shape, leverage = spec@model$leverage, trace = spec@optimization$trace, ## recursion = spec@model$recursion, algorithm = spec@optimization$algorithm, hessian = spec@optimization$hessian, robust.cvar = robust.cvar, control = spec@optimization$control, title = spec@documentation$title, description = spec@documentation$description)) # Fit: ans = .garchFit( formula.mean = args$formula.mean, formula.var = args$formula.var, series = args$series, init.rec = spec@model$init.rec, delta = spec@model$delta, skew = spec@distribution$skew, shape = spec@distribution$shape, cond.dist = spec@distribution$cond.dist, include.mean = spec@model$include.mean, include.delta = spec@model$include.delta, include.skew = spec@distribution$include.skew, include.shape = spec@distribution$include.shape, leverage = spec@model$leverage, trace = spec@optimization$trace, ## recursion = spec@model$recursion, algorithm = spec@optimization$algorithm, hessian = spec@optimization$hessian, robust.cvar = robust.cvar, control = spec@optimization$control, title = spec@documentation$title, description = spec@documentation$description) ans@call = CALL attr(formula, "data") <- paste("data = ", Name, sep = "") ans@formula = formula # Return Value: ans } ################################################################################ fGarch/R/methods-plot.R0000644000176200001440000003607313202277107014421 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # plot Plot method for an object of class 'fGARCH' # .interactiveGarchPlot Plot interactively # .multGarchPlot Arrange multivariate Plots # .plot.garch.1 Plot Time Series # .plot.garch.2 Plot Conditional SD # .plot.garch.3 Plot Series with 2 Conditional SD Superimposed # .plot.garch.4 Plot ACF of Observations # .plot.garch.5 Plot ACF of Squared Observations # .plot.garch.6 Plot Cross Correlation # .plot.garch.7 Plot Residuals # .plot.garch.8 Plot Conditional SDs # .plot.garch.9 Plot Standardized Residuals # .plot.garch.10 Plot ACF of Standardized Residuals # .plot.garch.11 Plot ACF of Squared Standardized Residuals # .plot.garch.12 Plot Cross Correlation between r^2 and r # .plot.garch.13 Plot QQ-Plot of Standardized Residuals" # .qqDist Quantile-Quantile Points # .qqLine Quantile-Quantile Line ################################################################################ setMethod(f = "plot", signature(x = "fGARCH", y = "missing"), definition = function(x, which = "ask", ...) { # A function implemented by Diethelm Wuertz # Description: # Plot method for an object of class 'fGARCH' # Note: # This method can also be used for plotting graphs fitted by # the function 'garch' from the contributed R package 'tseries'. # FUNCTION: if (as.character(x@call[1]) == ".gogarchFit") { # Plot multivariate GO-Garch model: print("GO-Garch Plot Not Yet Implemented") } else { # Plot univariate Models: .interactiveGarchPlot( x, choices = c( "Time Series", "Conditional SD", "Series with 2 Conditional SD Superimposed", "ACF of Observations", "ACF of Squared Observations", "Cross Correlation", "Residuals", "Conditional SDs", "Standardized Residuals", "ACF of Standardized Residuals", "ACF of Squared Standardized Residuals", "Cross Correlation between r^2 and r", "QQ-Plot of Standardized Residuals"), plotFUN = paste(".plot.garch", 1:13, sep = "."), which = which, ...) } # Return Value: invisible(x) }) # ------------------------------------------------------------------------------ .interactiveGarchPlot <- function(x, choices, plotFUN, which, ...) { # A function implemented by Diethelm Wuertz # Description: # Internal plot function # Arguments: # x - an object to be plotted # choices - the character string for the choice menu # plotFUN - the names of the plot functions # which - plot selection, which graph should be # displayed. If a character string named "ask" the # user is interactively asked which to plot, if # a logical vector of length N, those plots which # are set "TRUE" are displayed, if a character string # named "all" all plots are displayed. # FUNCTION: # Some cecks: if (length(choices) != length(plotFUN)) stop("Arguments choices and plotFUN must be of same length.") if (length(which) > length(choices)) stop("Arguments which has incorrect length.") if (length(which) > length(plotFUN)) stop("Arguments which has incorrect length.") # Plot: if (is.numeric(which)) { Which = rep(FALSE, times = length(choices)) Which[which] = TRUE } if (which[1] == "all") { Which = rep(TRUE, times = length(choices)) } if (which[1] == "ask") { .multGarchPlot(x, choices, plotFUN, ...) } else { for ( i in 1:length(choices) ) { FUN = match.fun(plotFUN[i]) if (Which[i]) FUN(x) } } # Return Value: invisible(x) } # ------------------------------------------------------------------------------ .multGarchPlot <- function (x, choices, ...) { # A function implemented by Diethelm Wuertz # Description: # Internal plot function pick = 1 while (pick > 0) { pick = menu ( ### choices = paste("plot:", choices), choices = paste(" ", choices), title = "\nMake a plot selection (or 0 to exit):") # up to 19 plot functions ... switch (pick, .plot.garch.1(x), .plot.garch.2(x), .plot.garch.3(x), .plot.garch.4(x), .plot.garch.5(x), .plot.garch.6(x), .plot.garch.7(x), .plot.garch.8(x), .plot.garch.9(x), .plot.garch.10(x), .plot.garch.11(x), .plot.garch.12(x), .plot.garch.13(x)) } } # ------------------------------------------------------------------------------ .plot.garch.1 <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Internal plot function # 1. Time Series: xseries = x@data plot(xseries, type = "l", col = "steelblue", ylab = "x", main = "Time Series") abline(h = 0, col = "grey", lty = 3) grid() } # ------------------------------------------------------------------------------ .plot.garch.2 <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Internal plot function # 2. Conditional SD: xcsd = volatility(x, "sigma") plot(xcsd, type = "l", col = "steelblue", ylab = "x", main = "Conditional SD") abline(h = 0, col = "grey", lty = 3) grid() } # ------------------------------------------------------------------------------ .plot.garch.3 <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Internal plot function # 3. Series with 2 Conditional SD Superimposed: xseries = x@data xcsd = volatility(x, "sigma") ci = 2 plot(xseries, type = "l", col = "steelblue", ylab = "x", main = "Series with 2 Conditional SD Superimposed") lines(mean(xseries) + ci * xcsd, col = "grey") # or simply xseries ? lines(mean(xseries) - ci * xcsd, col = "grey") abline(h = 0, col = "grey", lty = 3) grid() } # ------------------------------------------------------------------------------ .plot.garch.4 <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Internal plot function # 4. ACF of the Observations: xseries = as.vector(x@data) n = length(xseries) lag.max = as.integer(10*log10(n)) acf(xseries, lag.max = lag.max, xlab = "Lags", col = "steelblue", main = "ACF of Observations", plot = TRUE) } # ------------------------------------------------------------------------------ .plot.garch.5 <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Internal plot function # 5. ACF of the Squared Observations: xseries = as.vector(x@data) xseries2 = xseries^2 n = length(xseries) lag.max = as.integer(10*log10(n)) acf(xseries2, lag.max = lag.max, xlab = "Lags", col = "steelblue", main = "ACF of Squared Observations", plot = TRUE) } # ------------------------------------------------------------------------------ .plot.garch.6 <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Internal plot function # 6. Cross Correlation between x^2 and x: xseries = as.vector(x@data) xseries2 = xseries^2 n = length(xseries) lag.max = as.integer(10*log10(n)) ccf(xseries2, xseries, lag.max = lag.max, xlab = "Lags", main = "Cross Correlation", plot = TRUE, col = "steelblue") } # ------------------------------------------------------------------------------ .plot.garch.7 <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Internal plot function # 7. Residuals: res = residuals(x, standardize = FALSE) plot(res, type = "l", main = "Residuals", col = "steelblue", ...) abline(h = 0, lty = 3) grid() } # ------------------------------------------------------------------------------ .plot.garch.8 <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Internal plot function # 8. Conditional SDs: xcsd = volatility(x, "sigma") plot(xcsd, type = "l", main = "Conditional SD's", col = "steelblue", ...) abline(h = 0, lty = 3) grid() } # ------------------------------------------------------------------------------ .plot.garch.9 <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Internal plot function # 9. Standardized Residuals: sres = residuals(x, standardize = TRUE) plot(sres, type = "l", main = "Standardized Residuals", col = "steelblue", ...) abline(h = 0, lty = 3) grid() } # ------------------------------------------------------------------------------ .plot.garch.10 <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Internal plot function # 10. ACF of Standardized Residuals: sres = as.matrix(residuals(x, standardize = TRUE)) n = length(sres) lag.max = as.integer(10*log10(n)) acf(sres, lag.max = lag.max, xlab = "Lags", col = "steelblue", main = "ACF of Standardized Residuals", plot = TRUE) } # ------------------------------------------------------------------------------ .plot.garch.11 <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Internal plot function # 11. ACF of Squared Standardized Residuals: sres2 = as.matrix(residuals(x, standardize = TRUE)^2) n = length(sres2) lag.max = as.integer(10*log10(n)) acf(sres2, lag.max = lag.max, xlab = "Lags", col = "steelblue", main = "ACF of Squared Standardized Residuals", plot = TRUE) } # ------------------------------------------------------------------------------ .plot.garch.12 <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Internal plot function # 12. Cross Correlation between r^2 and r: sres = residuals(x, standardize = FALSE) sres2 = sres^2 n = length(sres) lag.max = as.integer(10*log10(n)) ccf(sres2, sres, lag.max = lag.max, xlab = "Lags", main = "Cross Correlation", plot = TRUE, col = "steelblue") } # ------------------------------------------------------------------------------ .plot.garch.13 <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Internal plot function # 13. QQ-Plot of Standardized Residuals: sres = residuals(x, standardize = TRUE) cond.dist = x@fit$params$cond.dist cond.dist = paste("q", cond.dist, sep = "") nc = nchar(x@fit$params$cond.dist) parNames <- names(x@fit$par) skew <- if ("skew" %in% parNames) x@fit$par["skew"] else x@fit$params$skew shape <- if ("shape" %in% parNames) x@fit$par["shape"] else x@fit$params$shape if (cond.dist == "qnorm" || cond.dist == "qQMLE") .qqDist(sres, dist = "qnorm") if (cond.dist == "qstd" | cond.dist == "qged") .qqDist(sres, dist = cond.dist, nu = shape) if (cond.dist == "qsnorm") .qqDist(sres, dist = cond.dist, xi = skew) if (cond.dist == "qsstd" | cond.dist == "qsged") .qqDist(sres, dist = cond.dist, xi = skew, nu = shape) if (cond.dist == "qsnig") .qqDist(sres, dist = ".qsnigC", rho = skew, zeta = shape) } # ------------------------------------------------------------------------------ .qqDist <- function (y, dist = "qnorm", ylim = NULL, main = paste(dist, "- QQ Plot"), xlab = "Theoretical Quantiles", ylab = "Sample Quantiles", doplot = TRUE, datax = FALSE, ...) { # A function implemented by Diethelm Wuertz # Description # QQ Plot for arbitray distribution # FUNCTION: # print(dist) # Match Function : qDist = match.fun(dist) # Check Arguments: # if (substr(dist, 1, 1) != "q") stop("dist is misspecified") # test = class(test = try(qDist(0.5, ...), silent = TRUE)) # if (test == "try-error") stop("dist does not exist") # Transform to Vector Mode: y = as.vector(y) # Compute Data: if (has.na <- any(ina <- is.na(y))) { yN = y y = y[!ina] } if (0 == (n <- length(y))) stop("y is empty or has only NAs") x <- qDist(ppoints(n,), ...)[order(order(y))] if (has.na) { y = x x = yN x[!ina] = y y = yN } # Create QQ Plot: if (doplot) { if (is.null(ylim)) ylim = range(y) if (datax) { plot(y, x, main = main, xlab = ylab, ylab = xlab, xlim = ylim, col = "steelblue", cex = 0.7) } else { plot(x, y, main = main, xlab = xlab, ylab = ylab, ylim = ylim, col = "steelblue", cex = 0.7) } .qqLine(y = y, dist = dist, datax = datax, ...) grid() } # Return Value: invisible(if (datax) list(x = y, y = x) else list(x = x, y = y)) } # ------------------------------------------------------------------------------ .qqLine <- function (y, dist = "qnorm", datax = FALSE, ...) { # A function implemented by Diethelm Wuertz # Description # Add slope to QQ Plot for arbitray distribution # FUNCTION: # Match Function : qDist = match.fun(dist) # Check Arguments: # if (substr(dist, 1, 1) != "q") stop("dist is misspecified") # test = class(test = try(qDist(0.5, ...), silent = TRUE)) # if (test == "try-error") stop("dist does not exist") # Transform to Vector Mode: y = as.vector(y) # Compute Data: y = quantile(y[!is.na(y)], c(0.25, 0.75)) x = qDist(c(0.25, 0.75), ...) # Add Slope: if (datax) { slope <- diff(x)/diff(y) int <- x[1] - slope * y[1] } else { slope <- diff(y)/diff(x) int <- y[1] - slope * x[1] } # Return Value: abline(int, slope) } ################################################################################ fGarch/R/dist-gedFit.R0000644000176200001440000001021113202277107014127 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: PARAMETER ESTIMATION: # .gedFit New: Fit the parameters for a GED distribution # gedFit Fit the parameters for a GED distribution ################################################################################ .gedFit <- function(x, mean = 0, sd = 1, nu = 2, scale = NA, doplot = TRUE, add = FALSE, span = "auto", trace = TRUE, title = NULL, description = NULL, ...) { # A function implemented by Diethelm Wuertz # Description: # Fits parameters of a NIG using maximum log-likelihood # Example: # set.seed(4711); x = rged(500); .gedFit(x)@fit$estimate # FUNCTION: # Settings: dist = dged model = "GED Parameter Estimation" scale = "not used" x = x.orig = as.vector(x) # Parameter Estimation: obj = function(x, y = x, trace) { f = try(-sum(log(dist(y, x[1], x[2], x[3]))), silent = TRUE) if (is.na(f) | class(f) == "try-error") return(1e9) # Print Iteration Path: if (trace) { cat("\n Objective Function Value: ", -f) cat("\n Parameter Estimates: ", x, "\n") } f } r = nlminb( start = c(mean = 0, sd = 1, nu = 2), objective = obj, lower = c(-Inf, 0, 0), upper = c( Inf, Inf, Inf), y = x, trace = trace) names(r$par) <- c("mean", "sd", "nu") # Add Title and Description: if (is.null(title)) title = model if (is.null(description)) description = description() # Result: fit = list(estimate = r$par, minimum = -r$objective, code = r$convergence) # Optional Plot: if (doplot) { x = as.vector(x.orig) if (span == "auto") span = seq(min(x), max(x), length = 501) z = density(x, n = 100, ...) x = z$x[z$y > 0] y = z$y[z$y > 0] y.points = dist(span, r$par[1], r$par[2], r$par[3]) ylim = log(c(min(y.points), max(y.points))) if (add) { lines(x = span, y = log(y.points), col = "steelblue") } else { plot(x, log(y), xlim = c(span[1], span[length(span)]), ylim = ylim, type = "p", xlab = "x", ylab = "log f(x)", ...) title(main = model) lines(x = span, y = log(y.points), col = "steelblue") } } # Return Value: new("fDISTFIT", call = match.call(), model = model, data = as.data.frame(x.orig), fit = fit, title = title, description = description() ) } # ------------------------------------------------------------------------------ gedFit <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Fit the parameters for a generalized error distribution # FUNCTION: # Start Value: start = c(mean = mean(x), sd = sqrt(var(x)), nu = 2) # Log-likelihood Function: loglik = function(x, y = x){ f = -sum(log(dged(y, x[1], x[2], x[3]))) f } # Minimization: fit = nlminb( start = start, objective = loglik, lower = c(-Inf, 0, 0), upper = c( Inf, Inf, Inf), y = x, ...) # Add Names to $par names(fit$par) = c("mean", "sd", "nu") # Return Value: fit } ################################################################################ fGarch/R/dist-absMoments.R0000644000176200001440000000557713202277107015060 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: MOMENTS: # absMoments Compute absolute moments of a symmetric distribution ################################################################################ absMoments <- function(n, density = c("dnorm", "dged", "dstd"), ...) { # A function implemented by Diethelm Wuertz # Description: # Compute the absolute moments of a standardized # symmetric distribution function. # Arguments: # n - a vector of integers i, to compute M_i # density - a character denoting the density # "norm", "ged", "std" or any other # ... - parameters passed to the standardized # symmetric density function # Value: # Returns a numeric vector of moments M_i. # Stores globally errors in the variable absMoment.error # if the moments were comuted numerically. # FUNCTION: # norm - Normal Distribution: if (density == "dnorm" | density == "norm") { return (sqrt(2)^n * gamma((n+1)/2) / sqrt(pi)) } # ged - Generalized Error Distribution: if (density == "dged" | density == "ged") { parm = function(n, nu) { lambda = sqrt ( 2^(-2/nu) * gamma(1/nu) / gamma(3/nu) ) return ((2^(1/nu)*lambda)^n * gamma((n+1)/nu) / gamma(1/nu)) } return(parm(n, ...)) } # std - Student-t Distribution: # Note: nu > 2*n if (density == "dstd" | density == "std") { parm = function(n, nu) { return (beta(1/2+2*n, nu/2-2*n)/beta(1/2, nu/2) * sqrt(nu-2)) } return(parm(n, ...)) } # Any other standardized symmetric Distribution ... fun = match.fun(density) moments = function(x, n, ...) { 2 * x^n * fun(x, ...) } M = .absMoments.error <- NULL for (i in n) { I = integrate(moments, 0, Inf, n = i, ...) M = c(M, I$value) .absMoments.error <- c(.absMoments.error, I$abs.error) } attr(M, "control") <- .absMoments.error return(M) # Return Value: invisible() } ################################################################################ fGarch/R/methods-residuals.R0000644000176200001440000000344713202277107015435 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # METHOD: EXTRACTORS: # residuals.fGARCH S4 residuals method for an object of class 'fGARCH' ################################################################################ setMethod(f = "residuals", signature(object = "fGARCH"), definition = function(object, standardize = FALSE) { # A function implemented by Diethelm Wuertz # Description: # S4 Residuals method for an object of class fGARCH # Arguments: # object - an object of class fGarch as returned by the # function garchFit # ... - optional argument to be passed, this may be standardize=FALSE # to return the -non-standardized values of the residuals. # By default standardized residuals will be returned. # FUNCTION: # Residuals: if (standardize) { ans = object@residuals/object@sigma.t } else { ans = object@residuals } # Return Value: ans }) # ------------------------------------------------------------------------------ fGarch/R/garch-GlobalVars.R0000644000176200001440000000274113202277107015113 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # .setfGarchEnv Set Global Vars # .garchArgsParser Parses formula and data for garchFit # .garchOptimizerControl Sets default values for Garch Optimizer # .garchFit ... old Version, still in use by garchFit() # .garchNames Slot names, @fit slot, parameters and controls ################################################################################ .setfGarchEnv(.llh = 1e99) .setfGarchEnv(.garchDist = NA) .setfGarchEnv(.params = NA) .setfGarchEnv(.series = NA) .setfGarchEnv(.trace = NA) ################################################################################ fGarch/R/garch-FitInternal.R0000644000176200001440000003352013202277107015275 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # .garchFit Internal GARCH Fit # .garchArgsParser Parses formula and data for garchFit # .garchModelSeries Composes model series like in lm fits # .garchOptimizerControl Sets default values for Garch Optimizer # .garchNames Slot names, @fit slot, parameters and controls ################################################################################ .garchFit <- function( formula.mean = ~arma(0, 0), formula.var = ~garch(1, 1), series, init.rec = c("mci", "uev"), delta = 2, skew = 1, shape = 4, cond.dist = c("norm", "snorm", "ged", "sged", "std", "sstd", "QMLE"), include.mean = TRUE, include.delta = NULL, include.skew = NULL, include.shape = NULL, leverage = NULL, trace = TRUE, algorithm = c("sqp", "nlminb", "lbfgsb", "nlminb+nm", "lbfgsb+nm"), hessian = c("ropt", "rcd"), robust.cvar, control = list(), title = NULL, description = NULL, ...) { # A function implemented by Diethelm Wuertz # Description # Fit parameters to a ARMA-GARCH model # Arguments: # formula.mean - ARMA(m,n) mean specification # formula.var - GARCH/APARCH(p,q) variance specification # series - time series # init.rec - names type of initialization of recurrence # mci = mu-current-iteration, or # uev = unconditional-expected-variances # delta - numeric value of the exponent delta # skew - optional skewness parameter # shape - optional shape parameter # cond.dist - name of the conditional distribution # include.mean - should the mean value be estimated ? # include.delta - should the exponent be estimated ? # leverage - should the leverage factors be estimated ? # trace - should the optimization be traced ? # algorithm - # control - list of additional control parameters for solver # title - an optional title string # description - an optional project description string # Note: # This is the old version of garchFit, we keep it for backward # compatibility. # FUNCTION: # Debug Mode: DEBUG <- FALSE # Allow only full formula specification: if(DEBUG) print("Formula Specification ...") fcheck = rev(all.names(formula.mean))[1] if (fcheck == "ma") { stop("Use full formula: arma(0,q) for ma(q)") } else if (fcheck == "ar") { stop("Use full formula expression: arma(p,0) for ar(p)") } # Check for Recursion Initialization: if(DEBUG) print("Recursion Initialization ...") if(init.rec[1] != "mci" & algorithm[1] != "sqp") { stop("Algorithm only supported for mci Recursion") } # Get Start Time: .StartFit <- Sys.time() # Generate Control List - Define Default Settings: if(DEBUG) print("Generate Control List ...") con <- .garchOptimizerControl(algorithm, cond.dist) con[(namc <- names(control))] <- control # Initialize Time Series Information - Save Globally: # keep copy of input data if(DEBUG) print("Initialize Time Series ...") data <- series # scale time series scale <- if (con$xscale) sd(series) else 1 series <- series/scale .series <- .garchInitSeries( formula.mean = formula.mean, formula.var = formula.var, cond.dist = cond.dist[1], series = series, scale = scale, init.rec = init.rec[1], h.start = NULL, llh.start = NULL, trace = trace) .setfGarchEnv(.series = .series) # Initialize Model Parameters - Save Globally: if(DEBUG) print("Initialize Model Parameters ...") .params <- .garchInitParameters( formula.mean = formula.mean, formula.var = formula.var, delta = delta, skew = skew, shape = shape, cond.dist = cond.dist[1], include.mean = include.mean, include.delta = include.delta, include.skew = include.skew, include.shape = include.shape, leverage = leverage, algorithm = algorithm[1], control = con, trace = trace) .setfGarchEnv(.params = .params) # Select Conditional Distribution Function: if(DEBUG) print("Select Conditional Distribution ...") .setfGarchEnv(.garchDist = .garchSetCondDist(cond.dist[1])) # Estimate Model Parameters - Minimize llh, start from big value: if(DEBUG) print("Estimate Model Parameters ...") .setfGarchEnv(.llh = 1.0e99) .llh <- .getfGarchEnv(".llh") fit = .garchOptimizeLLH(hessian, robust.cvar, trace) # Add to Fit: if (DEBUG) print("Add to fit ...") .series <- .getfGarchEnv(".series") .params <- .getfGarchEnv(".params") names(.series$h) <- NULL fit$series = .series fit$params = .params # Retrieve Residuals and Fitted Values: if (DEBUG) print("Retrieve Residuals and Fitted Values ...") residuals = .series$z fitted.values = .series$x - residuals h.t = .series$h if (.params$includes["delta"]) deltainv = 1/fit$par["delta"] else deltainv = 1/fit$params$delta sigma.t = (.series$h)^deltainv # Standard Errors and t-Values: if (DEBUG) print("Standard Errors and t-Values ...") fit$cvar <- if (robust.cvar) (solve(fit$hessian) %*% (t(fit$gradient) %*% fit$gradient) %*% solve(fit$hessian)) else - solve(fit$hessian) fit$se.coef = sqrt(diag(fit$cvar)) fit$tval = fit$coef/fit$se.coef fit$matcoef = cbind(fit$coef, fit$se.coef, fit$tval, 2*(1-pnorm(abs(fit$tval)))) dimnames(fit$matcoef) = list(names(fit$tval), c(" Estimate", " Std. Error", " t value", "Pr(>|t|)")) # Add Title and Description: if (DEBUG) print("Add Title and Description ...") if(is.null(title)) title = "GARCH Modelling" if(is.null(description)) description = description() # Total Execution Time: Time = Sys.time() - .StartFit if(trace) { cat("\nTime to Estimate Parameters:\n ") print(Time) } # Return Value: new("fGARCH", call = as.call(match.call()), formula = as.formula(paste("~", formula.mean, "+", formula.var)), method = "Max Log-Likelihood Estimation", data = data, fit = fit, residuals = residuals, fitted = fitted.values, h.t = h.t, sigma.t = as.vector(sigma.t), title = as.character(title), description = as.character(description) ) } # ------------------------------------------------------------------------------ .garchArgsParser <- function(formula, data, trace = FALSE) { # A function implemented by Diethelm Wuertz # Description: # Parses formula and data for garchFit # Arguments: # formula - ARMA(m,n) + GARCH/APARCH(p,q) mean and variance # specification # data - time series input as a timeSeries # Note: # This function returns the input formula and input data in # proper formats. Two cases are deistinguished # FUNCTION: # Get Data: allVars = unique(sort(all.vars(formula))) allVarsTest = mean(allVars %in% colnames(data)) if (allVarsTest != 1) { print(allVars) print(colnames(data)) stop ("Formula and data units do not match.") } formula.lhs = as.character(formula)[2] # Model frame: mf = match.call(expand.dots = FALSE) if(trace) { cat("\nMatched Function Call:\n ") print(mf) } m = match(c("formula", "data"), names(mf), 0) mf = mf[c(1, m)] # Model the timeSeries - Have a look on the function .garchModelSeries() ... # here we cant use "model/frame" ! mf[[1]] = as.name(".garchModelSeries") mf$fake = FALSE mf$lhs = TRUE if(trace) { cat("\nModelSeries Call:\n ") print(mf) } x = eval(mf, parent.frame()) if(trace) print(x) # Now extract the modelled series ... x = as.vector(x[, 1]) names(x) = rownames(data) if(trace) print(x) # Compose Mean and Variance Formula: allLabels = attr(terms(formula), "term.labels") if(trace) { cat("\nAll Term Labels:\n ") print(allLabels) } if(length(allLabels) == 2) { formula.mean = as.formula(paste("~", allLabels[1])) formula.var = as.formula(paste("~", allLabels[2])) } else if(length(allLabels) == 1) { formula.mean = as.formula("~ arma(0, 0)") formula.var = as.formula(paste("~", allLabels[1])) } if(trace) { cat("\nMean Formula:\n ") print(formula.mean) cat("\nVariance Formula:\n ") print(formula.var) } # Result: ans <- list( formula.mean = formula.mean, formula.var = formula.var, formula.lhs = formula.lhs, series = x) # Return Value: ans } # ------------------------------------------------------------------------------ .garchModelSeries <- function (formula, data, fake = FALSE, lhs = FALSE) { # A function implemented by Diethelm Wuertz # Description: # Composes model series like in lm fits # Arguments: # Note: # ... have a look on model.frame() # FUNCTION: # Formula: if (length(formula) == 2) { formula = as.formula(paste("x", formula[1], formula[2], collapse = "")) stopifnot(!missing(data)) } # Missing Data ? if (missing(data)) { data = eval(parse(text = search()[2]), parent.frame()) } # Numeric Data ? if (is.numeric(data)) { data = data.frame(data) colnames(data) = all.vars(formula)[1] lhs = TRUE } # Faked Formula ? if (fake) { response = as.character(formula)[2] Call = as.character(match.call()[[2]][[3]]) method = Call[1] predictors = Call[2] formula = as.formula(paste(response, "~", predictors)) } # Left-Hand-Side Formula ? if (lhs) { response = as.character(formula)[2] formula = as.formula(paste(response, "~", 1)) } # Compose Model Frame: x = model.frame(formula, data) # timeSeries ? if (class(data) == "timeSeries") { x = timeSeries(x) } # Add control atrribute: if (fake) { attr(x, "control") <- method } # Return Value: x } # ------------------------------------------------------------------------------ .garchOptimizerControl <- function(algorithm, cond.dist) # function(algorithm, cond.dist) { # A function implemented by Diethelm Wuertz # Description: # Sets default values for Garch Optimizer # Arguments: # none # FUNCTION: # Check llh for the standardized NIG Distribution: llh = "internal" if (cond.dist == "snig") llh = "filter" # Generate Control List with Default Settings: con <- list( # In General: fscale = TRUE, xscale = TRUE, algorithm = algorithm, llh = llh, # BFGS - NLMINB Algorithm: tol1 = 1, tol2 = 1, # SQP Algorithm: MIT = 2000, # maximum number of iterations (200) MFV = 5000, # maximum number of function evaluations (500) MET = 5, # specifies scaling strategy: # MET=1 - no scaling # MET=2 - preliminary scaling in 1st iteration (default) # MET=3 - controlled scaling # MET=4 - interval scaling # MET=5 - permanent scaling in all iterations MEC = 2, # correction for negative curvature: # MEC=1 - no correction # MEC=2 - Powell correction (default) MER = 1, # restarts after unsuccessful variable metric updates: # MER=0 - no restarts # MER=1 - standard restart MES = 4, # interpolation method selection in a line search: # MES=1 - bisection # MES=2 - two point quadratic interpolation # MES=3 - three point quadratic interpolation # MES=4 - three point cubic interpolation (default) XMAX = 1.0e3, TOLX = 1.0e-10, TOLC = 1.0e-6, TOLG = 1.0e-6, TOLD = 1.0e-6, TOLS = 1.0e-4, RPF = 1.0e-2) # 1.0e-4) # Return Value: con } # ------------------------------------------------------------------------------ .garchNames <- function(object) { # A function implemented by Diethelm Wuertz # Description: # Print slot names, @fit slot, parameters and controls # Arguments: # object - an object of class 'fGARCH' # FUNCTION: # Slot Names: cat("\nNames - @ \n") print(slotNames(object)) # @fit Slot: cat("\nNames - @fit \n") print(names(object@fit)) # Parameters: cat("\nNames - @fit$params \n") print(names(object@fit$params)) # Control: cat("\nNames - @fit$params$control \n") print(names(object@fit$params$control)) # Return Value: invisible() } ################################################################################ fGarch/R/fGarchEnv.R0000644000176200001440000000357513202277107013646 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # .fGarchEnv Create GARCH Environment # .setfGarchEnv Set GARCH Environment # .getfGarchEnv Get GARCH Environment ################################################################################ .fGarchEnv <- new.env(hash = TRUE) # ------------------------------------------------------------------------------ .setfGarchEnv <- function(...) { x <- list(...) nm <- names(x) if (is.null(nm) || "" %in% nm) stop("all arguments must be named") sapply(nm, function(nm) assign(nm, x[[nm]], envir = .fGarchEnv)) invisible() } # ------------------------------------------------------------------------------ .getfGarchEnv <- function(x = NULL, unset = "") { if (is.null(x)) x <- ls(all.names = TRUE, envir = .fGarchEnv) ### unlist(mget(x, envir = .fGarchEnv, mode = "any", ### ifnotfound = as.list(unset)), recursive = FALSE) get(x, envir = .fGarchEnv, mode = "any") } ################################################################################ fGarch/R/dist-gedSlider.R0000644000176200001440000000661513202277107014644 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # gedSlider Displays Generalized Error Distribution and RVS ################################################################################ gedSlider <- function(type = c("dist", "rand")) { # A function implemented by Diethelm Wuertz # Description: # Displays interactively skew GED distribution # Note: # dged(x, mean = 0, sd = 1, nu = 5) # FUNCTION: # Internal Function: refresh.code = function(...) { # Sliders: N = .sliderMenu(no = 1) mean = .sliderMenu(no = 2) sd = .sliderMenu(no = 3) nu = .sliderMenu(no = 4) # Compute Data: xmin = round(qged(0.01, mean, sd, nu), digits = 2) xmax = round(qged(0.99, mean, sd, nu), digits = 2) s = seq(xmin, xmax, length = N) y1 = dged(s, mean, sd, nu) y2 = pged(s, mean, sd, nu) main1 = paste("GED Density\n", "mean = ", as.character(mean), " | ", "sd = ", as.character(sd), " | ", "nu = ", as.character(nu) ) main2 = paste("GED Probability\n", "xmin [0.01] = ", as.character(xmin), " | ", "xmax [0.99] = ", as.character(xmax) ) # Random Numbers: if (type[1] == "rand") { x = rged(N, mean, sd, nu) } # Frame: par(mfrow = c(2, 1), cex = 0.7) # Density: if (type[1] == "rand") { hist(x, probability = TRUE, col = "steelblue", border = "white", breaks = "FD", xlim = c(xmin, xmax), ylim = c(0, 1.1*max(y1)), main = main1 ) lines(s, y1, col = "orange") } else { plot(s, y1, type = "l", xlim = c(xmin, xmax), col = "steelblue") abline (h = 0, lty = 3) title(main = main1) grid() } # Probability: plot(s, y2, type = "l", xlim = c(xmin, xmax), ylim = c(0, 1), col = "steelblue" ) abline (h = 0, lty = 3) title(main = main2) grid() # Frame: par(mfrow = c(1, 1), cex = 0.7) } # Open Slider Menu: .sliderMenu(refresh.code, names = c( "N", "mean", "sd", "nu"), minima = c( 10, -5.0, 0.1, 2.1), maxima = c( 1000, +5.0, 5.0, 10.0), resolutions = c( 10, 0.1, 0.1, 0.1), starts = c( 100, 0.0, 1.0, 5.0) ) } ################################################################################ fGarch/R/dist-ged.R0000644000176200001440000000727113202277107013500 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: GED DISTRIBUTION: # dged Density for the Generalized Error Distribution # pged Probability function for the GED # qged Quantile function for the GED # rged Random Number Generator for the GED ################################################################################ dged <- function(x, mean = 0, sd = 1, nu = 2, log = FALSE) { # A function imlemented by Diethelm Wuertz # Description: # Compute the density for the # generalized error distribution. # FUNCTION: # Params: if (length(mean) == 3) { nu = mean[3] sd = mean[2] mean = mean[1] } # Compute Density: z = (x - mean ) / sd lambda = sqrt ( 2^(-2/nu) * gamma(1/nu) / gamma(3/nu) ) g = nu / ( lambda * (2^(1+1/nu)) * gamma(1/nu) ) result = g * exp (-0.5*(abs(z/lambda))^nu) / sd # Log: if(log) result = log(result) # Return Value result } # ------------------------------------------------------------------------------ pged <- function(q, mean = 0, sd = 1, nu = 2) { # A function implemented by Diethelm Wuertz # Description: # Compute the probability for the # generalized error distribution. # FUNCTION: # Compute Probability: q = (q - mean ) / sd lambda = sqrt ( 2^(-2/nu) * gamma(1/nu) / gamma(3/nu) ) g = nu / ( lambda * (2^(1+1/nu)) * gamma(1/nu) ) h = 2^(1/nu) * lambda * g * gamma(1/nu) / nu s = 0.5 * ( abs(q) / lambda )^nu result = 0.5 + sign(q) * h * pgamma(s, 1/nu) # Return Value: result } # ------------------------------------------------------------------------------ qged <- function(p, mean = 0, sd = 1, nu = 2) { # A function implemented by Diethelm Wuertz # Description: # Compute the quantiles for the # generalized error distribution. # FUNCTION: # Compute Quantiles: lambda = sqrt ( 2^(-2/nu) * gamma(1/nu) / gamma(3/nu) ) q = lambda * (2*qgamma((abs(2*p-1)), 1/nu))^(1/nu) result = q*sign(2*p-1) * sd + mean # Return Value: result } # ------------------------------------------------------------------------------ rged <- function(n, mean = 0, sd = 1, nu = 2) { # A function implemented by Diethelm Wuertz # Description: # Generate GED random deviates. The function uses the # method based on the transformation of a Gamma random # variable. # FUNCTION: # Generate Random Deviates: lambda = sqrt ( 2^(-2/nu) * gamma(1/nu) / gamma(3/nu) ) # print(lambda) r = rgamma(n, 1/nu) z = lambda * (2*r)^(1/nu) * sign(runif(n)-1/2) result = z * sd + mean # Return Value: result } ################################################################################ fGarch/R/garch-Gradient.R0000644000176200001440000000602013202277107014606 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: PARAMETER ESTIMATION: # .garchRCDAGradient Computes R coded CDA matrix of contributions # to the Gradient ################################################################################ .garchRCDAGradient <- function(par, .params, .series, eps = 1.0e-4) { # A function implemented by Michal Miklovic & Yohan Chalabi # Description: # Compute R coded CDA (central difference approximated) Gradient # Reference: # http://status.sph.umich.edu/computing/manuals/sas8/stat/chap46/sect26.htm # FUNCTION: # Starttime .StartGradient <- Sys.time() # Algorithm algorithm = .params$control$algorithm[1] .trace = FALSE # LLH for the computation of matrix of contributions to the Gradient skew <- .params$skew shape <- .params$shape delta <- .params$delta deltainv = 1/delta llh.start = .series$llh.start N <- length(.series$x) .garchDist <- .getfGarchEnv(".garchDist") # Compute matrix of contributions to the Gradient: eps = eps * par n = N - llh.start + 1 K = length(par) G = matrix(0, nrow = n, ncol = K) for (i in 1:K) { x1 = x2 = par x1[i] = x1[i] + eps[i] x2[i] = x2[i] - eps[i] # .garchLLH(x1, .trace, TRUE) h1 <- .getfGarchEnv(".series")$h z1 <- .getfGarchEnv(".series")$z hh1 = (abs(h1[(llh.start):N]))^deltainv zz1 = z1[(llh.start):N] llh.grad1 <- log(.garchDist(z = zz1, hh = hh1, skew = skew, shape = shape)) # .garchLLH(x2, .trace, TRUE) h2 <- .getfGarchEnv(".series")$h z2 <- .getfGarchEnv(".series")$z hh2 = (abs(h2[(llh.start):N]))^deltainv zz2 = z2[(llh.start):N] llh.grad2 <- log(.garchDist(z = zz2, hh = hh2, skew = skew, shape = shape)) # G[,i] = (llh.grad1 - llh.grad2) / (2*eps[i]) } rownames(G) = c(1:n) colnames(G) = names(par) # make sure that h and z are ok .setfGarchEnv(.series = .series) time = Sys.time() - .StartGradient # Attribute Exdecution time attr(G, "time") = time # Return Value: G } ################################################################################ fGarch/R/loglik.R0000644000176200001440000001667013202277107013264 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # .garchLLH Computes log-likelihood function # .garchOptimizeLLH Opimizes log-likelihood function ################################################################################ .garchLLH <- function(params, trace = TRUE, fGarchEnv = FALSE) { # A function implemented by Diethelm Wuertz # Description: # Compute Log-Likelihood Function # Arguments: # params - a named numeric vector with the model parameters # to be optimized # Value: # Returns the value of the max log-likelihood function. # Note: # The variables '.series' and '.params' must be global available # FUNCTION: # DEBUG: DEBUG = FALSE if (DEBUG) print("Entering Function .garchLLH") # Get Global Variables: .series <- .getfGarchEnv(".series") .params <- .getfGarchEnv(".params") .garchDist <- .getfGarchEnv(".garchDist") .llh <- .getfGarchEnv(".llh") # How to calculate the LLH Function? if (DEBUG) print(.params$control$llh) if(.params$control$llh == "internal") { if (DEBUG) print("internal") return(.aparchLLH.internal(params, trace = trace, fGarchEnv = fGarchEnv)) } else if (.params$control$llh == "filter") { if (DEBUG) print("filter") return(.aparchLLH.filter(params, trace = trace, fGarchEnv = fGarchEnv)) } else if (.params$control$llh == "testing") { if (DEBUG) print("testing") return(.aparchLLH.testing(params, trace = trace, fGarchEnv = fGarchEnv)) } else { stop("LLH is neither internal, testing, nor filter!") } } # ------------------------------------------------------------------------------ .garchOptimizeLLH <- function(hessian = hessian, robust.cvar, trace) { # A function implemented by Diethelm Wuertz # Description: # Opimizes the Log-Likelihood Function # Arguments: # hessian - the Hessian matrix # robust.cvar - a logical # trace - a logical # FUNCTION: # DEBUG: DEBUG = FALSE if (DEBUG) print("Entering Function .garchOptimizeLLH") # get global variables .series <- .getfGarchEnv(".series") .params <- .getfGarchEnv(".params") # Initialization: INDEX = .params$index # Algorithm: algorithm = .params$control$algorithm[1] TOL1 = .params$control$tol1 TOL2 = .params$control$tol2 if(trace) { cat("\n\n--- START OF TRACE ---") cat("\nSelected Algorithm:", algorithm, "\n") } # First Method: # Two Step Apparoach > Trust Region + Nelder-Mead Simplex if(algorithm == "nlminb" | algorithm == "nlminb+nm") { fit <- .garchRnlminb(.params, .series, .garchLLH, trace) .params$llh = fit$llh .params$params[INDEX] = fit$par .setfGarchEnv(.params = .params) } if(algorithm == "nlminb+nm") { fit <- .garchRnm(.params, .series, .garchLLH, trace) .params$llh = fit$llh .params$params[INDEX] = fit$par .setfGarchEnv(.params = .params) } # Second Method: # Two Step Approach > BFGS + Nelder-Mead Simplex if(algorithm == "lbfgsb" | algorithm == "lbfgsb+nm") { fit <- .garchRlbfgsb(.params, .series, .garchLLH, trace) .params$llh = fit$llh .params$params[INDEX] = fit$par .setfGarchEnv(.params = .params) } if(algorithm == "lbfgsb+nm") { fit <- .garchRnm(.params, .series, .garchLLH, trace) .params$llh = fit$llh .params$params[INDEX] = fit$par .setfGarchEnv(.params = .params) } # Save parameters: .params$llh = fit$llh .params$params[INDEX] = fit$par .setfGarchEnv(.params = .params) # Compute the Hessian: if (hessian == "ropt") { fit$hessian <- - .garchRoptimhess(par = fit$par, .params = .params, .series = .series) titleHessian = "R-optimhess" } else if (hessian == "rcd") { fit$hessian <- - .garchRCDAHessian(par = fit$par, .params = .params, .series = .series) titleHessian = "Central" } else if (hessian == "rts") { fit$hessian <- - .garchTSHessian(par = fit$par, .params = .params, .series = .series) titleHessian = "Two Sided" } # Rescale Parameters: if (.params$control$xscale) { .series$x <- .series$x * .series$scale if (.params$include["mu"]) fit$coef["mu"] <- fit$par["mu"] <- .params$params["mu"] <- .params$params["mu"]*.series$scale if (.params$include["omega"]) fit$coef["omega"] <- fit$par["omega"] <- .params$params["omega"] <- .params$params["omega"]*.series$scale^(.params$params["delta"]) # save changes .setfGarchEnv(.params = .params) .setfGarchEnv(.series = .series) } # Rescale Hessian Matrix: if (.params$control$xscale) { if (.params$include["mu"]) { fit$hessian[,"mu"] <- fit$hessian[,"mu"] / .series$scale fit$hessian["mu",] <- fit$hessian["mu",] / .series$scale } if (.params$include["omega"]) { fit$hessian[,"omega"] <- fit$hessian[,"omega"] / .series$scale^(.params$params["delta"]) fit$hessian["omega",] <- fit$hessian["omega",] / .series$scale^(.params$params["delta"]) } } # Recalculate llh, h, z with Rescaled Parameters: .llh <- fit$llh <- fit$value <- .garchLLH(fit$par, trace = FALSE, fGarchEnv = TRUE) .series <- .getfGarchEnv(".series") # Compute the Gradient: # YC: needs to be after the calculation of h, z ! if (robust.cvar) fit$gradient <- - .garchRCDAGradient( par = fit$par, .params = .params, .series = .series) # Compute Information Criterion Statistics: N = length(.series$x) NPAR = length(fit$par) fit$ics = c( AIC = c((2*fit$value)/N + 2 * NPAR/N), BIC = (2*fit$value)/N + NPAR * log(N)/N, SIC = (2*fit$value)/N + log((N+2*NPAR)/N), HQIC = (2*fit$value)/N + (2*NPAR*log(log(N)))/N ) names(fit$ics) <- c("AIC", "BIC", "SIC", "HQIC") # Print LLH if we trace: if(trace) { cat("\nFinal Estimate of the Negative LLH:\n") cat(" LLH: ", .llh, " norm LLH: ", .llh/N, "\n") print(fit$par) } # Print Hessian Matrix if we trace: if(trace) { cat("\n", titleHessian, " Difference Approximated Hessian Matrix:\n", sep = "") print(fit$hessian) cat("\n--- END OF TRACE ---\n\n") } # Return Value: if (DEBUG) print("Entering Function .garchOptimizeLLH") fit } ################################################################################ fGarch/R/methods-summary.R0000644000176200001440000000743613202277107015141 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # summary Summary method for an object of class 'fGARCH' ################################################################################ setMethod(f = "summary", signature(object = "fGARCH"), function(object) { # A function implemented by Diethelm Wuertz # Description: # Summary method for an object of class "fGARCH" # Arguments: # object - an object of class 'fGARCH' # FUNCTION: # same output as show method show(object) # Lagged Series: .tslagGarch = function (x, k = 1) { ans = NULL for (i in k) ans = cbind(ans, .tslag1Garch(x, i)) indexes = (1:length(ans[, 1]))[!is.na(apply(ans, 1, sum))] ans = ans[indexes, ] if (length(k) == 1) ans = as.vector(ans) ans } .tslag1Garch = function (x, k) { c(rep(NA, times = k), x[1:(length(x) - k)]) } # Statistical Tests: cat("\nStandardised Residuals Tests:\n") r.s = object@residuals/object@sigma.t ans = NULL # Normality Tests: jbtest = jarqueberaTest(r.s)@test ans = rbind(ans, c(jbtest[1], jbtest[2])) if (length(r.s) < 5000) { swtest = shapiro.test(r.s) if (swtest[2] < 2.6e-16) swtest[2] = 0 ans = rbind(ans, c(swtest[1], swtest[2])) } else { ans = rbind(ans, c(NA, NA)) } # Ljung-Box Tests: box10 = Box.test(r.s, lag = 10, type = "Ljung-Box") box15 = Box.test(r.s, lag = 15, type = "Ljung-Box") box20 = Box.test(r.s, lag = 20, type = "Ljung-Box") ans = rbind(ans, c(box10[1], box10[3])) ans = rbind(ans, c(box15[1], box15[3])) ans = rbind(ans, c(box20[1], box20[3])) box10 = Box.test(r.s^2, lag = 10, type = "Ljung-Box") box15 = Box.test(r.s^2, lag = 15, type = "Ljung-Box") box20 = Box.test(r.s^2, lag = 20, type = "Ljung-Box") ans = rbind(ans, c(box10[1], box10[3])) ans = rbind(ans, c(box15[1], box15[3])) ans = rbind(ans, c(box20[1], box20[3])) # Ljung-Box Tests - tslag required lag.n = 12 x.s = as.matrix(r.s)^2 n = nrow(x.s) tmp.x = .tslagGarch(x.s[, 1], 1:lag.n) tmp.y = x.s[(lag.n + 1):n, 1] fit = lm(tmp.y ~ tmp.x) stat = (n-lag.n) * summary.lm(fit)$r.squared ans = rbind(ans, c(stat, p.value = 1 - pchisq(stat, lag.n)) ) # Add Names: rownames(ans) = c( " Jarque-Bera Test R Chi^2 ", " Shapiro-Wilk Test R W ", " Ljung-Box Test R Q(10) ", " Ljung-Box Test R Q(15) ", " Ljung-Box Test R Q(20) ", " Ljung-Box Test R^2 Q(10) ", " Ljung-Box Test R^2 Q(15) ", " Ljung-Box Test R^2 Q(20) ", " LM Arch Test R TR^2 ") colnames(ans) = c("Statistic", "p-Value") print(ans) # Information Criterion Statistics: cat("\nInformation Criterion Statistics:\n") print(object@fit$ics) # Return Value: cat("\n") invisible() }) ################################################################################ fGarch/R/garch-FitFromFormula.R0000644000176200001440000001452113202304445015746 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: PARAMETER ESTIMATION: # garchFit Fits the parameters of GARCH process # .garchArgsParser Parses formula and data for garchFit # .garchOptimizerControl Sets default values for Garch Optimizer # .garchFit ... old Version, still in use by garchFit() # .garchNames Slot names, @fit slot, parameters and controls ################################################################################ garchFit <- function( formula = ~ garch(1,1), data = fGarch::dem2gbp, init.rec = c("mci", "uev"), delta = 2, skew = 1, shape = 4, cond.dist = c("norm", "snorm", "ged", "sged", "std", "sstd", "snig", "QMLE"), include.mean = TRUE, include.delta = NULL, include.skew = NULL, include.shape = NULL, leverage = NULL, trace = TRUE, algorithm = c("nlminb", "lbfgsb", "nlminb+nm", "lbfgsb+nm"), hessian = c("ropt", "rcd"), control = list(), title = NULL, description = NULL, ...) { # A function implemented by Diethelm Wuertz # Description: # Fit parameters to a ARMA-GARCH model by Formula Specification # Arguments: # formula - ARMA(m,n) + GARCH/APARCH(p,q) mean and variance # specification # data - any univariate time series which can be converted # into a timeSeries using the generic function as.timeSeries # init.rec - names type of initialization of recurrence # mci = mu-current-iteration, or # uev = unconditional-expected-variances # delta - numeric value of the exponent delta # skew - optional skewness or skewness related parameter # shape - optional shape parameter # cond.dist - name of the conditional distribution, one of # norm, snorm, ged, sged, std, sstd, snig, QMLE # include.mean - a logical, should the mean value be estimated ? # include.delta - should the exponent be estimated ? # leverage - should the leverage factors be estimated ? # trace - should the optimization be traced ? # control - list of additional control parameters for the solver # title - an optional title string # description - an optional project description string # Example: # garchFit() # FUNCTION: # DEBUG: DEBUG = FALSE # Match arguments: init.rec = match.arg(init.rec) cond.dist = match.arg(cond.dist) hessian = match.arg(hessian) algorithm = match.arg(algorithm) # Call: CALL = match.call() # Parse formula and data for garchFit ... # Note in the new version we are working with timeSeries ... Name = capture.output(substitute(data)) if(is.character(data)) { eval(parse(text = paste("data(", data, ")"))) data = eval(parse(text = data)) } # data <- if (inherits(data, "timeSeries") data else as.timeSeries(data) data <- as.data.frame(data) # Column Names: if (isUnivariate(data)) { colnames(data) <- "data" } else { # Check unique column Names: uniqueNames = unique(sort(colnames(data))) if (is.null(colnames(data))) { stop("Column names of data are missing.") } if (length(colnames(data)) != length(uniqueNames)) { stop("Column names of data are not unique.") } } # Handle if we have no left-hand-side for the formula ... # Note in this case the length of the formula is 2 (else 3): if (length(formula) == 3 && isUnivariate(data) ) formula[2] <- NULL if (length(formula) == 2) { if (isUnivariate(data)) { # Missing lhs -- we substitute the data file name as lhs ... formula = as.formula(paste("data", paste(formula, collapse = " "))) } else { stop("Multivariate data inputs require lhs for the formula.") } } # Robust Covariance ? robust.cvar <- (cond.dist == "QMLE") # Parse Arguments: args = .garchArgsParser(formula = formula, data = data, trace = FALSE) # DEBUG - Print Arguments: if (DEBUG) print(list( formula.mean = args$formula.mean, formula.var = args$formula.var, series = args$series, init.rec = init.rec, delta = delta, skew = skew, shape = shape, cond.dist = cond.dist, include.mean = include.mean, include.delta = include.delta, include.skew = include.skew, include.shape = include.shape, leverage = leverage, trace = trace, algorithm = algorithm, hessian = hessian, robust.cvar = robust.cvar, control = control, title = title, description = description)) # Fit: ans = .garchFit( formula.mean = args$formula.mean, formula.var = args$formula.var, series = args$series, init.rec, delta, skew, shape, cond.dist, include.mean, include.delta, include.skew, include.shape, leverage, trace, algorithm, hessian, robust.cvar, control, title, description, ...) ans@call = CALL attr(formula, "data") <- paste("data = ", Name, sep = "") ans@formula = formula # Return Value: ans } ################################################################################ fGarch/R/dist-sstdSlider.R0000644000176200001440000000716013202277107015056 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # sstdSlider Displays Variance-1 Student-t Distribution and RVS ################################################################################ sstdSlider <- function(type = c("dist", "rand")) { # A function implemented by Diethelm Wuertz # Description: # Displays interactively skew Student-t distribution # Note: # dsstd(x, mean = 0, sd = 1, nu = 5, xi = 1.5) # FUNCTION: # Internal Function: refresh.code = function(...) { # Sliders: N = .sliderMenu(no = 1) mean = .sliderMenu(no = 2) sd = .sliderMenu(no = 3) nu = .sliderMenu(no = 4) xi = .sliderMenu(no = 5) invert = .sliderMenu(no = 6) # Compute Data: if (invert == 1) xi = round(1/xi, digits = 4) xmin = round(qsstd(0.01, mean, sd, nu, xi), digits = 2) xmax = round(qsstd(0.99, mean, sd, nu, xi), digits = 2) s = seq(xmin, xmax, length = N) y1 = dsstd(s, mean, sd, nu, xi) y2 = psstd(s, mean, sd, nu, xi) main1 = paste("Skew Student-t Density\n", "mean = ", as.character(mean), " | ", "sd = ", as.character(sd), " | ", "nu = ", as.character(nu), " | ", "xi = ", as.character(xi) ) main2 = paste("Skew Student-t Probability\n", "xmin [0.01] = ", as.character(xmin), " | ", "xmax [0.99] = ", as.character(xmax) ) # Random Numbers: if (type[1] == "rand") { x = rsstd(N, mean, sd, nu, xi) } # Frame: par(mfrow = c(2, 1), cex = 0.7) # Density: if (type[1] == "rand") { hist(x, probability = TRUE, col = "steelblue", border = "white", breaks = "FD", xlim = c(xmin, xmax), ylim = c(0, 1.1*max(y1)), main = main1 ) lines(s, y1, col = "orange") } else { plot(s, y1, type = "l", xlim = c(xmin, xmax), col = "steelblue") abline (h = 0, lty = 3) title(main = main1) grid() } # Probability: plot(s, y2, type = "l", xlim = c(xmin, xmax), ylim = c(0, 1), col = "steelblue" ) abline (h = 0, lty = 3) title(main = main2) grid() # Frame: par(mfrow = c(1, 1), cex = 0.7) } # Open Slider Menu: .sliderMenu(refresh.code, names = c( "N", "mean", "sd", "nu", "xi", "xi.inv"), minima = c( 10, -5.0, 0.1, 2.1, 1.0, 0 ), maxima = c( 500, +5.0, 5.0, 10.0, 10.0, 1 ), resolutions = c( 10, 0.1, 0.1, 0.1, 0.1, 1 ), starts = c( 100, 0.0, 1.0, 5.0, 1.0, 0 ) ) } ################################################################################ fGarch/R/dist-snormSlider.R0000644000176200001440000000705113202277107015236 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # snormSlider Displays Normal Distribution and RVS ################################################################################ snormSlider <- function(type = c("dist", "rand")) { # A function implemented by Diethelm Wuertz # Description: # Displays interactively skew Normal distribution # Note: # dsnorm(x, mean = 0, sd = 1, xi = 1.5) # FUNCTION: # Internal Function: refresh.code = function(...) { # Sliders: N = .sliderMenu(no = 1) mean = .sliderMenu(no = 2) sd = .sliderMenu(no = 3) xi = .sliderMenu(no = 4) invert = .sliderMenu(no = 5) # Compute Data: if (invert == 1) xi = 1/xi xmin = round(qsnorm(0.001, mean, sd, xi), digits = 2) xmax = round(qsnorm(0.999, mean, sd, xi), digits = 2) s = seq(xmin, xmax, length = N) y1 = dsnorm(s, mean, sd, xi) y2 = psnorm(s, mean, sd, xi) main1 = paste("Skew Normal Density\n", "mean = ", as.character(mean), " | ", "sd = ", as.character(sd), " | ", "xi = ", as.character(xi) ) main2 = paste("Skew Normal Probability\n", "xmin [0.001] = ", as.character(xmin), " | ", "xmax [0.999] = ", as.character(xmax) ) # Random Numbers: if (type[1] == "rand") { x = rsnorm(N, mean, sd, xi) } # Frame: par(mfrow = c(2, 1), cex = 0.7) # Density: if (type[1] == "rand") { hist(x, probability = TRUE, col = "steelblue", border = "white", breaks = "FD", xlim = c(xmin, xmax), ylim = c(0, 1.1*max(y1)), main = main1 ) lines(s, y1, col = "orange") } else { plot(s, y1, type = "l", xlim = c(xmin, xmax), col = "steelblue") abline (h = 0, lty = 3) title(main = main1) grid() } # Probability: plot(s, y2, type = "l", xlim = c(xmin, xmax), ylim = c(0, 1), col = "steelblue" ) abline (h = 0, lty = 3) title(main = main2) grid() # Frame: par(mfrow = c(1, 1), cex = 0.7) } # Open Slider Menu: .sliderMenu(refresh.code, names = c( "N", "mean", "sd", "xi", "xi.inv"), minima = c( 10, -5.0, 0.1, 1.0, 0 ), maxima = c( 500, +5.0, 5.0, 10.0, 1 ), resolutions = c( 10, 0.1, 0.1, 0.1, 1 ), starts = c( 100, 0.0, 1.0, 1.0, 0 ) ) } ################################################################################ fGarch/R/methods-predict.R0000644000176200001440000002474313202277107015076 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # METHOD: PREDICTION: # predict.fGARCH Forecasts from an object of class 'fGARCH' ################################################################################ setMethod(f = "predict", signature(object = "fGARCH"), definition = function(object, n.ahead = 10, trace = FALSE, mse = c("cond","uncond"), plot=FALSE, nx=NULL, crit_val=NULL, conf=NULL, ...) { # A function implemented by Diethelm Wuertz # Description: # Prediction method for an object of class fGARCH # Arguments: # object an object of class fGARCH as returned by the # function garchFit(). # n.ahead number of steps to be forecasted, an integer # value, by default 10) # trace should the prediction be traced? A logical value, # by default FALSE) # mse should the mean squared errors be conditional or unconditional # plot should the predictions be plotted # nx The number of observations to be plotted with the predictions # (If plot is TRUE, the default value of nx is the sample # size times 0.25.) # crit_va If you want to set manually the critical values for # the confidence intervals # conf The confidence level for computing the critical values # of the confidence intervals # FUNCTION: mse <- match.arg(mse) # Retrieve "fit" from Parameter Estimation: fit = object@fit # Get ARMA(u,v)-GARCH(p,q) Order: u = fit$series$order[1] v = fit$series$order[2] p = fit$series$order[3] q = fit$series$order[4] max.order = max(u, v, p, q) # Get Start Conditions: h.start = fit$series$h.start llh.start = fit$series$llh.start index = fit$params$index params = fit$params$params par = fit$par Names = names(index) for (Name in Names) params[Name] = par[Name] Names = names(params) # Retrieve From Initialized Parameters: cond.dist = fit$params$cond.dist # Extract the Parameters by Name: leverage = fit$params$leverage mu = params["mu"] if (u > 0) { ar = params[substr(Names, 1, 2) == "ar"] } else { ar = c(ar1 = 0) } if (v > 0) { ma = params[substr(Names, 1, 2) == "ma"] } else { ma = c(ma1 = 0) } omega = params["omega"] if (p > 0) { alpha = params[substr(Names, 1, 5) == "alpha"] } else { alpha = c(alpha1 = 0) } if (p > 0 & leverage) { gamma = params[substr(Names, 1, 5) == "gamma"] } else { gamma = c(gamma1 = 0) } if (q > 0) { beta = params[substr(Names, 1, 4) == "beta"] } else { beta = c(beta1 = 0) } delta = params["delta"] skew = params["skew"] shape = params["shape"] # Trace Parameters: if (trace) { cat("\nModel Parameters:\n") print(c(mu, ar, ma, omega, alpha, gamma, beta, delta, skew, shape)) } # Retrieve Series Lengths: M = n.ahead N = length(object@data) # Get and Extend Series: x = c(object@data, rep(mu, M)) h = c(object@h.t, rep(0, M)) z = c(fit$series$z, rep(mu, M)) # Forecast and Optionally Trace Variance Model: var.model = fit$series$model[2] # Forecast GARCH Variance: if (var.model == "garch") { if (trace) cat("\nForecast GARCH Variance:\n") for (i in 1:M) { h[N+i] = omega + sum(beta*h[N+i-(1:q)]) for (j in 1:p) { if (i-j > 0) { s = h[N + i - j] } else { s = z[N + i - j]^2 } h[N+i] = h[N+i] + alpha[j] * s } } } # Forecast APARCH Variance: if (var.model == "aparch") { if (trace) cat("\nForecast APARCH Variance:\n") for (i in 1:M) { h[N+i] = omega + sum(beta*h[N+i-(1:q)]) for (j in 1:p) { kappa = garchKappa(cond.dist = cond.dist, gamma = gamma[j], delta = delta, skew = skew, shape = shape) if (i-j > 0) { s = kappa * h[N + i - j] } else { s = (abs(z[N + i - j]) - gamma[j]*z[N + i - j])^delta } h[N+i] = h[N+i] + alpha[j] * s } } } # Forecast and Optionally Trace Mean Model: # Note we set maxit=0 to get an object of class Arima with fixed # init parameters ... mu <- mu/(1-sum(ar)) ARMA <- arima(x = object@data, order = c(max(u, 1), 0, max(v, 1)), init = c(ar, ma, mu), transform.pars = FALSE, optim.control = list(maxit = 0)) prediction = predict(ARMA, n.ahead) meanForecast = as.vector(prediction$pred) if(mse=="uncond") { meanError = as.vector(prediction$se) } else { # coefficients of h(t+1) a_vec <- rep(0,(n.ahead)) hhat <- h[-(1:N)]^(2/delta[[1]]) #-> [[1]] to omit name of delta u2 <- length(ar) meanError <- hhat[1] a_vec[1] = ar[1] + ma[1] meanError <- na.omit(c(meanError,sum(hhat[1:2]*c(a_vec[1]^2,1)))) if ((n.ahead - 1) > 1) { for( i in 2:(n.ahead - 1)) { a_vec[i] <- ar[1:min(u2,i-1)]*a_vec[(i-1):(i-u2)] + ifelse(i>u,0,ar[i]) + ifelse(i>v,0,ma[i]) meanError <- na.omit(c(meanError, sum(hhat[1:(i+1)]*c(a_vec[i:1]^2,1)))) } } meanError <- sqrt(meanError) } if (trace) { cat("\nForecast ARMA Mean:\n") print(ARMA) cat("\n") print(prediction) } # Standard Deviations: standardDeviation = h^(1/delta) # Plotting the predictions if (plot) { if(is.null(nx)) nx <- round(length(object@data)*.25) t <- length(object@data) x <- c(object@data[(t-nx+1):t],meanForecast) # Computing the appropriate critical values if (is.null(conf)) conf <- 0.95 if (is.null(crit_val)) { if (object@fit$params$cond.dist=="norm") { crit_valu <- qnorm(1-(1-conf)/2) crit_vald <- qnorm((1-conf)/2) } if (object@fit$params$cond.dist=="snorm") { crit_valu <- qsnorm(1-(1-conf)/2,xi=coef(object)["skew"]) crit_vald <- qsnorm((1-conf)/2,xi=coef(object)["skew"]) } if (object@fit$params$cond.dist=="ged") { crit_valu <- qged(1-(1-conf)/2,nu=coef(object)["shape"]) crit_vald <- qged((1-conf)/2,nu=coef(object)["shape"]) } if (object@fit$params$cond.dist=="sged") { crit_valu <- qsged(1-(1-conf)/2,nu=coef(object)["shape"], xi=coef(object)["skew"]) crit_vald <- qsged((1-conf)/2,nu=coef(object)["shape"], xi=coef(object)["skew"]) } if (object@fit$params$cond.dist=="std") { crit_valu <- qstd(1-(1-conf)/2,nu=coef(object)["shape"]) crit_vald <- qstd((1-conf)/2,nu=coef(object)["shape"]) } if (object@fit$params$cond.dist=="sstd") { crit_valu <- qsstd(1-(1-conf)/2,nu=coef(object)["shape"], xi=coef(object)["skew"]) crit_vald <- qsstd((1-conf)/2,nu=coef(object)["shape"], xi=coef(object)["skew"]) } if (object@fit$params$cond.dist=="snig") { crit_valu <- qsnig(1-(1-conf)/2,zeta=coef(object)["shape"], rho=coef(object)["skew"]) crit_vald <- qsnig((1-conf)/2,zeta=coef(object)["shape"], rho=coef(object)["skew"]) } if (object@fit$params$cond.dist=="QMLE") { e <- sort(object@residuals/object@sigma.t) crit_valu <- e[round(t*(1-(1-conf)/2))] crit_vald <- e[round(t*(1-conf)/2)] } } else { if (length(crit_val)==2) { crit_valu <- crit_val[2] crit_vald <- crit_val[1] } if (length(crit_val)==1) { crit_valu <- abs(crit_val) crit_vald <- -abs(crit_val) } } int_l <- meanForecast+crit_vald*meanError int_u <- meanForecast+crit_valu*meanError ylim_l <- min(c(x,int_l)*(.95)) ylim_u <- max(c(x,int_u)*(1.05)) plot(x,type='l',ylim=c(ylim_l,ylim_u)) title("Prediction with confidence intervals") lines((nx+1):(nx+n.ahead), meanForecast, col = 2, lwd = 2) lines((nx+1):(nx+n.ahead), int_l, col = 3, lwd = 2) lines((nx+1):(nx+n.ahead), int_u, col = 4, lwd = 2) polygon(c((nx+1):(nx+n.ahead),(nx+n.ahead):(nx+1)), c(int_l, int_u[n.ahead:1]), border = NA, density = 20, col = 5, angle = 90) es1 <- as.expression(substitute(hat(X)[t+h] + crit_valu*sqrt(MSE), list(crit_valu=round(crit_valu,3)))) es2 <- as.expression(substitute(hat(X)[t+h] - crit_vald*sqrt(MSE), list(crit_vald=abs(round(crit_vald,3))))) es3 <- expression(hat(X)[t+h]) legend("bottomleft",c(es3,es2,es1),col=2:4,lty=rep(1,3),lwd=rep(2,3)) grid() } # Result: if(plot) { forecast = data.frame( meanForecast = meanForecast, meanError = meanError, standardDeviation = standardDeviation[-(1:N)], lowerInterval = int_l, upperInterval = int_u) } else { forecast = data.frame( meanForecast = meanForecast, meanError = meanError, standardDeviation = standardDeviation[-(1:N)]) } # Return Value: forecast }) ################################################################################ fGarch/R/loglik-egarch.R0000644000176200001440000000170713202277107014506 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # .egarchLLH ARMA-EGARCH model ################################################################################ fGarch/R/dist-sstdFit.R0000644000176200001440000001043113202277107014351 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: PARAMETER ESTIMATION: # sstdFit Fit the parameters for a skew Sudent-t distribution ################################################################################ .sstdFit <- function(x, mean = 0, sd = 1, xi = 1.5, scale = NA, doplot = TRUE, add = FALSE, span = "auto", trace = TRUE, title = NULL, description = NULL, ...) { # A function implemented by Diethelm Wuertz # Description: # Fits parameters of a Skew Student-t using maximum log-likelihood # Example: # set.seed(4711); x = rsnorm(500); .snormFit(x)@fit$estimate # FUNCTION: # Settings: dist = dsstd model = "SSTD Parameter Estimation" scale = "not used" x = x.orig = as.vector(x) # Parameter Estimation: obj = function(x, y = x, trace) { f = try(-sum(log(dist(y, x[1], x[2], x[3], x[4]))), silent = TRUE) if (is.na(f) | class(f) == "try-error") return(1e9) # Print Iteration Path: if (trace) { cat("\n Objective Function Value: ", -f) cat("\n Parameter Estimates: ", x, "\n") } f } r = nlminb( start = c(mean = 0, sd = 1, nu = 5, xi = 1.5), objective = obj, lower = c(-Inf, 0, 2, 0), upper = c( Inf, Inf, Inf, Inf), y = x, trace = trace) names(r$par) <- c("mean", "sd", "nu", "xi") # Add Title and Description: if (is.null(title)) title = model if (is.null(description)) description = description() # Result: fit = list(estimate = r$par, minimum = -r$objective, code = r$convergence) # Optional Plot: if (doplot) { x = as.vector(x.orig) if (span == "auto") span = seq(min(x), max(x), length = 501) z = density(x, n = 100, ...) x = z$x[z$y > 0] y = z$y[z$y > 0] y.points = dist(span, r$par[1], r$par[2], r$par[3], r$par[4]) ylim = log(c(min(y.points), max(y.points))) if (add) { lines(x = span, y = log(y.points), col = "steelblue") } else { plot(x, log(y), xlim = c(span[1], span[length(span)]), ylim = ylim, type = "p", xlab = "x", ylab = "log f(x)", ...) title(main = model) lines(x = span, y = log(y.points), col = "steelblue") } } # Return Value: new("fDISTFIT", call = match.call(), model = model, data = as.data.frame(x.orig), fit = fit, title = title, description = description() ) } # ------------------------------------------------------------------------------ sstdFit <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Fit the parameters for a skew Sudent-t distribution # with unit variance # FUNCTION: # For S-Plus compatibility: if (!exists("nlm")) nlm = function (f, p, ...) nlminb(start = p, objective = f, ...) # Start Value: p = c(mean = mean(x), sd = sqrt(var(x)), nu = 4, xi = 1) # Log-likelihood Function: loglik = function(x, y = x){ f = -sum(log(dsstd(y, x[1], x[2], x[3], x[4]))) f } # Minimization: fit = nlm( f = loglik, p = p, y = x, ...) Names = c("mean", "sd", "nu", "xi") names(fit$estimate) = Names names(fit$gradient) = Names # Return Value: fit } ################################################################################# ------------------------------------------------------------------------------ fGarch/R/garch-Spec.R0000644000176200001440000001726113202277107013754 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: SPECIFICATION: # garchSpec Creates a 'garchSpec' object from scratch ############################################################################### garchSpec <- function (model = list(), presample = NULL, cond.dist = c("norm", "ged", "std", "snorm", "sged", "sstd"), rseed = NULL) { # A function implemented by Diethelm Wuertz # Description: # Creates a "garchSpec" object from scratch. # Arguments: # model - a list with the model parameters as entries # omega - the variance value for GARCH/APARCH # specification, # alpha - a vector of autoregressive coefficients # of length p for the GARCH/APARCH specification, # gamma - a vector of leverage coefficients of # length p for the APARCH specification, # beta - a vector of moving average coefficients of # length q for the GARCH/APARCH specification, # mu - the mean value for ARMA specification, # ar - a vector of autoregressive coefficients of # length m for the ARMA specification, # ma - a vector of moving average coefficients of # length n for the ARMA specification, # delta - the exponent value used in the variance equation. # skew - a numeric value listing the distributional # skewness parameter. # shape - a numeric value listing the distributional # shape parameter. # presample - either a multivariate "timeSeries", a # multivariate "ts", a "data.frame" object or a numeric # "matrix" with 3 columns and at least max(m,n,p,q) # rows. The first culumn are the innovations, the second # the conditional variances, and the last the time series. # condd.dist - a character string naming the distribution # function. # rseed - optional random seed. # Slots: # call - the function call. # formula - a formula object describing the model, e.g. # ARMA(m,n) + GARCH(p,q). ARMA can be missing or # specified as AR(m) or MA(n) in the case of pure # autoregressive or moving average models. GARCH may # alternatively specified as ARCH(p) or APARCH(p,q). # If formula is set to "NA", the formula is constructed # from the "model" list. # model - as declared in the input. # FUNCTION: # Match Arguments: cond.dist = match.arg(cond.dist) # Skewness Parameter Settings: skew = list( "norm" = NULL, "ged" = NULL, "std" = NULL, "snorm" = 0.9, "sged" = 0.9, "sstd" = 0.9) # Shape Parameter Settings: shape = list( "norm" = NULL, "ged" = 2, "std" = 4, "snorm" = NULL, "sged" = 2, "sstd" = 4) # Default Model: control = list( omega = 1.0e-6, alpha = 0.1, gamma = NULL, beta = 0.8, mu = NULL, ar = NULL, ma = NULL, delta = 2, skew = skew[[cond.dist]], shape = shape[[cond.dist]] ) # Update Control: control[names(model)] <- model model <- control # check if alpha and beta are well defined if (sum(c(model$alpha, model$beta))>1) warnings("sum(alpha)+sum(beta)>1") # Model Orders: order.ar = length(model$ar) order.ma = length(model$ma) order.alpha = length(model$alpha) if (sum(model$beta) == 0) { order.beta = 0 } else { order.beta = length(model$beta) } # Compose Mean Formula Object: if (order.ar == 0 && order.ma == 0) { formula.mean = "" } if (order.ar > 0 && order.ma == 0) { formula.mean = paste ("ar(", as.character(order.ar), ")", sep = "") } if (order.ar == 0 && order.ma > 0) { formula.mean = paste ("ma(", as.character(order.ma), ")", sep = "") } if (order.ar > 0 && order.ma > 0) { formula.mean = paste ("arma(", as.character(order.ar), ", ", as.character(order.ma), ")", sep = "") } # Compose Variance Formula Object: formula.var = "garch" if (order.beta == 0) formula.var = "arch" if (!is.null(model$gamma) != 0) formula.var = "aparch" if (model$delta != 2) formula.var = "aparch" if (order.beta == 0) { formula.var = paste(formula.var, "(", as.character(order.alpha), ")", sep = "") } else { formula.var = paste(formula.var, "(", as.character(order.alpha), ", ", as.character(order.beta), ")", sep = "") } # Compose Mean-Variance Formula Object: if (formula.mean == "") { formula = as.formula(paste("~", formula.var)) } else { formula = as.formula(paste("~", formula.mean, "+", formula.var)) } # Add NULL default entries: if (is.null(model$mu)) model$mu = 0 if (is.null(model$ar)) model$ar = 0 if (is.null(model$ma)) model$ma = 0 if (is.null(model$gamma)) model$gamma = rep(0, times = order.alpha) # print(unlist(model)) # Seed: if (is.null(rseed)) { rseed = 0 } else { set.seed(rseed) } # Define Missing Presample: order.max = max(order.ar, order.ma, order.alpha, order.beta) iterate = TRUE if (!is.matrix(presample)) { if (is.null(presample)) { iterate = FALSE n.start = order.max } else { n.start = presample } z = rnorm(n = n.start) # GARCH(p, q): h = rep(model$omega/(1-sum(model$alpha)-sum(model$beta)), times = n.start) y = rep(model$mu/(1-sum(model$ar)), times = n.start) # APARCH(p,q): # ... we initialize all models with norm-GARCH(p,q) processes } else { z = presample[, 1] h = presample[, 2] y = presample[, 3] } presample = cbind(z, h, y) # Presample Iteration: if (iterate) { n.iterate = length(z) - order.max deltainv = 1/model$delta for (i in n.iterate:1) { h[i] = model$omega + sum(model$alpha*(abs(abs(y[i+(1:order.alpha)]) - model$gamma*y[i+(1:order.alpha)])^model$delta)) + sum(model$beta*h[i+(1:order.beta)]) y[i] = model$mu + sum(model$ar*y[i+(1:order.ar)]) + sum(model$ma*(h[i+(1:order.ma)]**deltainv)) + h[i]^deltainv * z[i] } } # Result: new("fGARCHSPEC", call = match.call(), formula = formula, model = list(omega = model$omega, alpha = model$alpha, gamma = model$gamma, beta = model$beta, mu = model$mu, ar = model$ar, ma = model$ma, delta = model$delta, skew = model$skew, shape = model$shape), presample = as.matrix(presample), distribution = as.character(cond.dist), rseed = as.numeric(rseed) ) } ################################################################################ fGarch/R/methods-show.R0000644000176200001440000001277413202277107014425 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # show.fGARCH S4 Show method for an object of class 'fGARCH' # show.fGARCHSPEC S4 Show method for an object of class 'fGARCHSPEC' ################################################################################ setMethod(f = "show", signature(object = "fGARCH"), definition = function(object) { # A function implemented by Diethelm Wuertz # Description: # Print method for an object of class "fGARCH" # Arguments: # object - an object of class 'fGARCH' # FUNCTION: # Title: cat("\nTitle:\n ") cat(object@title, "\n") # Call: cat("\nCall:\n ") cat(paste(deparse(object@call), sep = "\n", collapse = "\n"), "\n") # Mean and Variance Equation: cat("\nMean and Variance Equation:\n ") Name = unclass(attr(object@formula, "data")) Formula = object@formula attr(Formula, "data") <- NULL print(Formula) cat(" [", Name, "]\n", sep = "") # Univariate or Multivariate Modeling ? if (as.character(object@call[1]) == ".gogarchFit") { # For multivariate Garch Models ... # extract information from first fitted instrument. object@fit[[1]]@fit$params$cond.dist # Conditional Distribution: cat("\nConditional Distribution:\n ") cat(object@fit[[1]]@fit$params$cond.dist, "\n") # Number of Margins: cat("\nNumber of Margins:\n ") cat(length(object@fit), "\n") } else { # For univariate Garch Models ... # Conditional Distribution: cat("\nConditional Distribution:\n ") cat(object@fit$params$cond.dist, "\n") # Coefficients: cat("\nCoefficient(s):\n") digits = max(5, getOption("digits") - 4) print.default(format(object@fit$par, digits = digits), print.gap = 2, quote = FALSE) # Std. Errors: cat("\nStd. Errors:\n ") if (object@fit$params$cond.dist == "QMLE") { cat("robust", "\n") } else { cat("based on Hessian", "\n") } # Error Analysis: digits = max(4, getOption("digits") - 5) fit = object@fit signif.stars = getOption("show.signif.stars") cat("\nError Analysis:\n") printCoefmat(fit$matcoef, digits = digits, signif.stars = signif.stars) # Log Likelihood: cat("\nLog Likelihood:\n ") LLH = - object@fit$value N = NROW(object@data) cat(LLH, " normalized: ", LLH/N, "\n") } # Description: cat("\nDescription:\n ") cat(object@description, "\n") # Return Value: cat("\n") invisible() }) # ------------------------------------------------------------------------------ setMethod(f = "show", signature(object = "fGARCHSPEC"), definition = function(object) { # A function implemented by Diethelm Wuertz # Description: # S4 Print Method for objects of class 'fGARCHSPEC' # Arguments: # object - Object of class 'fGARCHSPEC' # FUNCTION: # Formula: x = object cat("\nFormula: \n ") cat(as.character(x@formula)) # Model: cat("\nModel:") if (sum(abs(x@model$ar)) != 0) cat("\n ar: ", x@model$ar) if (sum(abs(x@model$ma)) != 0) cat("\n ma: ", x@model$ma) if (x@model$mu != 0) cat("\n mu: ", x@model$mu) if (x@model$omega != 0) cat("\n omega:", x@model$omega) if (sum(abs(x@model$alpha)) != 0) cat("\n alpha:", x@model$alpha) if (sum(abs(x@model$gamma)) != 0) cat("\n gamma:", x@model$gamma) if (sum(abs(x@model$beta)) != 0) cat("\n beta: ", x@model$beta) if (x@model$delta != 2) cat("\n delta:", x@model$delta) # Distribution: cat("\nDistribution: \n ") cat(x@distribution) if (x@distribution != "norm") { if (x@distribution == "snorm") { cat("\nDistributional Parameters: \n") cat(" xi =", x@model$skew) } if (x@distribution == "ged" | x@distribution == "std") { cat("\nDistributional Parameter: \n") cat(" nu =", x@model$shape) } if (x@distribution == "sged" | x@distribution == "sstd") { cat("\nDistributional Parameters: \n") cat(" nu =", x@model$shape, " xi =", x@model$skew) } } # Seed: if (x@rseed != 0) { cat("\nRandom Seed: \n ") cat(x@rseed) } # Presample: cat("\nPresample: \n") n = -(length(x@presample[, 1])-1) time = n:0 print(data.frame(cbind(time, x@presample))) # Return Value: invisible() }) ################################################################################ fGarch/R/methods-coef.R0000644000176200001440000000414613202277107014353 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # METHOD: EXTRACTORS: # coef.fGARCH Extracts 'fGarch' Model Coefficients ################################################################################ setMethod(f = "coef", signature(object = "fGARCH"), definition = function(object) { # A function implemented by Diethelm Wuertz # Description: # Extracts 'fGarch' Model Coefficients # Arguments: # object - an object of class fGarch as returned by the function # garchFit # FUNCTION: # Numeric vector of fitted values: ans = slot(object, "fit")$coef # Return Value: ans }) # ------------------------------------------------------------------------------ setMethod(f = "coef", signature(object = "fGARCHSPEC"), definition = function(object) { # A function implemented by Diethelm Wuertz # Description: # Extracts 'fGarch' Model Coefficients # Arguments: # object - an object of class fGarch as returned by the function # garchFit # FUNCTION: # Numeric vector of fitted values: ans = unlist(slot(object, "model")) attr(ans, "distribution") <- slot(object, "distribution") # Return Value: ans }) ################################################################################ fGarch/R/dist-sged.R0000644000176200001440000001452613202277107013664 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # dsged Density for the skewed GED # psged Probability function for the skewed GED # qsged Quantile function for the skewed GED # rsged Random Number Generator for the skewed GED # FUNCTION: DESCRIPTION: # .dsged Internal, density for the skewed GED # .psged Internal, probability function for the skewed GED # .qsged Internal, quantile function for the skewed GED # .rsged Internal, random Number Generator for the skewed GED ################################################################################ dsged <- function(x, mean = 0, sd = 1, nu = 2, xi = 1.5, log = FALSE) { # A function implemented by Diethelm Wuertz # Description: # Compute the density function of the # skewed generalized error distribution # FUNCTION: # Params: if (length(mean) == 4) { xi = mean[4] nu = mean[3] sd = mean[2] mean = mean[1] } # Shift and Scale: result = .dsged(x = (x-mean)/sd, nu = nu, xi = xi) / sd # Log: if(log) result = log(result) # Return Value: result } # ------------------------------------------------------------------------------ psged <- function(q, mean = 0, sd = 1, nu = 2, xi = 1.5) { # A function implemented by Diethelm Wuertz # Description: # Compute the distribution function of the # skewed generalized error distribution # FUNCTION: # Shift and Scale: result = .psged(q = (q-mean)/sd, nu = nu, xi = xi) # Return Value: result } # ------------------------------------------------------------------------------ qsged <- function(p, mean = 0, sd = 1, nu = 2, xi = 1.5) { # A function implemented by Diethelm Wuertz # Description: # Compute the quantile function of the # skewed generalized error distribution # FUNCTION: # Shift and Scale: result = .qsged(p = p, nu = nu, xi = xi) * sd + mean # Return Value: result } # ------------------------------------------------------------------------------ rsged <- function(n, mean = 0, sd = 1, nu = 2, xi = 1.5) { # A function implemented by Diethelm Wuertz # Description: # Generate random deviates from the # skewed generalized error distribution # FUNCTION: # Shift and Scale: result = .rsged(n = n, nu = nu, xi = xi) * sd + mean # Return Value: result } ################################################################################ .dsged <- function(x, nu, xi) { # A function implemented by Diethelm Wuertz # Description: # Internal Function # FUNCTION: # Standardize: lambda = sqrt ( 2^(-2/nu) * gamma(1/nu) / gamma(3/nu) ) g = nu / ( lambda * (2^(1+1/nu)) * gamma(1/nu) ) m1 = 2^(1/nu) * lambda * gamma(2/nu) / gamma(1/nu) mu = m1*(xi-1/xi) sigma = sqrt((1-m1^2)*(xi^2+1/xi^2) + 2*m1^2 - 1) z = x*sigma + mu # Compute: Xi = xi^sign(z) g = 2 / (xi + 1/xi) Density = g * dged(x = z/Xi, nu=nu) # Return Value: Density * sigma } # ------------------------------------------------------------------------------ .psged <- function(q, nu, xi) { # A function implemented by Diethelm Wuertz # Description: # Internal Function # FUNCTION: # Standardize: lambda = sqrt ( 2^(-2/nu) * gamma(1/nu) / gamma(3/nu) ) g = nu / ( lambda * (2^(1+1/nu)) * gamma(1/nu) ) m1 = 2^(1/nu) * lambda * gamma(2/nu) / gamma(1/nu) mu = m1*(xi-1/xi) sigma = sqrt((1-m1^2)*(xi^2+1/xi^2) + 2*m1^2 - 1) z = q*sigma + mu # Compute: Xi = xi^sign(z) g = 2 / (xi + 1/xi) Probability = Heaviside(z) - sign(z) * g * Xi * pged(q = -abs(z)/Xi, nu=nu) # Return Value: Probability } # ------------------------------------------------------------------------------ .qsged <- function(p, nu, xi) { # A function implemented by Diethelm Wuertz # Description: # Internal Function # FUNCTION: # Standardize: lambda = sqrt ( 2^(-2/nu) * gamma(1/nu) / gamma(3/nu) ) g = nu / ( lambda * (2^(1+1/nu)) * gamma(1/nu) ) m1 = 2^(1/nu) * lambda * gamma(2/nu) / gamma(1/nu) mu = m1*(xi-1/xi) sigma = sqrt((1-m1^2)*(xi^2+1/xi^2) + 2*m1^2 - 1) # Compute: g = 2 / (xi + 1/xi) sig = sign(p-1/2) Xi = xi^sig p = (Heaviside(p-1/2)-sig*p) / (g*Xi) Quantile = (-sig*qged(p=p, sd=Xi, nu=nu) - mu ) / sigma # Return Value: Quantile } # ------------------------------------------------------------------------------ .rsged <- function(n, nu, xi) { # A function implemented by Diethelm Wuertz # Description: # Internal Function # FUNCTION: # Generate Random Deviates: weight = xi / (xi + 1/xi) z = runif(n, -weight, 1-weight) Xi = xi^sign(z) Random = -abs(rged(n, nu=nu))/Xi * sign(z) # Scale: lambda = sqrt ( 2^(-2/nu) * gamma(1/nu) / gamma(3/nu) ) g = nu / ( lambda * (2^(1+1/nu)) * gamma(1/nu) ) m1 = 2^(1/nu) * lambda * gamma(2/nu) / gamma(1/nu) mu = m1*(xi-1/xi) sigma = sqrt((1-m1^2)*(xi^2+1/xi^2) + 2*m1^2 - 1) Random = (Random - mu ) / sigma # Return value: Random } ################################################################################ fGarch/R/dist-sstd.R0000644000176200001440000001423613202277107013715 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # dsstd Density for the skewed Student-t Distribution # psstd Probability function for the skewed STD # qsstd Quantile function for the skewed STD # rsstd Random Number Generator for the skewed STD # FUNCTION: DESCRIPTION: # .dsstd Internal, density for the skewed Student-t Distribution # .psstd Internal, probability function for the skewed STD # .qsstd Internal, quantile function for the skewed STD # .rsstd Internal, random Number Generator for the skewed STD ################################################################################ dsstd <- function(x, mean = 0, sd = 1, nu = 5, xi = 1.5, log = FALSE) { # A function implemented by Diethelm Wuertz # Description: # Compute the density function of the # skewed Student-t distribution # FUNCTION: # Params: if (length(mean) == 4) { xi = mean[4] nu = mean[3] sd = mean[2] mean = mean[1] } # Shift and Scale: result = .dsstd(x = (x-mean)/sd, nu = nu, xi = xi) / sd # Log: if(log) result = log(result) # Return Value: result } # ------------------------------------------------------------------------------ psstd <- function(q, mean = 0, sd = 1, nu = 5, xi = 1.5) { # A function implemented by Diethelm Wuertz # Description: # Compute the distribution function of the # skewed Student-t distribution # FUNCTION: # Shift and Scale: result = .psstd(q = (q-mean)/sd, nu = nu, xi = xi) # Return Value: result } # ------------------------------------------------------------------------------ qsstd <- function(p, mean = 0, sd = 1, nu = 5, xi = 1.5) { # A function implemented by Diethelm Wuertz # Description: # Compute the quantile function of the # skewed Student-t distribution # FUNCTION: # Shift and Scale: result = .qsstd(p = p, nu = nu, xi = xi) * sd + mean # Return Value: result } # ------------------------------------------------------------------------------ rsstd <- function(n, mean = 0, sd = 1, nu = 5, xi = 1.5) { # A function implemented by Diethelm Wuertz # Description: # Generate random deviates from the # skewed Student-t distribution # FUNCTION: # Shift and Scale: result = .rsstd(n = n, nu = nu, xi = xi) * sd + mean # Return Value: result } ################################################################################ .dsstd <- function(x, nu, xi) { # A function implemented by Diethelm Wuertz # Description: # Internal Function # FUNCTION: # For SPlus compatibility: if (!exists("beta")) beta <- function (a, b) exp( lgamma(a) + lgamma(b) -lgamma(a+b) ) # Standardize: m1 = 2 * sqrt(nu-2) / (nu-1) / beta(1/2, nu/2) mu = m1*(xi-1/xi) sigma = sqrt((1-m1^2)*(xi^2+1/xi^2) + 2*m1^2 - 1) z = x*sigma + mu # Compute: Xi = xi^sign(z) g = 2 / (xi + 1/xi) Density = g * dstd(x = z/Xi, nu = nu) # Return Value: Density * sigma } # ------------------------------------------------------------------------------ .psstd <- function(q, nu, xi) { # A function implemented by Diethelm Wuertz # Description: # Internal Function # FUNCTION: # For SPlus compatibility: if (!exists("beta")) beta <- function (a, b) exp( lgamma(a) + lgamma(b) -lgamma(a+b) ) # Standardize: m1 = 2 * sqrt(nu-2) / (nu-1) / beta(1/2, nu/2) mu = m1*(xi-1/xi) sigma = sqrt((1-m1^2)*(xi^2+1/xi^2) + 2*m1^2 - 1) z = q*sigma + mu # Compute: Xi = xi^sign(z) g = 2 / (xi + 1/xi) Probability = Heaviside(z) - sign(z) * g * Xi * pstd(q = -abs(z)/Xi, nu = nu) # Return Value: Probability } # ------------------------------------------------------------------------------ .qsstd <- function(p, nu, xi) { # A function implemented by Diethelm Wuertz # Description: # Internal Function # FUNCTION: # For SPlus compatibility: if (!exists("beta")) beta <- function (a, b) exp( lgamma(a) + lgamma(b) -lgamma(a+b) ) # Standardize: m1 = 2 * sqrt(nu-2) / (nu-1) / beta(1/2, nu/2) mu = m1*(xi-1/xi) sigma = sqrt((1-m1^2)*(xi^2+1/xi^2) + 2*m1^2 - 1) # Compute: g = 2 / (xi + 1/xi) sig = sign(p-1/2) Xi = xi^sig p = (Heaviside(p-1/2)-sig*p) / (g*Xi) Quantile = (-sig*qstd(p = p, sd = Xi, nu = nu) - mu ) / sigma # Return Value: Quantile } # ------------------------------------------------------------------------------ .rsstd <- function(n, nu, xi) { # A function implemented by Diethelm Wuertz # Description: # Internal Function # FUNCTION: # For SPlus compatibility: if (!exists("beta")) beta <- function (a, b) exp( lgamma(a) + lgamma(b) -lgamma(a+b) ) # Generate Random Deviates: weight = xi / (xi + 1/xi) z = runif(n, -weight, 1-weight) Xi = xi^sign(z) Random = -abs(rstd(n, nu = nu))/Xi * sign(z) # Scale: m1 = 2 * sqrt(nu-2) / (nu-1) / beta(1/2, nu/2) mu = m1*(xi-1/xi) sigma = sqrt((1-m1^2)*(xi^2+1/xi^2) + 2*m1^2 - 1) Random = (Random - mu ) / sigma # Return value: Random } ################################################################################ fGarch/R/dist-sgedSlider.R0000644000176200001440000000727413202277107015031 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # sgedSlider Displays Generalized Error Distribution and RVS ################################################################################ sgedSlider <- function(type = c("dist", "rand")) { # A function implemented by Diethelm Wuertz # Description: # Displays interactively skew GED distribution # Note: # dsged(x, mean = 0, sd = 1, nu = 5, xi = 1.5) # FUNCTION: # Internal Function: refresh.code = function(...) { # Sliders: N = .sliderMenu(no = 1) mean = .sliderMenu(no = 2) sd = .sliderMenu(no = 3) nu = .sliderMenu(no = 4) xi = .sliderMenu(no = 5) invert = .sliderMenu(no = 6) # Compute Data: if (invert == 1) xi = round(1/xi, digits = 4) xmin = round(qsged(0.01, mean, sd, nu, xi), digits = 2) xmax = round(qsged(0.99, mean, sd, nu, xi), digits = 2) s = seq(xmin, xmax, length = N) y1 = dsged(s, mean, sd, nu, xi) y2 = psged(s, mean, sd, nu, xi) main1 = paste("Skew GED Density\n", "mean = ", as.character(mean), " | ", "sd = ", as.character(sd), " | ", "nu = ", as.character(nu), " | ", "xi = ", as.character(xi) ) main2 = paste("Skew GED Probability\n", "xmin [0.01] = ", as.character(xmin), " | ", "xmax [0.99] = ", as.character(xmax) ) # Random Numbers: if (type[1] == "rand") { x = rsged(N, mean, sd, nu, xi) } # Frame: par(mfrow = c(2, 1), cex = 0.7) # Density: if (type[1] == "rand") { hist(x, probability = TRUE, col = "steelblue", border = "white", breaks = "FD", xlim = c(xmin, xmax), ylim = c(0, 1.1*max(y1)), main = main1 ) lines(s, y1, col = "orange") } else { plot(s, y1, type = "l", xlim = c(xmin, xmax), col = "steelblue") abline (h = 0, lty = 3) title(main = main1) grid() } # Probability: plot(s, y2, type = "l", xlim = c(xmin, xmax), ylim = c(0, 1), col = "steelblue" ) abline (h = 0, lty = 3) title(main = main2) grid() # Frame: par(mfrow = c(1, 1), cex = 0.7) } # Open Slider Menu: .sliderMenu(refresh.code, names = c( "N", "mean", "sd", "nu", "xi", "xi.inv"), minima = c( 10, -5.0, 0.1, 2.1, 1.0, 0 ), maxima = c( 1000, +5.0, 5.0, 10.0, 10.0, 1 ), resolutions = c( 10, 0.1, 0.1, 0.1, 0.1, 1 ), starts = c( 100, 0.0, 1.0, 5.0, 1.0, 0 ) ) } ################################################################################ fGarch/R/class-fGARCH.R0000644000176200001440000000263613202277107014075 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # 'fGARCH' fGARCH Class representation ################################################################################ # Class Representation: setClass("fGARCH", representation( call = "call", formula = "formula", method = "character", data = "numeric", fit = "list", residuals = "numeric", fitted = "numeric", h.t = "numeric", sigma.t = "numeric", title = "character", description = "character") ) ################################################################################ fGarch/R/dist-stdSlider.R0000644000176200001440000000646613202277107014703 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # stdSlider Displays Variance-1 Student-t Distribution and RVS ################################################################################ stdSlider <- function(type = c("dist", "rand")) { # A function implemented by Diethelm Wuertz # Description: # Displays interactively Student-t distribution # Note: # dstd(x, mean = 0, sd = 1, nu = 5) # FUNCTION: # Internal Function: refresh.code = function(...) { # Sliders: N = .sliderMenu(no = 1) mean = .sliderMenu(no = 2) sd = .sliderMenu(no = 3) nu = .sliderMenu(no = 4) # Compute Data: xmin = round(qstd(0.01, mean, sd, nu), digits = 2) xmax = round(qstd(0.99, mean, sd, nu), digits = 2) s = seq(xmin, xmax, length = N) y1 = dstd(s, mean, sd, nu) y2 = pstd(s, mean, sd, nu) main1 = paste("Student-t Density\n", "mean = ", as.character(mean), " | ", "sd = ", as.character(sd), " | ", "nu = ", as.character(nu)) main2 = paste("Student-t Probability\n", "xmin [0.01] = ", as.character(xmin), " | ", "xmax [0.99] = ", as.character(xmax) ) # Random Numbers: if (type[1] == "rand") { x = rstd(N, mean, sd, nu) } # Frame: par(mfrow = c(2, 1), cex = 0.7) # Density: if (type[1] == "rand") { hist(x, probability = TRUE, col = "steelblue", border = "white", breaks = "FD", xlim = c(xmin, xmax), ylim = c(0, 1.1*max(y1)), main = main1 ) lines(s, y1, col = "orange") } else { plot(s, y1, type = "l", xlim = c(xmin, xmax), col = "steelblue") abline (h = 0, lty = 3) title(main = main1) grid() } # Probability: plot(s, y2, type = "l", xlim = c(xmin, xmax), ylim = c(0, 1), col = "steelblue" ) abline (h = 0, lty = 3) title(main = main2) grid() # Frame: par(mfrow = c(1, 1), cex = 0.7) } # Open Slider Menu: .sliderMenu(refresh.code, names = c( "N", "mean", "sd", "nu"), minima = c( 10, -5.0, 0.1, 2.1), maxima = c( 500, +5.0, 5.0, 10.0), resolutions = c( 10, 0.1, 0.1, 0.1), starts = c( 100, 0.0, 1.0, 5.0) ) } ################################################################################ fGarch/R/dist-std.R0000644000176200001440000000604713202277107013533 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # dstd Density for the Student-t Distribution # pstd Probability function for the Student-t Distribution # qstd Quantile function for the Student-t Distribution # rstd Random Number Generator for the Student-t ################################################################################ dstd <- function(x, mean = 0, sd = 1, nu = 5, log = FALSE) { # A function implemented by Diethelm Wuertz # Description: # Compute the density for the # Student-t distribution. # FUNCTION: # Params: if (length(mean) == 3) { nu = mean[3] sd = mean[2] mean = mean[1] } # Compute Density: s = sqrt(nu/(nu-2)) z = (x - mean) / sd result = dt(x = z*s, df = nu) * s / sd # Log: if(log) result = log(result) # Return Value: result } # ------------------------------------------------------------------------------ pstd <- function (q, mean = 0, sd = 1, nu = 5) { # A function implemented by Diethelm Wuertz # Description: # Compute the probability for the # Student-t distribution. # FUNCTION: # Compute Probability: s = sqrt(nu/(nu-2)) z = (q - mean) / sd result = pt(q = z*s, df = nu) # Return Value: result } # ------------------------------------------------------------------------------ qstd <- function (p, mean = 0, sd = 1, nu = 5) { # A function implemented by Diethelm Wuertz # Description: # Compute the quantiles for the # Student-t distribution. # FUNCTION: # Compute Quantiles: s = sqrt(nu/(nu-2)) result = qt(p = p, df = nu) * sd / s + mean # Return Value: result } # ------------------------------------------------------------------------------ rstd <- function(n, mean = 0, sd = 1, nu = 5) { # A function implemented by Diethelm Wuertz # Description: # Generate random deviates from the # Student-t distribution. # FUNCTION: # Generate Random Deviates: s = sqrt(nu/(nu-2)) result = rt(n = n, df = nu) * sd / s + mean # Return Value: result } ################################################################################ fGarch/R/garch-Sim.R0000644000176200001440000001141713202277107013607 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: SIMULATION: # garchSim Simulates a GARCH/APARCH process ################################################################################ garchSim <- function(spec = garchSpec(), n = 100, n.start = 100, extended = FALSE) { # A function implemented by Diethelm Wuertz # Description: # Simulates a time series process from the GARCH family # Arguments: # model - a specification object of class 'fGARCHSPEC' as # returned by the function \code{garchSpec}: # ar - a vector of autoregressive coefficients of # length m for the ARMA specification, # ma - a vector of moving average coefficients of # length n for the ARMA specification, # omega - the variance value for GARCH/APARCH # specification, # alpha - a vector of autoregressive coefficients # of length p for the GARCH/APARCH specification, # gamma - a vector of leverage coefficients of # length p for the APARCH specification, # beta - a vector of moving average coefficients of # length q for the GARCH/APARCH specification, # mu - the intercept for ARMA specification (mean=mu/(1-sum(ar))), # delta - the exponent value used in the variance # equation. # skew - a numeric value for the skew parameter. # shape - a numeric value for the shape parameter. # n - an integer, the length of the series # n.start - the length of the warm-up sequence to reduce the # effect of initial conditions. # FUNCTION: # Specification: stopifnot(class(spec) == "fGARCHSPEC") model = spec@model # Random Seed: if (spec@rseed != 0) set.seed(spec@rseed) # Enlarge Series: n = n + n.start # Create Innovations: if (spec@distribution == "norm") z = rnorm(n) if (spec@distribution == "ged") z = rged(n, nu = model$shape) if (spec@distribution == "std") z = rstd(n, nu = model$shape) if (spec@distribution == "snorm") z = rsnorm(n, xi = model$skew) if (spec@distribution == "sged") z = rsged(n, nu = model$shape, xi = model$skew) if (spec@distribution == "sstd") z = rsstd(n, nu = model$shape, xi = model$skew) # Expand to whole Sample: delta = model$delta z = c(rev(spec@presample[, 1]), z) h = c(rev(spec@presample[, 2]), rep(NA, times = n)) y = c(rev(spec@presample[, 3]), rep(NA, times = n)) m = length(spec@presample[, 1]) names(z) = names(h) = names(y) = NULL # Determine Coefficients: mu = model$mu ar = model$ar ma = model$ma omega = model$omega alpha = model$alpha gamma = model$gamma beta = model$beta deltainv = 1/delta # Determine Orders: order.ar = length(ar) order.ma = length(ma) order.alpha = length(alpha) order.beta = length(beta) # Iterate GARCH / APARCH Model: eps = h^deltainv*z for (i in (m+1):(n+m)) { h[i] = omega + sum(alpha*(abs(eps[i-(1:order.alpha)]) - gamma*(eps[i-(1:order.alpha)]))^delta) + sum(beta*h[i-(1:order.beta)]) eps[i] = h[i]^deltainv * z[i] y[i] = mu + sum(ar*y[i-(1:order.ar)]) + sum(ma*eps[i-(1:order.ma)]) + eps[i] } # Sample: data = cbind( z = z[(m+1):(n+m)], sigma = h[(m+1):(n+m)]^deltainv, y = y[(m+1):(n+m)]) rownames(data) = as.character(1:n) data = data[-(1:n.start),] # Return Values: from <- timeDate(format(Sys.time(), format = "%Y-%m-%d")) - NROW(data)*24*3600 charvec <- timeSequence(from = from, length.out = NROW(data)) ans <- timeSeries(data = data[, c(3,2,1)], charvec = charvec) colnames(ans) <- c("garch", "sigma", "eps") ans <- if (extended) ans else ans[,"garch"] attr(ans, "control") <- list(garchSpec = spec) # Return Value: ans } ################################################################################ fGarch/R/dist-snormFit.R0000644000176200001440000001022413202277107014532 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # .snormFit Fit the parameters for a skew Normal distribution # snormFit Fit the parameters for a skew Normal distribution ################################################################################ .snormFit <- function(x, mean = 0, sd = 1, xi = 1.5, scale = NA, doplot = TRUE, add = FALSE, span = "auto", trace = TRUE, title = NULL, description = NULL, ...) { # A function implemented by Diethelm Wuertz # Description: # Fits parameters of a NIG using maximum log-likelihood # Example: # set.seed(4711); x = rsnorm(500); .snormFit(x)@fit$estimate # FUNCTION: # Settings: dist = dsnorm model = "SNORM Parameter Estimation" scale = "not used" x = x.orig = as.vector(x) # Parameter Estimation: obj = function(x, y = x, trace) { f = try(-sum(log(dist(y, x[1], x[2], x[3]))), silent = TRUE) if (is.na(f) | class(f) == "try-error") return(1e9) # Print Iteration Path: if (trace) { cat("\n Objective Function Value: ", -f) cat("\n Parameter Estimates: ", x, "\n") } f } r = nlminb( start = c(mean = 0, sd = 1, xi = 1.5), objective = obj, lower = c(-Inf, 0, 0), upper = c( Inf, Inf, Inf), y = x, trace = trace) names(r$par) <- c("mean", "sd", "xi") # Add Title and Description: if (is.null(title)) title = model if (is.null(description)) description = description() # Result: fit = list(estimate = r$par, minimum = -r$objective, code = r$convergence) # Optional Plot: if (doplot) { x = as.vector(x.orig) if (span == "auto") span = seq(min(x), max(x), length = 501) z = density(x, n = 100, ...) x = z$x[z$y > 0] y = z$y[z$y > 0] y.points = dist(span, r$par[1], r$par[2], r$par[3]) ylim = log(c(min(y.points), max(y.points))) if (add) { lines(x = span, y = log(y.points), col = "steelblue") } else { plot(x, log(y), xlim = c(span[1], span[length(span)]), ylim = ylim, type = "p", xlab = "x", ylab = "log f(x)", ...) title(main = model) lines(x = span, y = log(y.points), col = "steelblue") } } # Return Value: new("fDISTFIT", call = match.call(), model = model, data = as.data.frame(x.orig), fit = fit, title = title, description = description() ) } # ------------------------------------------------------------------------------ snormFit <- function(x, ...) { # A function implemented by Diethelm Wuertz # Description: # Fit the parameters for a skew Normal distribution # FUNCTION: # Start Value: start = c(mean = mean(x), sd = sqrt(var(x)), xi = 1) # Log-likelihood Function: loglik = function(x, y = x){ f = -sum(log(dsnorm(y, x[1], x[2], x[3]))) f } # Minimization: fit = nlminb( start = start, objective = loglik, lower = c(-Inf, 0, 0), upper = c( Inf, Inf, Inf), y = x, ...) # Add Names to $par names(fit$par) = c("mean", "sd", "xi") # Return Value: fit } ################################################################################ fGarch/R/garch-Stats.R0000644000176200001440000001070413202277107014153 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # garchKappa Computes Expection for APARCH Models # .garchKappaFun Internal function used by garchKappa() # FUNCTION: DESCRIPTION: # .truePersistence Computes true persistence ################################################################################ garchKappa <- function(cond.dist = c("norm", "ged", "std", "snorm", "sged", "sstd", "snig"), gamma = 0, delta = 2, skew = NA, shape = NA) { # A function implemented by Diethelm Wuertz # Description: # Computes Expection for APARCH Models # FUNCTION: # Compute kappa: kappa = integrate(.garchKappaFun, lower = -Inf, upper = Inf, cond.dist = cond.dist[1], gamma = gamma, delta = delta, skew = skew, shape = shape)[[1]] names(kappa) = "kappa" attr(kappa, "control") = c(gamma = gamma, delta = delta, skew = skew, shape = shape) attr(kappa, "cond.dist") = cond.dist[1] # Return Value: kappa } # ------------------------------------------------------------------------------ .garchKappaFun <- function(x, cond.dist = c("norm", "ged", "std", "snorm", "sged", "sstd", "snig"), gamma = 0, delta = 2, skew = NA, shape = NA) { # A function implemented by Diethelm Wuertz # Description: # Internal function used by kappa() # FUNCTION: # Compute Expectation Value for ... funcE = (abs(x) - gamma*x)^delta # Select Appropriate Conditional Density: cond.dist = cond.dist[1] if (cond.dist == "norm") { fun = funcE * dnorm(x) } if (cond.dist == "ged") { fun = funcE * dged(x, nu = shape) } if (cond.dist == "std") { fun = funcE * dstd(x, nu = shape) } if (cond.dist == "snorm") { fun = funcE * dsnorm(x, xi = skew) } if (cond.dist == "sged") { fun = funcE * dsged(x, nu = shape, xi = skew) } if (cond.dist == "sstd") { fun = funcE * dsstd(x, nu = shape, xi = skew) } if (cond.dist == "snig") { fun = funcE * dsnig(x, zeta = shape, rho = skew) } # Return Value: fun } ################################################################################ .truePersistence <- function(fun = "norm", alpha = 1, gamma = 0, beta = 0, delta = 1, ...) { # A function implemented by Diethelm Wuertz # Description: # Computes persistence for an APARCH process # Arguments: # fun - name of density functions of APARCH innovations # alpha, gamma - numeric value or vector of APARCH coefficients, # must be of same length # beta - numeric value or vector of APARCH coefficients # delta - numeric value of APARCH exponent # Note: # fun is one of: norm, snorn, std, sstd, ged, sged, snig # FUNCTION: # Match Density Function: fun = match.fun(fun) # Persisgtence Function: E(|z|-gamma z)^delta e = function(x, gamma, delta, ...) { (abs(x)-gamma*x)^delta * fun(x, ...) } # Compute Persistence by Integration: persistence = sum(beta) for (i in 1:length(alpha)) { I = integrate(e, -Inf, Inf, subdivisions = 1000, rel.tol = .Machine$double.eps^0.5, gamma = gamma[i], delta = delta, ...) persistence = persistence + alpha[i] * I[[1]] } # Warning: if (persistence >= 1) { p = as.character(round(persistence, digits = 3)) warning(paste("Divergent persistence p =", p)) } # Return Value: persistence } ################################################################################ fGarch/R/garch-Distribution.R0000644000176200001440000001327213202277107015537 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # FUNCTION: DESCRIPTION: # .garchSetCondDist Selects conditional density function # .garchDist Defines conditional density function # .normCondDist Normal Distribution # .QMLECondDist QMLE with Normal Distribution # .snormCondDist Skew Normal Distribution # .stdCondDist Student-t Distribution # .sstdCondDist Skew Student-t Distribution # .gedCondDist Generalized Error Distribution # .sgedCondDist Skew Generalized Error Distribution # .snigCondDist Normal Inverse Gaussian Distribution # .setfGarchEnv Set fGarch environment for conditional distribution ################################################################################ .garchSetCondDist <- function(cond.dist = "norm") { # A function implemented by Diethelm Wuertz # Description: # Select Conditional Density Function # Arguments: # cond.dist - a character string with the name of the # conditional distribution function. Valid strings are: # "norm", "snorm", "std", "sstd", "ged", "sged", "snig". # Value: # Returns the selection conditional distribution function # named uniquely '.garchDist'. # Details: # Implemented Distributions: # norm - Normal Distribution: nothing to estimate # snorm - Skew Normal Distribution: xi may be estimated # std - Student-t Distribution: nu may be estimated # sstd - Skew Student-t Distribution: nu and xi may be estimated # ged - Generalized Error Distribution: nu may be estimated # sged - Skew Generalized Error Distribution: nu and xi may be estimated # FUNCTION: # Compose Function: fun = paste(".", cond.dist, "CondDist", sep = "") .garchDist = match.fun(fun) # Trace the Result: if(FALSE) { cat("\n Distribution: ", cond.dist, "\n .garchDist = ") print(.garchDist) } # Return Value: .garchDist } # ------------------------------------------------------------------------------ .normCondDist <- function(z, hh, skew, shape) { # A function implemented by Diethelm Wuertz # FUNCTION: # Normal Distribution: # Use base::dnorm dnorm(x = z/hh, mean = 0, sd = 1) / hh } # ------------------------------------------------------------------------------ .QMLECondDist <- function(z, hh, skew, shape) { # A function implemented by Diethelm Wuertz # FUNCTION: # Normal Distribution: # Use base::dnorm dnorm(x = z/hh, mean = 0, sd = 1) / hh } # ------------------------------------------------------------------------------ .snormCondDist <- function(z, hh, skew, shape) { # A function implemented by Diethelm Wuertz # FUNCTION: # Skew Normal Distribution: # Use fGarch::dsnorm dsnorm(x = z/hh, mean = 0, sd = 1, xi = skew) / hh } # ------------------------------------------------------------------------------ .stdCondDist <- function(z, hh, skew, shape) { # A function implemented by Diethelm Wuertz # FUNCTION: # Standardized Student-t Distribution: # Use fGarch::dstd dstd(x = z/hh, mean = 0, sd = 1, nu = shape) / hh } # ------------------------------------------------------------------------------ .sstdCondDist <- function(z, hh, skew, shape) { # A function implemented by Diethelm Wuertz # FUNCTION: # Skew Standardized Student-t Distribution: # Use fGarch::dsstd dsstd(x = z/hh, mean = 0, sd = 1, nu = shape, xi = skew) / hh } # ------------------------------------------------------------------------------ .gedCondDist <- function(z, hh, skew, shape) { # A function implemented by Diethelm Wuertz # FUNCTION: # Generalized Error Distribution: # Use fGarch::dged dged(x = z/hh, mean = 0, sd = 1, nu = shape) / hh } # ------------------------------------------------------------------------------ .sgedCondDist <- function(z, hh, skew, shape) { # A function implemented by Diethelm Wuertz # FUNCTION: # Skew Generalized Error Distribution: # Use fGarch::dsged dsged(x = z/hh, mean = 0, sd = 1, nu = shape, xi = skew) / hh } # ------------------------------------------------------------------------------ .snigCondDist <- function(z, hh, skew, shape) { # A function implemented by Diethelm Wuertz # FUNCTION: # (Skew) Normal Inverse Gaussian Distribution: # Use fBasics::dsnig dsnig(x = z/hh, zeta = shape, rho = skew) / hh } # ------------------------------------------------------------------------------ .setfGarchEnv(.garchDist = .garchSetCondDist("norm")) ################################################################################ fGarch/R/methods-volatility.R0000644000176200001440000000424313202277107015635 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # METHOD: EXTRACTORS: # volatility.fGARCH Returns conditional volatilities for 'fGARCH' objects ################################################################################ volatility.fGARCH <- ## better to use S3 style because volatility is defined as a S3 generic ## setMethod(f = "volatility", signature(object = "fGARCH"), definition = function(object, type = c("sigma", "h"), ...) { # A function implemented by Diethelm Wuertz # Description: # Returns conditional volatilities for 'fGARCH' objects # Arguments: # object - an object of class 'fGarch' as returned by the function # garchFit # type - a character string denoting if the conditional standard # deviations "sigma" or the variances "h" should be returned. # ... - optional argument to be passed, not used. # Note: # "volatility" is a generic function. It's default method calculates # (x-mean(x))^2. # FUNCTION: # Match Arguments: type = match.arg(type) # Numeric vectors of conditional values: if (type == "sigma") { volatility = slot(object, "sigma.t") } else if (type == "h") { volatility = slot(object, "h.t") } attr(volatility, "type") <- type # Return Value: volatility } ##) ################################################################################ fGarch/R/zzz.R0000644000176200001440000000316113202300207012613 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ############################################################################### .onAttach <- function(libname, pkgname) { # do whatever needs to be done when the package is loaded # some people use it to bombard users with # messages using # packageStartupMessage( "\n" ) # packageStartupMessage( "Rmetrics Package fGarch" ) # packageStartupMessage( "Modelling Autoregressive Conditional Heteroskedasticity" ) # packageStartupMessage( "Copyright (C) 2005-2014 Rmetrics Association Zurich" ) # packageStartupMessage( "Educational Software for Financial Engineering and Computational Science" ) # packageStartupMessage( "Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY." ) # packageStartupMessage( "https://www.rmetrics.org --- Mail to: info@rmetrics.org" ) } ############################################################################### fGarch/R/methods-update.R0000644000176200001440000000431613202277107014720 0ustar liggesusers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU Library General # Public License along with this library; if not, write to the # Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA ################################################################################ # METHOD: EXTRACTORS: # update,fGARCHSPEC Update Methods # update,fGARCH Update Methods ################################################################################ setMethod("update", "fGARCHSPEC", function(object, ... ) { # A function implemented by Yohan Chalabi # Description: # # Example: # # # FUNCTION: call <- object@call extras <- match.call(expand.dots = FALSE)$... if (length(extras)) { existing <- !is.na(match(names(extras), names(call))) for (a in names(extras)[existing]) call[[a]] <- extras[[a]] if (any(!existing)) { call <- c(as.list(call), extras[!existing]) call <- as.call(call) } } eval(call, parent.frame()) }) # ----------------------------------------------------------------------------- setMethod("update", "fGARCH", function(object, ... ) { # A function implemented by Yohan Chalabi # Description: # # Example: # # # FUNCTION: call <- object@call extras <- match.call(expand.dots = FALSE)$... if (length(extras)) { existing <- !is.na(match(names(extras), names(call))) for (a in names(extras)[existing]) call[[a]] <- extras[[a]] if (any(!existing)) { call <- c(as.list(call), extras[!existing]) call <- as.call(call) } } eval(call, parent.frame()) }) fGarch/MD50000644000176200001440000001405713203412756011766 0ustar liggesusers8ddf42e368503fb9cb47500e2e44adab *ChangeLog 5a59675a293129c9476b3070c1c0825b *DESCRIPTION 40e262af2a2fe8ae321eae5b8fe244c6 *NAMESPACE c7a13a689bb6a905b6bbd9d191c7f0df *R/class-fGARCH.R 0eb2fa2612486d6e24b7ca89f27003c2 *R/class-fGARCHSPEC.R d53cb36b9fc1fbeb20a7fafd7aa9f0b5 *R/dist-absMoments.R 7b40285ba3f868b015ff905335f6d1df *R/dist-ged.R ccb808524bee2242b04a87cadbce8e29 *R/dist-gedFit.R d35be82ca2b203f6e3ecb0678d6f2fb1 *R/dist-gedSlider.R 2f4262b26b69462ad68826bbc6ad1926 *R/dist-sged.R 95584c9a0e38c2c1965139f202aecdc6 *R/dist-sgedFit.R f4b5d342a48c57b36f4a98a08f637e56 *R/dist-sgedSlider.R 86a3ec0c1a8be8e7c8835d380697056a *R/dist-snorm.R 10382aeb852b464f0c6518e461de773f *R/dist-snormFit.R 0c71233088546c742adfa6de041994d1 *R/dist-snormSlider.R 3745c73f7cf7ee7c9ab8392fd5ae2e77 *R/dist-sstd.R 81f06f626774aa9a7e09bd6038dfebb5 *R/dist-sstdFit.R 7e19de8d0b578ea3171bc050fd81784a *R/dist-sstdSlider.R 97fbe5d8149c1a0ff7cca075826c4c5f *R/dist-std.R add658ea5bb8e70363b1afd776ecae49 *R/dist-stdFit.R d06897dd68e8f25e9678913e4bd4fa90 *R/dist-stdSlider.R 224624b554b51119fc6e56b3d489277c *R/fGarch-package.R 9741bff5bd063d83445d8457cbfb9f28 *R/fGarchEnv.R 049762f686f27bcb47b7838830e277d1 *R/garch-Distribution.R 43acfba77ee802200dd409809ad3a32f *R/garch-FitFromFormula.R b95de1c14a197e1ca0154300fe2ced7a *R/garch-FitFromSpec.R 7229c9a6a796cef089e5bf489ac43570 *R/garch-FitInternal.R fff4d1f43e02a27c8dbb7f3a878158a7 *R/garch-GlobalVars.R 9556d8f69fddef06228e47462fbe19ea *R/garch-Gradient.R 70ee5a606543a83a4d0a87e54dcbb41d *R/garch-Hessian.R e1b1fa3c676e0da11af6333cdaba9361 *R/garch-Initialization.R 8c5b3f6e5fc38d84c5960c57bddd5ac4 *R/garch-Sim.R d02bb65ed394232775cc7a65bec1c7a3 *R/garch-Solver.R effee1524457176e544a4159f06f9e65 *R/garch-SolverControl.R cdf7d994bb67c2c35e6f571e731daf48 *R/garch-Spec.R b4c216db11d187be7b33a1b9208abcb5 *R/garch-Stats.R a0af43ada8cf98ae21ff931574f48317 *R/loglik-aparch.R 85dbb41d543618dd30d9b0514794a3b0 *R/loglik-egarch.R b70ab1c76855204cac6a878bc7c561f2 *R/loglik.R 39efcefff0257a13ba13c2807d1c0b6c *R/methods-coef.R c96b4ee7ae023be36581ff7a27ce50f9 *R/methods-fitted.R 7f19cf78ce22bbab0b2322e96def3b39 *R/methods-formula.R fd9a4a9bea168c7e37df25deb8efae28 *R/methods-plot.R 578a3adf72204cdb6d41e25cbde0373e *R/methods-predict.R c46ae3e7eb3ca4eaffbf35b6be00ab35 *R/methods-residuals.R 332ad409cd0a8c3cac3ad482a53f4f32 *R/methods-show.R c70f026e5bcd8c423e95fc44961fe7fb *R/methods-summary.R 2a8962e41ed5a4de63d2fe649a9e12e3 *R/methods-update.R 1b223cf816ecee7b9fe1d26245fe9baa *R/methods-volatility.R 8da3513457c3bc1ac9d1edd0ef14d5c1 *R/mgarch-FitFromFormula.R ffa21c2bbe8da31f47d9a7b89bf7b61b *R/zzz.R 546b76b0202b84b735595992648ae3ea *data/dem2gbp.csv e5b90a876ee62efb665b30b250b5c60e *data/sp500dge.csv 70a0d93bc75a19be75bdab2f50fc48a0 *inst/THANKS 665e719c6c9360340268b2e6ac891515 *inst/unitTests/Makefile 6daf0e9de9a62ce7c24edd2e9cd2f7e1 *inst/unitTests/runTests.R 77ca4128e3983914e025103aa5036d80 *inst/unitTests/runit.formula-methods.R 34ce038d4e5a9b92efb5c01751078296 *inst/unitTests/runit.garch-methods.R 399380b12580d5aa2ca902919a4b9537 *inst/unitTests/runit.garchFit.R 1bbc596063ca7584964b89c23608cb83 *inst/unitTests/runit.garchFit.algorithm.R 6fd3d951a8fdebf579836babd064f714 *inst/unitTests/runit.garchFit.aparch.R e2e025242284f7379f314d39fe81e7ef *inst/unitTests/runit.garchFit.dist.R 285aaeac4df0f40f1e4a600af1924afa *inst/unitTests/runit.garchFit.faked.R b3764d2f99905a0c9d787c1f79484742 *inst/unitTests/runit.garchFit.garch.R cc8a22d3718b70390d1ad14e36e4ac11 *inst/unitTests/runit.garchFit.init.R 1807810452bb1abf15dd3ea36eedb5d8 *inst/unitTests/runit.garchHessian.R 0cd0ecf3aebbea146c02c31b3f517af1 *inst/unitTests/runit.garchSim.R 9fd027295b05fa559e7db79b2cb01be0 *inst/unitTests/runit.garchSolver.R d0df67b7fcd6fd58444049b69c29c2ec *inst/unitTests/runit.garchSpec.R 2db651c11a011446c606514d5022edbc *inst/unitTests/runit.plot-methods.R afeb0877a73a8b55095082caca3a9f40 *inst/unitTests/runit.predict-methods.R 027c502c4b2fd05f0d7a34a5f28a350a *inst/unitTests/runit.sged.R d03a2e8ca1f24c8d04dcb441d46c2694 *inst/unitTests/runit.snorm.R a5e6fc9d1dd9aff86220e2f674eda459 *inst/unitTests/runit.sstd.R d8c081c707121c5065bbf74fd17516dd *man/00fGarch-package.Rd f1df87fa10c973d2654cd6f8a1728dc1 *man/class-fGARCH.Rd 125ed9a7cad0ba5c5fb6b0b3aa143c5d *man/class-fGARCHSPEC.Rd 8319b3d1b871d1b876eddc5ca2ec7615 *man/data.Rd 76064039fae0c174a1962058d8a4ad78 *man/dist-absMoments.Rd 6b3c330084118c675f7277d6581379d0 *man/dist-ged.Rd 11745da022f78f994ea2c98b5efc979a *man/dist-gedFit.Rd 9911d25ccfa47537f45a74aed5190666 *man/dist-gedSlider.Rd 921778e7aad98dac8a953ba8593f54fd *man/dist-sged.Rd eeb045af4fee08cb77d8f0551c43988c *man/dist-sgedFit.Rd a4bf00ceef8cedb28b9011ed38f7d80b *man/dist-sgedSlider.Rd 34812552c00ce51d33306f19d18a1533 *man/dist-snorm.Rd f5c0350a45800aa2e1e5867dabcd6277 *man/dist-snormFit.Rd 4f46b025d2b8da80b04cad646afac529 *man/dist-snormSlider.Rd d99215fa2ffc6821d630462a3cccbca0 *man/dist-sstd.Rd d1ed90d33be97640a9afc984256bb0bf *man/dist-sstdFit.Rd 61984e15bd5340fb3b519064ef0ad0d6 *man/dist-sstdSlider.Rd 185f16a210c121a46c3f8ab31e5274e0 *man/dist-std.Rd 6388f5b29675e60cf7f2071d88ddd142 *man/dist-stdFit.Rd 0127c8854cbe9dbea33978c02f06d689 *man/dist-stdSlider.Rd d3318208a34a454113cd1db9c721ef95 *man/garchFit.Rd 8b341b0c56c5903531b3492115ce2647 *man/garchFitControl.Rd 9a8625ab45743b198f0cadfb51f54f38 *man/garchSim.Rd 0565d8a39f2cc19856ab7a7d158fb18b *man/garchSpec.Rd 4a3d3fdf0f2b9828639bbf8fda86240b *man/methods-coef.Rd 437a5143241abaceff1a9bc446e54e5e *man/methods-fitted.Rd 7184cdd72049c0bd39bfd7ed621a1276 *man/methods-formula.Rd 1bff636eac58d145cb4a73109198df68 *man/methods-plot.Rd bc2a140936817c8fefc8517f66b9b953 *man/methods-predict.Rd e585f179940bc17c4b15e0c46024cc65 *man/methods-residuals.Rd 5b2f04e08dc58078f6a167d9d79525fb *man/methods-show.Rd 66cadde8ef0a5bc7d64a7da424685692 *man/methods-summary.Rd 8d55ce40351bd0de5474d8ddc710cf47 *man/methods-volatility.Rd 3996e7c16bfb96fad295ee425815cb4d *src/Makevars dd6d06f2cbf677b8adad564612b25dc9 *src/dist.f 4b98f5d08a5afa0dac518fadc2eea3e6 *src/llhGarch.f bd80962899be270e2000e67b9687f536 *src/math.f ca566e590ec30abd0718c5375e1a446f *tests/doRUnit.R fGarch/DESCRIPTION0000644000176200001440000000141213203412756013153 0ustar liggesusersPackage: fGarch Title: Rmetrics - Autoregressive Conditional Heteroskedastic Modelling Date: 2017-11-12 Version: 3042.83 Author: Diethelm Wuertz [aut], Tobias Setz [cre], Yohan Chalabi [ctb], Chris Boudt [ctb], Pierre Chausse [ctb], Michal Miklovac [ctb] Maintainer: Tobias Setz Description: Provides a collection of functions to analyze and model heteroskedastic behavior in financial time series models. Depends: R (>= 2.15.1), timeDate, timeSeries, fBasics Imports: fastICA, Matrix, graphics, methods, stats, utils Suggests: RUnit, tcltk LazyData: yes License: GPL (>= 2) URL: https://www.rmetrics.org NeedsCompilation: yes Packaged: 2017-11-16 17:28:34 UTC; Tobias Setz Repository: CRAN Date/Publication: 2017-11-16 22:49:18 UTC fGarch/ChangeLog0000644000176200001440000001433012212357006013215 0ustar liggesusers2013-04-30 chalabi * DESCRIPTION, R/zzz.R, src/llhGarch.f: fix array bound warning in Fortran code 2012-09-18 chalabi * ChangeLog, DESCRIPTION: Updated ChangeLog and DESC files. * DESCRIPTION: Changed maintainer field to comply with the new CRAN policy. * inst/unitTests/runit.garchSolver.R: Removed superfluous unitTest. * NAMESPACE, R/loglik-aparch.R: Removed .filter2() to avoid external .Call calls. 2012-06-04 chalabi * R/garch-Hessian.R, inst/unitTests/runit.garchSolver.R: using now optimHess to calculate the Hessian * ChangeLog, DESCRIPTION: updated DESCRIPTION and ChangeLog files * DESCRIPTION, R/garch-Hessian.R: using now optimHess to calculate the Hessian 2011-09-23 mmaechler * DESCRIPTION: remove deprecated "LazyLoad" entry 2010-10-26 chalabi * NAMESPACE: updated NAMESPACE 2010-07-23 chalabi * inst/DocCopying.pdf: removed DocCopying.pdf license is already specified in DESCRIPTION file 2010-04-14 chalabi * NAMESPACE: updated NAMESPACE 2009-12-08 wuertz * inst/unitTests/runit.snorm.R: norm test obsolete * NAMESPACE, R/absMoments.R, R/dist-norm.R, R/dist-normFit.R, R/dist-snig.R, R/dist-snigFit.R, R/dist-stdSlider.R, man/absMoments.Rd, man/dist-absMoments.Rd, man/dist-ged.Rd, man/dist-gedFit.Rd, man/dist-gedSlider.Rd, man/dist-sged.Rd, man/dist-sgedFit.Rd, man/dist-sgedSlider.Rd, man/dist-snorm.Rd, man/dist-snormFit.Rd, man/dist-snormSlider.Rd, man/dist-sstd.Rd, man/dist-sstdFit.Rd, man/dist-sstdSlider.Rd, man/dist-std.Rd, man/dist-stdFit.Rd, man/dist-stdSlider.Rd: distribution functions updated * R/dist-stdSlider.R: stdslider added 2009-12-07 wuertz * R/dist-absMoments.R, R/dist-ged.R, R/dist-gedFit.R, R/dist-gedSlider.R, R/dist-norm.R, R/dist-normFit.R, R/dist-sged.R, R/dist-sgedFit.R, R/dist-sgedSlider.R, R/dist-snig.R, R/dist-snigFit.R, R/dist-snorm.R, R/dist-snormFit.R, R/dist-snormSlider.R, R/dist-sstd.R, R/dist-sstdFit.R, R/dist-sstdSlider.R, R/dist-std.R, R/dist-stdFit.R: distribution functions updated * man/dist-ged.Rd, man/dist-gedFit.Rd, man/dist-gedSlider.Rd, man/dist-sged.Rd, man/dist-sgedFit.Rd, man/dist-sgedSlider.Rd, man/dist-snorm.Rd, man/dist-sstd.Rd, man/sged.Rd, man/snorm.Rd, man/sstd.Rd: man pages updated 2009-11-09 chalabi * DESCRIPTION: updated version number * ChangeLog, DESCRIPTION: updated DESC and Changelog file 2009-11-05 chalabi * R/methods-predict.R: small changes in predict,fGARCH-method to correct its output when n.ahead=1 since addition of conditional errors. 2009-09-28 chalabi * DESCRIPTION: updated version number * ChangeLog, DESCRIPTION: updated DESCR and ChangeLog 2009-08-21 wuertz * DESCRIPTION, NAMESPACE, R/methods-plot.R, R/methods-show.R, R/mgarch-FitFromFormula.R: .gogarchFit function added, show and plot adapted, NAMESPACE and DESCRIPTION updated * R/methods-plot.R: Merge branch 'devel-fGarch' * man/methods-predict.Rd: cosmetic changes in help page * NAMESPACE: new NAMESPACE structure which should ease maintenance of packages. 2009-06-25 chalabi * DESCRIPTION, NAMESPACE: Merge branch 'devel-timeSeries' Conflicts: pkg/timeSeries/R/base-Extract.R pkg/timeSeries/R/timeSeries.R 2009-05-21 wuertz * NAMESPACE, R/garch-Distribution.R, R/garch-FitFromFormula.R, R/garch-FitFromSpec.R, R/garch-FitInternal.R, R/garch-LogLik.R, R/loglik-aparch.R, R/loglik-egarch.R, R/loglik.R, man/garchFit.Rd: working on new specification * DESCRIPTION, R/garch-Distribution.R, R/garch-FitFromFormula.R, R/garch-FitInternal.R, R/garch-Hessian.R, R/garch-LogLik.R, R/garch-Solver.R, man/garchFit.Rd: different recursion methods added, new method to calculate hessian added * R/garch-FitInternal.R, R/garch-LogLik.R: LLH function disentangled in shorter parts 2009-05-20 wuertz * R/garch-FitFromFormula.R, R/garch-FitFromSpec.R, R/garch-FitInternal.R: alternative garchFit interface (still hidden) now runs * NAMESPACE, R/fGarchEnv.R, R/garch-FitFromFormula.R: NAMESPACE updated * R/garch-FitFormula.R, R/garch-FitFromFormula.R, R/garch-FitInternal.R: R scripts disentangled and renamed * R/garch-FitFromFormula.R: script file renamed * R/garch-Fit.R, R/garch-FitControl.R, R/garch-FitFormula.R, R/garch-FitFromSpec.R, R/garch-FitInternal.R, R/garch-GlobalVars.R, R/garch-SolverControl.R: new interface for garchFit added, spec() based * NAMESPACE, R/garch-Distribution.R, R/garch-LogLik.R: some smaller fixes and NAMESPACE adapted * R/garch-Fit.R, R/garch-LogLik.R: garchLogLIk disentangled from script file garch-Fit.R * R/garch-Distribution.R, R/garch-Fit.R, R/garch-Initialization.R: Initialization disentangled from garch-Fit script file * R/dist-sged.R, R/dist-snig.R, R/dist-snorm.R, R/dist-sstd.R, R/garch-Distribution.R, R/garch-Fit.R, R/garch-FitControl.R, R/garch-Gradient.R, R/garch-Hessian.R, R/garch-Sim.R, R/garch-Solver.R, R/garch-Spec.R, R/garch-Stats.R, R/garchFit.R, R/garchFitControl.R, R/garchGradient.R, R/garchHessian.R, R/garchSim.R, R/garchSolver.R, R/garchSpec.R, R/garchStats.R, R/sged.R, R/snorm.R, R/sstd.R: script file renamed and disentangled 2009-05-15 chaussep * R/methods-predict.R, man/methods-predict.Rd: added a plot option to predict and adapted the manual 2009-05-15 chalabi * DESCRIPTION: added Pierre Chausse in DESC file for contribution 2009-05-14 chaussep * R/garchSim.R, man/garchSim.Rd: Just changed the definition of mu. It is the intercept, not the mean * R/methods-predict.R, man/methods-predict.Rd: Added conditional errors to predict and updated nthe manual 2009-04-19 chalabi * DESCRIPTION: added explicit version number in Depends field for key packages 2009-04-02 chalabi * DESCRIPTION: more explicit depends and suggests field in DESC file. 2009-04-01 chalabi * DESCRIPTION: updated DESC file 2009-01-30 chalabi * R/garchSpec.R: 2009-01-28 chalabi * DESCRIPTION: updated version number * DESCRIPTION: changed version number to match version on CRAN + 1 2009-01-12 chalabi * NAMESPACE, R/methods-update.R, man/class-fGARCH.Rd, man/class-fGARCHSPEC.Rd: added update method for fGARCH and fGARCHSPEC object 2009-01-07 chalabi * src/dist.f: fixed conditional distribution thanks to comments of Michal Miklovic. fGarch/man/0000755000176200001440000000000013202277107012220 5ustar liggesusersfGarch/man/methods-show.Rd0000644000176200001440000000151313202277106015127 0ustar liggesusers\name{show-methods} \docType{methods} \alias{show-methods} \alias{show,ANY-method} \alias{show,fGARCH-method} \alias{show,fGARCHSPEC-method} \title{GARCH Modelling Show Methods} \description{ Show methods for GARCH Modelling. } \section{Methods}{ \describe{ \item{object = "ANY"}{ Generic function. } \item{object = "fGARCH"}{ Print function for objects of class \code{"fGARCH"}. } \item{object = "fGARCHSPEC"}{ Print function for objects of class \code{"fGARCH"}. } } } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## garchSpec - spec = garchSpec() print(spec) ## garchSim - x = garchSim(spec, n = 500) ## garchFit - fit = garchFit(~ garch(1, 1), data = x) print(fit) } \keyword{models} fGarch/man/dist-sgedFit.Rd0000644000176200001440000000312413202277106015034 0ustar liggesusers\name{sgedFit} \alias{sgedFit} \title{Skew Generalized Error Distribution Parameter Estimation} \description{ Function to fit the parameters of the skew generalized error distribution. } \usage{ sgedFit(x, \dots) } \arguments{ \item{x}{ a numeric vector of quantiles. } \item{\dots}{ parameters parsed to the optimization function \code{nlm}. } } \value{ \code{sgedFit} returns a list with the following components: \cr \item{par}{ The best set of parameters found. } \item{objective}{ The value of objective corresponding to \code{par}. } \item{convergence}{ An integer code. 0 indicates successful convergence. } \item{message}{ A character string giving any additional information returned by the optimizer, or NULL. For details, see PORT documentation. } \item{iterations}{ Number of iterations performed. } \item{evaluations}{ Number of objective function and gradient function evaluations. } } \references{ Nelson D.B. (1991); \emph{Conditional Heteroscedasticity in Asset Returns: A New Approach}, Econometrica, 59, 347--370. Fernandez C., Steel M.F.J. (2000); \emph{On Bayesian Modelling of Fat Tails and Skewness}, Preprint, 31 pages. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## rsged - set.seed(1953) r = rsged(n = 1000) ## sgedFit - sgedFit(r) } \keyword{distribution} fGarch/man/dist-stdFit.Rd0000644000176200001440000000265613202277106014715 0ustar liggesusers\name{stdFit} \alias{stdFit} \title{Student-t Distribution Parameter Estimation} \description{ Function to fit the parameters of the Student-t distribution. } \usage{ stdFit(x, \dots) } \arguments{ \item{x}{ a numeric vector of quantiles. } \item{\dots}{ parameters parsed to the optimization function \code{nlm}. } } \value{ \code{stdFit} returns a list with the following components: \cr \item{par}{ The best set of parameters found. } \item{objective}{ The value of objective corresponding to \code{par}. } \item{convergence}{ An integer code. 0 indicates successful convergence. } \item{message}{ A character string giving any additional information returned by the optimizer, or NULL. For details, see PORT documentation. } \item{iterations}{ Number of iterations performed. } \item{evaluations}{ Number of objective function and gradient function evaluations. } } \references{ Fernandez C., Steel M.F.J. (2000); \emph{On Bayesian Modelling of Fat Tails and Skewness}, Preprint, 31 pages. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## std - set.seed(1953) r = rstd(n = 1000) ## stdFit - stdFit(r) } \keyword{distribution} fGarch/man/methods-summary.Rd0000644000176200001440000000602313202277106015645 0ustar liggesusers\name{summary-methods} \docType{methods} \alias{summary-methods} \alias{summary,ANY-method} \alias{summary,fGARCH-method} \title{GARCH Summary Methods} \description{ Summary methods for GARCH Modelling. } \section{Methods}{ \describe{ \item{object = "ANY"}{ Generic function } \item{object = "fGARCH"}{ Summary function for objects of class \code{"fGARCH"}. } } } \section{How to read a diagnostic summary report?}{ The first five sections return the title, the call, the mean and variance formula, the conditional distribution and the type of standard errors: \preformatted{ Title: GARCH Modelling Call: garchFit(~ garch(1, 1), data = garchSim(), trace = FALSE) Mean and Variance Equation: ~arch(0) Conditional Distribution: norm Std. Errors: based on Hessian } The next three sections return the estimated coefficients, and an error analysis including standard errors, t values, and probabilities, as well as the log Likelihood values from optimization: \preformatted{ Coefficient(s): mu omega alpha1 beta1 -5.79788e-05 7.93017e-06 1.59456e-01 2.30772e-01 Error Analysis: Estimate Std. Error t value Pr(>|t|) mu -5.798e-05 2.582e-04 -0.225 0.822 omega 7.930e-06 5.309e-06 1.494 0.135 alpha1 1.595e-01 1.026e-01 1.554 0.120 beta1 2.308e-01 4.203e-01 0.549 0.583 Log Likelihood: -843.3991 normalized: -Inf } The next section provides results on standardized residuals tests, including statistic and p values, and on information criterion statistic including AIC, BIC, SIC, and HQIC: \preformatted{ Standardized Residuals Tests: Statistic p-Value Jarque-Bera Test R Chi^2 0.4172129 0.8117146 Shapiro-Wilk Test R W 0.9957817 0.8566985 Ljung-Box Test R Q(10) 13.05581 0.2205680 Ljung-Box Test R Q(15) 14.40879 0.4947788 Ljung-Box Test R Q(20) 38.15456 0.008478302 Ljung-Box Test R^2 Q(10) 7.619134 0.6659837 Ljung-Box Test R^2 Q(15) 13.89721 0.5333388 Ljung-Box Test R^2 Q(20) 15.61716 0.7400728 LM Arch Test R TR^2 7.049963 0.8542942 Information Criterion Statistics: AIC BIC SIC HQIC 8.473991 8.539957 8.473212 8.500687 } } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## garchSim - x = garchSim(n = 200) ## garchFit - fit = garchFit(formula = x ~ garch(1, 1), data = x, trace = FALSE) summary(fit) } \keyword{models} fGarch/man/dist-gedSlider.Rd0000644000176200001440000000177613202277106015364 0ustar liggesusers\name{gedSlider} \alias{gedSlider} \title{Geeneralized Error Distribution Slider} \description{ Displays interactively the dependence of the GED distribution on its parameters. } \usage{ gedSlider(type = c("dist", "rand")) } \arguments{ \item{type}{ a character string denoting which interactive plot should be displayed. Either a distribution plot \code{type="dist"}, the default value, or a random variates plot, \code{type="rand"}. } } \value{ a Tcl object. } \references{ Nelson D.B. (1991); \emph{Conditional Heteroscedasticity in Asset Returns: A New Approach}, Econometrica, 59, 347--370. Fernandez C., Steel M.F.J. (2000); \emph{On Bayesian Modelling of Fat Tails and Skewness}, Preprint, 31 pages. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ \dontrun{ ## gedSlider - require(tcltk) gedSlider("dist") gedSlider("rand") } } \keyword{distribution} fGarch/man/dist-ged.Rd0000644000176200001440000000415513202277106014213 0ustar liggesusers\name{ged} \alias{ged} \alias{dged} \alias{pged} \alias{qged} \alias{rged} \title{Generalized Error Distribution} \description{ Functions to compute density, distribution function, quantile function and to generate random variates for the generalized error distribution. } \usage{ dged(x, mean = 0, sd = 1, nu = 2, log = FALSE) pged(q, mean = 0, sd = 1, nu = 2) qged(p, mean = 0, sd = 1, nu = 2) rged(n, mean = 0, sd = 1, nu = 2) } \arguments{ \item{mean, sd, nu}{ location parameter \code{mean}, scale parameter \code{sd}, shape parameter \code{nu}. } \item{n}{ the number of observations. } \item{p}{ a numeric vector of probabilities. } \item{x, q}{ a numeric vector of quantiles. } \item{log}{ a logical; if TRUE, densities are given as log densities. } } \value{ \code{d*} returns the density, \code{p*} returns the distribution function, \code{q*} returns the quantile function, and \code{r*} generates random deviates, \cr all values are numeric vectors. } \references{ Nelson D.B. (1991); \emph{Conditional Heteroscedasticity in Asset Returns: A New Approach}, Econometrica, 59, 347--370. Fernandez C., Steel M.F.J. (2000); \emph{On Bayesian Modelling of Fat Tails and Skewness}, Preprint, 31 pages. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## sged - par(mfrow = c(2, 2)) set.seed(1953) r = rsged(n = 1000) plot(r, type = "l", main = "sged", col = "steelblue") # Plot empirical density and compare with true density: hist(r, n = 25, probability = TRUE, border = "white", col = "steelblue") box() x = seq(min(r), max(r), length = 201) lines(x, dsged(x), lwd = 2) # Plot df and compare with true df: plot(sort(r), (1:1000/1000), main = "Probability", col = "steelblue", ylab = "Probability") lines(x, psged(x), lwd = 2) # Compute quantiles: round(qsged(psged(q = seq(-1, 5, by = 1))), digits = 6) } \keyword{distribution} fGarch/man/dist-snormFit.Rd0000644000176200001440000000270313202277106015252 0ustar liggesusers\name{snormFit} \alias{snormFit} \title{Skew Normal Distribution Parameter Estimation} \description{ Function to fit the parameters of the skew normal distribution. } \usage{ snormFit(x, \dots) } \arguments{ \item{x}{ a numeric vector of quantiles. } \item{\dots}{ parameters parsed to the optimization function \code{nlm}. } } \value{ \code{snormFit} returns a list with the following components: \cr \item{par}{ The best set of parameters found. } \item{objective}{ The value of objective corresponding to \code{par}. } \item{convergence}{ An integer code. 0 indicates successful convergence. } \item{message}{ A character string giving any additional information returned by the optimizer, or NULL. For details, see PORT documentation. } \item{iterations}{ Number of iterations performed. } \item{evaluations}{ Number of objective function and gradient function evaluations. } } \references{ Fernandez C., Steel M.F.J. (2000); \emph{On Bayesian Modelling of Fat Tails and Skewness}, Preprint, 31 pages. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## rsnorm - set.seed(1953) r = rsnorm(n = 1000) ## snormFit - snormFit(r) } \keyword{distribution} fGarch/man/methods-coef.Rd0000644000176200001440000000223613202277106015066 0ustar liggesusers\name{coef-methods} \docType{methods} \alias{coef-methods} \alias{coef,ANY-method} \alias{coef,fGARCH-method} \alias{coef,fGARCHSPEC-method} \title{GARCH Coefficients Methods} \description{ Coefficients methods for GARCH Modelling. } \section{Methods}{ \describe{ \item{object = "ANY"}{ Generic function. } \item{object = "fGARCH"}{ Extractor function for coefficients from a fitted GARCH model. } \item{object = "fGARCHSPEC"}{ Extractor function for coefficients from a GARCH specification structure. } } } \note{ \code{coef} is a generic function which extracts coefficients from objects returned by modeling functions. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## garchSpec - # Use default parameters beside alpha: spec = garchSpec(model = list(alpha = c(0.05, 0.05))) spec coef(spec) ## garchSim - # Simulate an univariate "timeSeries" series x = garchSim(spec, n = 200) x = x[,1] ## garchFit - fit = garchFit( ~ garch(1, 1), data = x) ## coef - coef(fit) } \keyword{models} fGarch/man/garchFitControl.Rd0000644000176200001440000001762413202277106015610 0ustar liggesusers\name{garchFitControl} \alias{garchFitControl} \title{GARCH Fitting Algorithms and Control} \description{ Estimates the parameters of an univariate GARCH process. } \usage{ garchFitControl( llh = c("filter", "internal", "testing"), nlminb.eval.max = 2000, nlminb.iter.max = 1500, nlminb.abs.tol = 1.0e-20, nlminb.rel.tol = 1.0e-14, nlminb.x.tol = 1.0e-14, nlminb.step.min = 2.2e-14, nlminb.scale = 1, nlminb.fscale = FALSE, nlminb.xscale = FALSE, sqp.mit = 200, sqp.mfv = 500, sqp.met = 2, sqp.mec = 2, sqp.mer = 1, sqp.mes = 4, sqp.xmax = 1.0e3, sqp.tolx = 1.0e-16, sqp.tolc = 1.0e-6, sqp.tolg = 1.0e-6, sqp.told = 1.0e-6, sqp.tols = 1.0e-4, sqp.rpf = 1.0e-4, lbfgsb.REPORT = 10, lbfgsb.lmm = 20, lbfgsb.pgtol = 1e-14, lbfgsb.factr = 1, lbfgsb.fnscale = FALSE, lbfgsb.parscale = FALSE, nm.ndeps = 1e-14, nm.maxit = 10000, nm.abstol = 1e-14, nm.reltol = 1e-14, nm.alpha = 1.0, nm.beta = 0.5, nm.gamma = 2.0, nm.fnscale = FALSE, nm.parscale = FALSE) } \arguments{ % In general: \item{llh}{ llh = c("filter", "internal", "testing")[1], defaults to "filter". } % nlminb: \item{nlminb.eval.max}{ Maximum number of evaluations of the objective function allowed, defaults to 200. } \item{nlminb.iter.max}{ Maximum number of iterations allowed, defaults to 150. } %\item{nlminb.trace}{ % The value of the objective function and the parameters is % printed every trace'th iteration. Defaults to 0 which % indicates no trace information is to be printed. % } \item{nlminb.abs.tol}{ Absolute tolerance, defaults to 1e-20. } \item{nlminb.rel.tol}{ Relative tolerance, defaults to 1e-10. } \item{nlminb.x.tol}{ X tolerance, defaults to 1.5e-8. } \item{nlminb.fscale}{ defaults to FALSE. } \item{nlminb.xscale}{ defaulkts to FALSE. } \item{nlminb.step.min}{ Minimum step size, defaults to 2.2e-14. } \item{nlminb.scale}{ defaults to 1. } % sqp: %\item{sqp.iprnt}{ % as.integer(trace). Default to 1. % } \item{sqp.mit}{ maximum number of iterations, defaults to 200. } \item{sqp.mfv}{ maximum number of function evaluations, defaults to 500. } \item{sqp.met}{ specifies scaling strategy:\cr sqp.met=1 - no scaling\cr sqp.met=2 - preliminary scaling in 1st iteration (default)\cr sqp.met=3 - controlled scaling\cr sqp.met=4 - interval scaling \cr sqp.met=5 - permanent scaling in all iterations } \item{sqp.mec}{ correction for negative curvature:\cr sqp.mec=1 - no correction\cr sqp.mec=2 - Powell correction (default) } \item{sqp.mer}{ restarts after unsuccessful variable metric updates:\cr sqp.mer=0 - no restarts\cr sqp.mer=1 - standard restart } \item{sqp.mes}{ interpolation method selection in a line search:\cr sqp.mes=1 - bisection\cr sqp.mes=2 - two point quadratic interpolation\cr sqp.mes=3 - three point quadratic interpolation\cr sqp.mes=4 - three point cubic interpolation (default) } \item{sqp.xmax}{ maximum stepsize, defaults to 1.0e+3. } \item{sqp.tolx}{ tolerance for the change of the coordinate vector, defaults to 1.0e-16. } \item{sqp.tolc}{ tolerance for the constraint violation, defaults to 1.0e-6. } \item{sqp.tolg}{ tolerance for the Lagrangian function gradient, defaults to 1.0e-6. } \item{sqp.told}{ defaults to 1.0e-6. } \item{sqp.tols}{ defaults to 1.0e-4. } \item{sqp.rpf}{ value of the penalty coefficient, default to1.0D-4. The default velue may be relatively small. Therefore, larger value, say one, can sometimes be more suitable. } % optim[lbfgsb]: \item{lbfgsb.REPORT}{ The frequency of reports for the "BFGS" and "L-BFGS-B" methods if control\$trace is positive. Defaults to every 10 iterations. } \item{lbfgsb.lmm}{ is an integer giving the number of BFGS updates retained in the "L-BFGS-B" method, It defaults to 5. } \item{lbfgsb.factr}{ controls the convergence of the "L-BFGS-B" method. Convergence occurs when the reduction in the objective is within this factor of the machine tolerance. Default is 1e7, that is a tolerance of about 1.0e-8. } \item{lbfgsb.pgtol}{ helps control the convergence of the "L-BFGS-B" method. It is a tolerance on the projected gradient in the current search direction. This defaults to zero, when the check is suppressed. } \item{lbfgsb.fnscale}{ defaults to FALSE. } \item{lbfgsb.parscale}{ defaults to FALSE. } % optim[nm]: %\item{nm.trace}{ % Non-negative integer. If positive, tracing information on the % progress of the optimization is produced. Higher values may % produce more tracing information: for method "L-BFGS-B" there % are six levels of tracing. (To understand exactly what these % do see the source code: higher levels give more detail.) % } \item{nm.ndeps}{ A vector of step sizes for the finite-difference approximation to the gradient, on par/parscale scale. Defaults to 1e-3. } \item{nm.maxit}{ The maximum number of iterations. Defaults to 100 for the derivative-based methods, and 500 for "Nelder-Mead". For "SANN" maxit gives the total number of function evaluations. There is no other stopping criterion. Defaults to 10000. } \item{nm.abstol}{ The absolute convergence tolerance. Only useful for non-negative functions, as a tolerance for reaching zero. } \item{nm.reltol}{ Relative convergence tolerance. The algorithm stops if it is unable to reduce the value by a factor of reltol * (abs(val) + reltol) at a step. Defaults to sqrt(.Machine\$double.eps), typically about 1e-8. } \item{nm.alpha, nm.beta, nm.gamma}{ Scaling parameters for the "Nelder-Mead" method. alpha is the reflection factor (default 1.0), beta the contraction factor (0.5), and gamma the expansion factor (2.0). } \item{nm.fnscale}{ An overall scaling to be applied to the value of fn and gr during optimization. If negative, turns the problem into a maximization problem. Optimization is performed on fn(par)/fnscale. } \item{nm.parscale}{ A vector of scaling values for the parameters. Optimization is performed on par/parscale and these should be comparable in the sense that a unit change in any element produces about a unit change in the scaled value. } } \value{ returns a list. } \author{ Diethelm Wuertz for the Rmetrics \R-port,\cr R Core Team for the 'optim' \R-port,\cr Douglas Bates and Deepayan Sarkar for the 'nlminb' \R-port,\cr Bell-Labs for the underlying PORT Library,\cr Ladislav Luksan for the underlying Fortran SQP Routine, \cr Zhu, Byrd, Lu-Chen and Nocedal for the underlying L-BFGS-B Routine. } \examples{ ## } \keyword{models} fGarch/man/dist-sgedSlider.Rd0000644000176200001440000000177713202277106015550 0ustar liggesusers\name{sgedSlider} \alias{sgedSlider} \title{Skew GED Distribution Slider} \description{ Displays interactively the dependence of the skew GED distribution on its parameters. } \usage{ sgedSlider(type = c("dist", "rand")) } \arguments{ \item{type}{ a character string denoting which interactive plot should be displayed. Either a distribution plot \code{type="dist"}, the default value, or a random variates plot, \code{type="rand"}. } } \value{ a Tcl object. } \references{ Nelson D.B. (1991); \emph{Conditional Heteroscedasticity in Asset Returns: A New Approach}, Econometrica, 59, 347--370. Fernandez C., Steel M.F.J. (2000); \emph{On Bayesian Modelling of Fat Tails and Skewness}, Preprint, 31 pages. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ \dontrun{ ## sgedSlider - require(tcltk) sgedSlider("dist") sgedSlider("rand") } } \keyword{distribution} fGarch/man/garchFit.Rd0000644000176200001440000003220613202304622014232 0ustar liggesusers\name{garchFit} \alias{garchFit} \alias{garchKappa} \title{Univariate GARCH Time Series Fitting} \description{ Estimates the parameters of an univariate ARMA-GARCH/APARCH process. } \usage{ garchFit(formula = ~ garch(1, 1), data = fGarch::dem2gbp, init.rec = c("mci", "uev"), delta = 2, skew = 1, shape = 4, cond.dist = c("norm", "snorm", "ged", "sged", "std", "sstd", "snig", "QMLE"), include.mean = TRUE, include.delta = NULL, include.skew = NULL, include.shape = NULL, leverage = NULL, trace = TRUE, %recursion = c("internal", "filter", "testing"), algorithm = c("nlminb", "lbfgsb", "nlminb+nm", "lbfgsb+nm"), hessian = c("ropt", "rcd"), control = list(), title = NULL, description = NULL, \dots) garchKappa(cond.dist = c("norm", "ged", "std", "snorm", "sged", "sstd", "snig"), gamma = 0, delta = 2, skew = NA, shape = NA) } \arguments{ %\item{recursion}{ % a string parameter that determines the recursion used for calculating % the maximum log-likelihood function. % Allowed values are ... %} \item{algorithm}{ a string parameter that determines the algorithm used for maximum likelihood estimation. % Allowed values are % \code{"nmfb"}, % \code{"sqp"}, % \code{"nlminb"}, and % \code{"bfgs"} where the third is the default % setting. \code{"mnfb"} is a fully Fortran implemented and extremely % fast version of the R-coded \code{"nlminb"} algorithm. } \item{cond.dist}{ a character string naming the desired conditional distribution. Valid values are \code{"dnorm"}, \code{"dged"}, \code{"dstd"}, \code{"dsnorm"}, \code{"dsged"}, \code{"dsstd"} and \code{"QMLE"}. The default value is the normal distribution. See Details for more information. } \item{control}{ control parameters, the same as used for the functions from \code{nlminb}, and 'bfgs' and 'Nelder-Mead' from \code{optim}. } \item{data}{ an optional timeSeries or data frame object containing the variables in the model. If not found in \code{data}, the variables are taken from \code{environment(formula)}, typically the environment from which \code{armaFit} is called. If \code{data} is an univariate series, then the series is converted into a numeric vector and the name of the response in the formula will be neglected. } \item{delta}{ a numeric value, the exponent \code{delta} of the variance recursion. By default, this value will be fixed, otherwise the exponent will be estimated together with the other model parameters if \code{include.delta=FALSE}. } \item{description}{ a character string which allows for a brief description. } \item{formula}{ formula object describing the mean and variance equation of the ARMA-GARCH/APARCH model. A pure GARCH(1,1) model is selected when e.g. \code{formula=~garch(1,1)}. To specify for example an ARMA(2,1)-APARCH(1,1) use \code{formula = ~arma(2,1)+apaarch(1,1)}. } \item{gamma}{ APARCH leverage parameter entering into the formula for calculating the expectation value. } % \item{hessian}{ % a string denoting how the Hessian matrix should be evaluated, % either \code{hessian ="cda"}, the default, or \code{"fda"}. % The forward difference approximation, \code{"fda"} consumes less % computer time, but is usually not as precise as approximations % that use central difference approximation, \code{"cda"}, formula. % } \item{hessian}{ a string denoting how the Hessian matrix should be evaluated, either \code{hessian ="rcd"}, or \code{"ropt"}, the default, \code{"rcd"} is a central difference approximation implemented in R and \code{"ropt"} use the internal R function \code{optimhess}. } \item{include.delta}{ a logical flag which determines if the parameter for the recursion equation \code{delta} will be estimated or not. If \code{include.delta=FALSE} then the shape parameter will be kept fixed during the process of parameter optimization. } \item{include.mean}{ this flag determines if the parameter for the mean will be estimated or not. If \code{include.mean=TRUE} this will be the case, otherwise the parameter will be kept fixed durcing the process of parameter optimization. } \item{include.shape}{ a logical flag which determines if the parameter for the shape of the conditional distribution will be estimated or not. If \code{include.shape=FALSE} then the shape parameter will be kept fixed during the process of parameter optimization. } \item{include.skew}{ a logical flag which determines if the parameter for the skewness of the conditional distribution will be estimated or not. If \code{include.skew=FALSE} then the skewness parameter will be kept fixed during the process of parameter optimization. } \item{init.rec}{ a character string indicating the method how to initialize the mean and varaince recursion relation. } \item{leverage}{ a logical flag for APARCH models. Should the model be leveraged? By default \code{leverage=TRUE}. } \item{shape}{ a numeric value, the shape parameter of the conditional distribution. } \item{skew}{ a numeric value, the skewness parameter of the conditional distribution. } \item{title}{ a character string which allows for a project title. } \item{trace}{ a logical flag. Should the optimization process of fitting the model parameters be printed? By default \code{trace=TRUE}. } \item{\dots}{ additional arguments to be passed. } } \value{ \code{garchFit} \cr \cr returns a S4 object of class \code{"fGARCH"} with the following slots: \item{@call}{ the call of the \code{garch} function. } \item{@formula}{ a list with two formula entries, one for the mean and the other one for the variance equation. } \item{@method}{ a string denoting the optimization method, by default the returneds string is "Max Log-Likelihood Estimation". } \item{@data}{ a list with one entry named \code{x}, containing the data of the time series to be estimated, the same as given by the input argument \code{series}. } \item{@fit}{ a list with the results from the parameter estimation. The entries of the list depend on the selected algorithm, see below. } \item{@residuals}{ a numeric vector with the (raw, unstandardized) residual values. } \item{@fitted}{ a numeric vector with the fitted values. } \item{@h.t}{ a numeric vector with the conditional variances (\eqn{h_t = \sigma_t^\delta}{h.t = sigma.t^delta}). } \item{@sigma.t}{ a numeric vector with the conditional standard deviation. } \item{@title}{ a title string. } \item{@description}{ a string with a brief description. } The entries of the @fit slot show the results from the optimization. } \details{ \code{"QMLE"} stands for Quasi-Maximum Likelihood Estimation, which assumes normal distribution and uses robust standard errors for inference. Bollerslev and Wooldridge (1992) proved that if the mean and the volatility equations are correctly specified, the QML estimates are consistent and asymptotically normally distributed. However, the estimates are not efficient and \dQuote{the efficiency loss can be marked under asymmetric ... distributions} (Bollerslev and Wooldridge (1992), p. 166). The robust variance-covariance matrix of the estimates equals the (Eicker-White) sandwich estimator, i.e. \deqn{V = H^{-1} G^{\prime} G H^{-1},}{V = H^(-1) G' G H^(-1),} where \eqn{V}{V} denotes the variance-covariance matrix, \eqn{H}{H} stands for the Hessian and \eqn{G}{G} represents the matrix of contributions to the gradient, the elements of which are defined as \deqn{G_{t,i} = \frac{\partial l_{t}}{\partial \zeta_{i}},}{% G_{t,i} = derivative of l_{t} w.r.t. zeta_{i},} where \eqn{t_{t}}{l_{t}} is the log likelihood of the t-th observation and \eqn{\zeta_{i}}{zeta_{i}} is the i-th estimated parameter. See sections 10.3 and 10.4 in Davidson and MacKinnon (2004) for a more detailed description of the robust variance-covariance matrix. } \references{ ATT (1984); \emph{PORT Library Documentation}, http://netlib.bell-labs.com/netlib/port/. Bera A.K., Higgins M.L. (1993); \emph{ARCH Models: Properties, Estimation and Testing}, J. Economic Surveys 7, 305--362. Bollerslev T. (1986); \emph{Generalized Autoregressive Conditional Heteroscedasticity}, Journal of Econometrics 31, 307--327. Bollerslev T., Wooldridge J.M. (1992); \emph{Quasi-Maximum Likelihood Estimation and Inference in Dynamic Models with Time-Varying Covariance}, Econometric Reviews 11, 143--172. Byrd R.H., Lu P., Nocedal J., Zhu C. (1995); \emph{A Limited Memory Algorithm for Bound Constrained Optimization}, SIAM Journal of Scientific Computing 16, 1190--1208. Davidson R., MacKinnon J.G. (2004); \emph{Econometric Theory and Methods}, Oxford University Press, New York. Engle R.F. (1982); \emph{Autoregressive Conditional Heteroscedasticity with Estimates of the Variance of United Kingdom Inflation}, Econometrica 50, 987--1008. Nash J.C. (1990); \emph{Compact Numerical Methods for Computers}, Linear Algebra and Function Minimisation, Adam Hilger. Nelder J.A., Mead R. (1965); \emph{A Simplex Algorithm for Function Minimization}, Computer Journal 7, 308--313. Nocedal J., Wright S.J. (1999); \emph{Numerical Optimization}, Springer, New York. } \author{ Diethelm Wuertz for the Rmetrics \R-port,\cr R Core Team for the 'optim' \R-port,\cr Douglas Bates and Deepayan Sarkar for the 'nlminb' \R-port,\cr Bell-Labs for the underlying PORT Library,\cr Ladislav Luksan for the underlying Fortran SQP Routine, \cr Zhu, Byrd, Lu-Chen and Nocedal for the underlying L-BFGS-B Routine. } \examples{ ## UNIVARIATE TIME SERIES INPUT: # In the univariate case the lhs formula has not to be specified ... # A numeric Vector from default GARCH(1,1) - fix the seed: N = 200 x.vec = as.vector(garchSim(garchSpec(rseed = 1985), n = N)[,1]) garchFit(~ garch(1,1), data = x.vec, trace = FALSE) # An univariate timeSeries object with dummy dates: x.timeSeries = dummyDailySeries(matrix(x.vec), units = "GARCH11") garchFit(~ garch(1,1), data = x.timeSeries, trace = FALSE) \dontrun{ # An univariate zoo object: x.zoo = zoo(as.vector(x.vec), order.by = as.Date(rownames(x.timeSeries))) garchFit(~ garch(1,1), data = x.zoo, trace = FALSE) } # An univariate "ts" object: x.ts = as.ts(x.vec) garchFit(~ garch(1,1), data = x.ts, trace = FALSE) ## MULTIVARIATE TIME SERIES INPUT: # For multivariate data inputs the lhs formula must be specified ... # A numeric matrix binded with dummy random normal variates: X.mat = cbind(GARCH11 = x.vec, R = rnorm(N)) garchFit(GARCH11 ~ garch(1,1), data = X.mat) # A multivariate timeSeries object with dummy dates: X.timeSeries = dummyDailySeries(X.mat, units = c("GARCH11", "R")) garchFit(GARCH11 ~ garch(1,1), data = X.timeSeries) \dontrun{ # A multivariate zoo object: X.zoo = zoo(X.mat, order.by = as.Date(rownames(x.timeSeries))) garchFit(GARCH11 ~ garch(1,1), data = X.zoo) } # A multivariate "mts" object: X.mts = as.ts(X.mat) garchFit(GARCH11 ~ garch(1,1), data = X.mts) ## MODELING THE PERCENTUAL SPI/SBI SPREAD FROM LPP BENCHMARK: X.timeSeries = as.timeSeries(data(LPP2005REC)) X.mat = as.matrix(x.timeSeries) \dontrun{X.zoo = zoo(X.mat, order.by = as.Date(rownames(X.mat)))} X.mts = ts(X.mat) garchFit(100*(SPI - SBI) ~ garch(1,1), data = X.timeSeries) # The remaining are not yet supported ... # garchFit(100*(SPI - SBI) ~ garch(1,1), data = X.mat) # garchFit(100*(SPI - SBI) ~ garch(1,1), data = X.zoo) # garchFit(100*(SPI - SBI) ~ garch(1,1), data = X.mts) ## MODELING HIGH/LOW RETURN SPREADS FROM MSFT PRICE SERIES: X.timeSeries = MSFT garchFit(Open ~ garch(1,1), data = returns(X.timeSeries)) garchFit(100*(High-Low) ~ garch(1,1), data = returns(X.timeSeries)) } \keyword{models} fGarch/man/methods-formula.Rd0000644000176200001440000000626313202277106015623 0ustar liggesusers\name{formula-methods} \docType{methods} \alias{formula-methods} \alias{formula,ANY-method} \alias{formula,fGARCH-method} \title{Extract GARCH Model formula} \description{ Extracts formula from a formula GARCH object. } \section{Methods}{ \describe{ \item{object = "ANY"}{ Generic function. } \item{object = "fGARCH"}{ Extractor function for formula expression. } } } \details{ The function extracts the \code{@formula} expression slot from an object of class \code{"fGARCH"} as returned by the function \code{garchFit}. Note, the returned formula has always a left hand side. If the argument \code{data} was an univariate time series and no name was specified to the series, then the left hand side has assigned the name of the data.set. In the multivariate case the rectangular \code{data} object must always have column names, otherwise the fitting will be stopped and you get the error message The class of the returned value depends on the input to the function \code{garchFit} who created the object. The returned value is always of the same class as the input object to the argument \code{data} in the function \code{garchFit}, i.e. if you fit a \code{"timeSeries"} object, you will get back from the function \code{fitted} also a \code{"timeSeries"} object, if you fit an object of class \code{"zoo"}, you will get back again a \code{"zoo"} object. The same holds for a \code{"numeric"} vector, for a \code{"data.frame"}, and for objects of class \code{"ts", "mts"}. In contrast, the slot itself returns independent of the class of the data input always a numceric vector, i.e. the function call r\code{slot(object, "fitted")} will return a numeric vector. } \note{ \code{formula} is a generic function which extracts the formula expression from objects returned by modeling functions. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## garchFit - fit = garchFit(~garch(1, 1), data = garchSim()) ## formula - formula(fit) ## A Bivariate series and mis-specified formula: x = garchSim(n = 500) y = garchSim(n = 500) z = cbind(x, y) colnames(z) class(z) \dontrun{ garchFit(z ~garch(1, 1), data = z, trace = FALSE) } # Returns: # Error in .garchArgsParser(formula = formula, data = data, trace = FALSE) : # Formula and data units do not match. ## Doubled column names in data set - formula can't fit: colnames(z) <- c("x", "x") z[1:6,] \dontrun{ garchFit(x ~garch(1, 1), data = z, trace = FALSE) } # Again the error will be noticed: # Error in garchFit(x ~ garch(1, 1), data = z) : # Column names of data are not unique. ## Missing column names in data set - formula can't fit: z.mat <- as.matrix(z) colnames(z.mat) <- NULL z.mat[1:6,] \dontrun{ garchFit(x ~ garch(1, 1), data = z.mat, trace = FALSE) } # Again the error will be noticed: # Error in .garchArgsParser(formula = formula, data = data, trace = FALSE) : # Formula and data units do not match } \keyword{models} fGarch/man/class-fGARCHSPEC.Rd0000644000176200001440000000315113202277106015256 0ustar liggesusers\name{fGARCHSPEC-class} \docType{class} \alias{fGARCHSPEC-class} \alias{update,fGARCHSPEC-method} \title{Class "fGARCHSPEC"} \description{ Specification Structure for an univariate GARCH time series model. } \section{Objects from the Class}{ Objects can be created by calls of the function \code{garchSpec}. This object is specifies the parameters of an empirical GARCH process. } \section{Slots}{ \describe{ \item{\code{call}:}{Object of class \code{"call"}: the call of the \code{garch} function. } \item{\code{formula}:}{Object of class \code{"formula"}: a list with two formula entries for the mean and variance equation. } \item{\code{model}:}{Object of class \code{"list"}: a list with the model parameters. } \item{\code{presample}:}{Object of class \code{"matrix"}: a numeric matrix with presample values. } \item{\code{distribution}:}{Object of class \code{"character"}: a character string with the name of the conditional distribution. } \item{\code{rseed}:}{Object of class \code{"numeric"}: an integer with the random number generator seed. } } } \section{Methods}{ \describe{ \item{show}{\code{signature(object = "fGARCHSPEC")}: prints an object of class 'fGARCHSPEC'. } } } \note{ With Rmetrics Version 2.6.1 the class has been renamed from \code{"garchSpec"} to \code{"fGARCHSPEC"}. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \keyword{programming} fGarch/man/methods-plot.Rd0000644000176200001440000000360513202277106015131 0ustar liggesusers\name{plot-methods} \docType{methods} \alias{plot-methods} \alias{plot,ANY,ANY-method} \alias{plot,fGARCH,missing-method} \title{GARCH Plot Methods} \description{ Plot methods for GARCH Modelling. } \usage{ \S4method{plot}{fGARCH,missing}(x, which = "ask", \dots) } \arguments{ \item{x}{ an object of class \code{"fREG"} } \item{which}{ a character string denoting which plot should be displayed. } \item{\dots}{ optional arguments to be passed. } } \section{Methods}{ \describe{ \item{x = "ANY", y = "ANY"}{ Generic function. } \item{x = "fGARCH", y = "missing"}{ Plot function for objects of class \code{"fGARCH"}. } } } \details{ The generic function \code{plot} allows to display 13 graphs. These are the \cr Time SeriesPlot\cr Conditional Standard Deviation Plot\cr Series Plot with 2 Conditional SD Superimposed\cr Autocorrelation function Plot of Observations\cr Autocorrelation function Plot of Squared Observations\cr Cross Correlation Plot\cr Residuals Plot\cr Conditional Standard Deviations Plot\cr Standardized Residuals Plot\cr ACF Plot of Standardized Residuals\cr ACF Plot of Squared Standardized Residuals\cr Cross Correlation Plot between $r^2$ and r\cr Quantile-Quantile Plot of Standardized Residuals\cr } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## garchSim - # Default Garch(1,1) Model: x = garchSim(n = 200) head(x) ## garchFit - fit = garchFit(formula = ~ garch(1, 1), data = x, trace = FALSE) ## Batch Plot: plot(fit, which = 3) \dontrun{ ## Plot: # Interactive Plot: plot(fit) } } \keyword{models} fGarch/man/dist-sstd.Rd0000644000176200001440000000412313202277106014424 0ustar liggesusers\name{sstd} \alias{sstd} \alias{dsstd} \alias{psstd} \alias{qsstd} \alias{rsstd} \title{Skew Student-t Distribution and Parameter Estimation} \description{ Functions to compute density, distribution function, quantile function and to generate random variates for the skew Student-t distribution. } \usage{ dsstd(x, mean = 0, sd = 1, nu = 5, xi = 1.5, log = FALSE) psstd(q, mean = 0, sd = 1, nu = 5, xi = 1.5) qsstd(p, mean = 0, sd = 1, nu = 5, xi = 1.5) rsstd(n, mean = 0, sd = 1, nu = 5, xi = 1.5) } \arguments{ \item{mean, sd, nu, xi}{ location parameter \code{mean}, scale parameter \code{sd}, shape parameter \code{nu}, skewness parameter \code{xi}. } \item{n}{ the number of observations. } \item{p}{ a numeric vector of probabilities. } \item{x, q}{ a numeric vector of quantiles. } \item{log}{ a logical; if TRUE, densities are given as log densities. } } \value{ \code{d*} returns the density, \code{p*} returns the distribution function, \code{q*} returns the quantile function, and \code{r*} generates random deviates, \cr all values are numeric vectors. } \references{ Fernandez C., Steel M.F.J. (2000); \emph{On Bayesian Modelling of Fat Tails and Skewness}, Preprint, 31 pages. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## sstd - par(mfrow = c(2, 2)) set.seed(1953) r = rsstd(n = 1000) plot(r, type = "l", main = "sstd", col = "steelblue") # Plot empirical density and compare with true density: hist(r, n = 25, probability = TRUE, border = "white", col = "steelblue") box() x = seq(min(r), max(r), length = 201) lines(x, dsstd(x), lwd = 2) # Plot df and compare with true df: plot(sort(r), (1:1000/1000), main = "Probability", col = "steelblue", ylab = "Probability") lines(x, psstd(x), lwd = 2) # Compute quantiles: round(qsstd(psstd(q = seq(-1, 5, by = 1))), digits = 6) } \keyword{distribution} fGarch/man/methods-predict.Rd0000644000176200001440000000727713202277461015622 0ustar liggesusers\name{predict-methods} \docType{methods} \alias{predict-methods} \alias{predict,ANY-method} \alias{predict,fGARCH-method} \title{GARCH Prediction Function} \description{ Predicts a time series from a fitted GARCH object. } \usage{ \S4method{predict}{fGARCH}(object, n.ahead = 10, trace = FALSE, mse = c("cond","uncond"), plot=FALSE, nx=NULL, crit_val=NULL, conf=NULL, \dots) } \arguments{ \item{n.ahead}{ an integer value, denoting the number of steps to be forecasted, by default 10.} \item{object}{ an object of class \code{fGARCH} as returned by the function \code{garchFit}.} \item{trace}{ a logical flag. Should the prediction process be traced? By default \code{trace=FALSE}.} \item{mse}{ If set to \code{"cond"}, \code{meanError} is defined as the conditional mean errors \eqn{\sqrt{E_t[x_{t+h}-E_t(x_{t+h})]^2}}. If set to \code{"uncond"}, it is defined as \eqn{\sqrt{E[x_{t+h}-E_t(x_{t+h})]^2}}.} \item{plot}{If set to \code{TRUE}, the confidence intervals are computed and plotted} \item{nx}{The number of observations to be plotted along with the predictions. The default is \code{round(n*0.25)}, where n is the sample size.} \item{crit_val}{The critical values for the confidence intervals when \code{plot} is set to \code{TRUE}. The intervals are defined as \eqn{\hat{x}_{t+h}} + \code{crit_val[2] * meanError} and \eqn{\hat{x}_{t+h}} + \code{crit_val[1] * meanError} if two critical values are provided and \eqn{\hat{x}_{t+h} \pm} \code{crit_val * meanError} if only one is given. If you do not provide critical values, they will be computed automatically. } \item{conf}{The confidence level for the confidence intervals if \code{crit_val} is not provided. By default it is set to 0.95. The critical values are then computed using the conditional distribution that was chosen to create the \code{object} with \code{garchFit} using the same \code{shape} and \code{skew} parameters. If the conditionnal distribution was set to \code{"QMLE"}, the critical values are computed using the empirical distribution of the standardized residuals. } \item{\dots}{ additional arguments to be passed. } } \section{Methods}{ \describe{ \item{object = "ANY"}{ Generic function. } \item{object = "fGARCH"}{ Predict function for objects of class \code{"fGARCH"}. } } } \value{ returns a data frame with the foloowing columns: \code{"meanForecast"}, \code{meanError}, and \code{"standardDeviation"}. The number of records equals the number of forecasting steps \code{n.ahead}. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## garchFit - # Parameter Estimation of Default GARCH(1,1) Model: set.seed(123) fit = garchFit(~ garch(1, 1), data = garchSim(), trace = FALSE) fit ## predict - predict(fit, n.ahead = 10) predict(fit, n.ahead = 10,mse="uncond") ## predict with plotting: critical values = +- 2 predict(fit, n.ahead = 10, plot=TRUE, crit_val=2) ## predict with plotting: automatic critical values ## for different conditional distributions set.seed(321) fit2 = garchFit(~ garch(1, 1), data = garchSim(), trace = FALSE, cond.dist="sged") ## 95% confidence level predict(fit2,n.ahead=20,plot=TRUE) set.seed(444) fit3 = garchFit(~ garch(1, 1), data = garchSim(), trace = FALSE, cond.dist="QMLE") ## 90% confidence level and nx=100 predict(fit3,n.ahead=20,plot=TRUE,conf=.9,nx=100) } \keyword{models} fGarch/man/dist-snorm.Rd0000644000176200001440000000415313202277106014610 0ustar liggesusers\name{snorm} \alias{snorm} \alias{dsnorm} \alias{psnorm} \alias{qsnorm} \alias{rsnorm} \title{Skew Normal Distribution} \description{ Functions to compute density, distribution function, quantile function and to generate random variates for the skew normal distribution. } \usage{ dsnorm(x, mean = 0, sd = 1, xi = 1.5, log = FALSE) psnorm(q, mean = 0, sd = 1, xi = 1.5) qsnorm(p, mean = 0, sd = 1, xi = 1.5) rsnorm(n, mean = 0, sd = 1, xi = 1.5) } \arguments{ \item{mean, sd, xi}{ location parameter \code{mean}, scale parameter \code{sd}, skewness parameter \code{xi}. } \item{n}{ the number of observations. } \item{p}{ a numeric vector of probabilities. } \item{x, q}{ a numeric vector of quantiles. } \item{\dots}{ parameters parsed to the optimization function \code{nlm}. } \item{log}{ a logical; if TRUE, densities are given as log densities. } } \value{ \code{d*} returns the density, \code{p*} returns the distribution function, \code{q*} returns the quantile function, and \code{r*} generates random deviates, \cr all values are numeric vectors. } \references{ Fernandez C., Steel M.F.J. (2000); \emph{On Bayesian Modelling of Fat Tails and Skewness}, Preprint, 31 pages. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## snorm - # Ranbdom Numbers: par(mfrow = c(2, 2)) set.seed(1953) r = rsnorm(n = 1000) plot(r, type = "l", main = "snorm", col = "steelblue") # Plot empirical density and compare with true density: hist(r, n = 25, probability = TRUE, border = "white", col = "steelblue") box() x = seq(min(r), max(r), length = 201) lines(x, dsnorm(x), lwd = 2) # Plot df and compare with true df: plot(sort(r), (1:1000/1000), main = "Probability", col = "steelblue", ylab = "Probability") lines(x, psnorm(x), lwd = 2) # Compute quantiles: round(qsnorm(psnorm(q = seq(-1, 5, by = 1))), digits = 6) } \keyword{distribution} fGarch/man/dist-std.Rd0000644000176200001440000000370413202277106014245 0ustar liggesusers\name{std} \alias{std} \alias{dstd} \alias{pstd} \alias{qstd} \alias{rstd} \title{Student-t Distribution} \description{ Functions to compute density, distribution function, quantile function and to generate random variates for the Student-t distribution. } \usage{ dstd(x, mean = 0, sd = 1, nu = 5, log = FALSE) pstd(q, mean = 0, sd = 1, nu = 5) qstd(p, mean = 0, sd = 1, nu = 5) rstd(n, mean = 0, sd = 1, nu = 5) } \arguments{ \item{mean, sd, nu}{ location parameter \code{mean}, scale parameter \code{sd}, shape parameter \code{nu}. } \item{n}{ the number of observations. } \item{p}{ a numeric vector of probabilities. } \item{x, q}{ a numeric vector of quantiles. } \item{log}{ a logical; if TRUE, densities are given as log densities. } } \value{ \code{d*} returns the density, \code{p*} returns the distribution function, \code{q*} returns the quantile function, and \code{r*} generates random deviates, \cr all values are numeric vectors. } \references{ Fernandez C., Steel M.F.J. (2000); \emph{On Bayesian Modelling of Fat Tails and Skewness}, Preprint, 31 pages. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## std - par(mfrow = c(2, 2)) set.seed(1953) r = rstd(n = 1000) plot(r, type = "l", main = "sstd", col = "steelblue") # Plot empirical density and compare with true density: hist(r, n = 25, probability = TRUE, border = "white", col = "steelblue") box() x = seq(min(r), max(r), length = 201) lines(x, dstd(x), lwd = 2) # Plot df and compare with true df: plot(sort(r), (1:1000/1000), main = "Probability", col = "steelblue", ylab = "Probability") lines(x, pstd(x), lwd = 2) # Compute quantiles: round(qstd(pstd(q = seq(-1, 5, by = 1))), digits = 6) } \keyword{distribution} fGarch/man/dist-snormSlider.Rd0000644000176200001440000000161213202277106015750 0ustar liggesusers\name{snormSlider} \alias{snormSlider} \title{Skew Normal Distribution Slider} \description{ Displays interactively the dependence of the skew Normal distribution on its parameters. } \usage{ snormSlider(type = c("dist", "rand")) } \arguments{ \item{type}{ a character string denoting which interactive plot should be displayed. Either a distribution plot \code{type="dist"}, the default value, or a random variates plot, \code{type="rand"}. } } \value{ a Tcl object. } \references{ Fernandez C., Steel M.F.J. (2000); \emph{On Bayesian Modelling of Fat Tails and Skewness}, Preprint, 31 pages. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ \dontrun{ ## snormSlider - require(tcltk) snormSlider("dist") snormSlider("rand") } } \keyword{distribution} fGarch/man/garchSim.Rd0000644000176200001440000001465013202277106014251 0ustar liggesusers\name{garchSim} \alias{garchSim} \title{Univariate GARCH/APARCH Time Series Simulation} \description{ Simulates a univariate GARCH/APARCH time series model. } \usage{ garchSim(spec = garchSpec(), n = 100, n.start = 100, extended = FALSE) } \arguments{ \item{extended}{ logical parameter if the output series should be a 3 columns \code{timeSeries} object with \code{garch}, \code{sigma} and \code{eps} data (\code{extended = TRUE}) or a univariate GARCH\\APARCH time series (\code{extended = FALSE} } \item{spec}{ a specification object of class \code{"fGARCHSPEC"} as returned by the function \code{garchSpec}. The model parameters are taken from the \code{@model} slot, a list with the following entries:\cr \code{omega} - the constant coefficient of the variance equation, by default 1e-6; \cr \code{alpha} - the value or vector of autoregressive coefficients, by default 0.1, specifying a model of order 1; \cr \code{beta} - the value or vector of variance coefficients, by default 0.8, specifying a model of order 1; \cr The optional values for the linear part are: \cr \code{mu} - the intercept value, by default 0 (it implies that the mean = mu/(1-sum(ar))); \cr \code{ar} - the autoregressive ARMA coefficients, by default 0; \cr \code{ma} - the moving average ARMA coefficients, by default 0. \cr The optional parameters for the conditional distributions are:\cr \code{skew} - the skewness parameter (also named xi), by default 0.9, effective only for the \code{"dsnorm"}, the \code{"dsged"}, and the \code{"dsstd"} skewed conditional distributions; \cr \code{shape} = the shape parameter (also named nu), by default 2 for the \code{"dged"} and \code{"dsged"}, and by default 4 for the \code{"dstd"} and \code{"dsstd"} conditional distributions.\cr See also below for further details. } \item{n}{ length of output series, an integer value. An integer value, by default \code{n=100}. } \item{n.start}{ length of "burn-in" period, by default 100. } } \details{ The function \code{garchSim} simulates an univariate GARCH or APARCH time series process as specified by the argument \code{model}. The \code{model} is an object of class \code{"fGARCHSPEC"} as returned by the function \code{garchSpec}. The returned model specification comes comes with a slot \code{@model} which is a list of just the numeric parameter entries. These are recognized and extracted for use by the function \code{garchSim}. By default the series will be returned as an object of class \code{"ts"} or as a \code{"numeric"} vector. Having time/date positions, e.g. from an empirical process the numeric vector can be easily transformed into other time series objects like \code{"timeSeries"} or \code{"zoo"}. So one can estimate the parameters of a GARCH process from empirical data using the function \code{garchFit} and simulate than statistically equivalent GARCH processes with the same set of model parameters using the function \code{garchSim}. The third entry in the argument \code{returnClass="mts"} allows to return a trivariate time series, where the first column contains the simulated \code{"garch"} process, the second column the conditional standard deviations \code{"h"}, and the last column the innovations named \code{"eps"}. Note, the default model specifies Bollerslev's GARCH(1,1) model with normal distributed innovations. } \value{ The function \code{garchSim} returns an objects of class \code{"timeSeries"} attributed by a list with entry \code{$garchSpec} giving the GARCH specification structure as returned by the function \code{garchSpec} and with information on conditional standard deviations and innovations. See details above. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## garchSpec - spec = garchSpec() spec ## garchSim - # Simulate a "timeSeries" object: x = garchSim(spec, n = 50) class(x) print(x) ## More simulations ... # Default GARCH(1,1) - uses default parameter settings spec = garchSpec(model = list()) garchSim(spec, n = 10) # ARCH(2) - use default omega and specify alpha, set beta=0! spec = garchSpec(model = list(alpha = c(0.2, 0.4), beta = 0)) garchSim(spec, n = 10) # AR(1)-ARCH(2) - use default mu, omega spec = garchSpec(model = list(ar = 0.5, alpha = c(0.3, 0.4), beta = 0)) garchSim(spec, n = 10) # AR([1,5])-GARCH(1,1) - use default garch values and subset ar[.] spec = garchSpec(model = list(mu = 0.001, ar = c(0.5,0,0,0,0.1))) garchSim(spec, n = 10) # ARMA(1,2)-GARCH(1,1) - use default garch values spec = garchSpec(model = list(ar = 0.5, ma = c(0.3, -0.3))) garchSim(spec, n = 10) # GARCH(1,1) - use default omega and specify alpha/beta spec = garchSpec(model = list(alpha = 0.2, beta = 0.7)) garchSim(spec, n = 10) # GARCH(1,1) - specify omega/alpha/beta spec = garchSpec(model = list(omega = 1e-6, alpha = 0.1, beta = 0.8)) garchSim(spec, n = 10) # GARCH(1,2) - use default omega and specify alpha[1]/beta[2] spec = garchSpec(model = list(alpha = 0.1, beta = c(0.4, 0.4))) garchSim(spec, n = 10) # GARCH(2,1) - use default omega and specify alpha[2]/beta[1] spec = garchSpec(model = list(alpha = c(0.12, 0.04), beta = 0.08)) garchSim(spec, n = 10) # snorm-ARCH(1) - use defaults with skew Normal spec = garchSpec(model = list(beta = 0, skew = 0.8), cond.dist = "snorm") garchSim(spec, n = 10) # sged-GARCH(1,1) - using defaults with skew GED model = garchSpec(model = list(skew = 0.93, shape = 3), cond.dist = "sged") garchSim(model, n = 10) # Taylor Schwert GARCH(1,1) - this belongs to the family of APARCH Models spec = garchSpec(model = list(delta = 1)) garchSim(spec, n = 10) # AR(1)-t-APARCH(2, 1) - a little bit more complex specification ... spec = garchSpec(model = list(mu = 1.0e-4, ar = 0.5, omega = 1.0e-6, alpha = c(0.10, 0.05), gamma = c(0, 0), beta = 0.8, delta = 1.8, shape = 4, skew = 0.85), cond.dist = "sstd") garchSim(spec, n = 10) } \keyword{models} fGarch/man/dist-sstdFit.Rd0000644000176200001440000000267313202277106015077 0ustar liggesusers\name{sstdFit} \alias{sstdFit} \title{Skew Student-t Distribution Parameter Estimation} \description{ Function to fit the parameters of the Student-t distribution. } \usage{ sstdFit(x, \dots) } \arguments{ \item{x}{ a numeric vector of quantiles. } \item{\dots}{ parameters parsed to the optimization function \code{nlm}. } } \value{ \code{sstdFit} returns a list with the following components: \cr \item{par}{ The best set of parameters found. } \item{objective}{ The value of objective corresponding to \code{par}. } \item{convergence}{ An integer code. 0 indicates successful convergence. } \item{message}{ A character string giving any additional information returned by the optimizer, or NULL. For details, see PORT documentation. } \item{iterations}{ Number of iterations performed. } \item{evaluations}{ Number of objective function and gradient function evaluations. } } \references{ Fernandez C., Steel M.F.J. (2000); \emph{On Bayesian Modelling of Fat Tails and Skewness}, Preprint, 31 pages. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## sstd - set.seed(1953) r = rsstd(n = 1000) ## sstdFit - sstdFit(r) } \keyword{distribution} fGarch/man/dist-sstdSlider.Rd0000644000176200001440000000161213202277106015567 0ustar liggesusers\name{sstdSlider} \alias{sstdSlider} \title{Skew Student-t Distribution Slider} \description{ Displays interactively the dependence of the skew Student-t distribution on its parameters. } \usage{ sstdSlider(type = c("dist", "rand")) } \arguments{ \item{type}{ a character string denoting which interactive plot should be displayed. Either a distribution plot \code{type="dist"}, the default value, or a random variates plot, \code{type="rand"}. } } \value{ a Tcl object. } \references{ Fernandez C., Steel M.F.J. (2000); \emph{On Bayesian Modelling of Fat Tails and Skewness}, Preprint, 31 pages. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ \dontrun{ ## sstdSlider - require(tcltk) sstdSlider("dist") sstdSlider("rand") } } \keyword{distribution} fGarch/man/data.Rd0000644000176200001440000000030213202277106013412 0ustar liggesusers\name{TimeSeriesData} \alias{TimeSeriesData} \alias{dem2gbp} \alias{sp500dge} \title{Time Series Data Sets} \description{ Data sets used in the examples of the timeSeries packages. } fGarch/man/dist-gedFit.Rd0000644000176200001440000000310213202277107014646 0ustar liggesusers\name{gedFit} \alias{gedFit} \title{Generalized Error Distribution Parameter Estimation} \description{ Function to fit the parameters of the generalized error distribution. } \usage{ gedFit(x, \dots) } \arguments{ \item{x}{ a numeric vector of quantiles. } \item{\dots}{ parameters parsed to the optimization function \code{nlm}. } } \value{ \code{gedFit} returns a list with the following components: \cr \item{par}{ The best set of parameters found. } \item{objective}{ The value of objective corresponding to \code{par}. } \item{convergence}{ An integer code. 0 indicates successful convergence. } \item{message}{ A character string giving any additional information returned by the optimizer, or NULL. For details, see PORT documentation. } \item{iterations}{ Number of iterations performed. } \item{evaluations}{ Number of objective function and gradient function evaluations. } } \references{ Nelson D.B. (1991); \emph{Conditional Heteroscedasticity in Asset Returns: A New Approach}, Econometrica, 59, 347--370. Fernandez C., Steel M.F.J. (2000); \emph{On Bayesian Modelling of Fat Tails and Skewness}, Preprint, 31 pages. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## rged - set.seed(1953) r = rged(n = 1000) ## gedFit - gedFit(r) } \keyword{distribution} fGarch/man/methods-fitted.Rd0000644000176200001440000000411013202277106015422 0ustar liggesusers\name{fitted-methods} \docType{methods} \alias{fitted-methods} \alias{fitted,ANY-method} \alias{fitted,fGARCH-method} \title{Extract GARCH Model Fitted Values} \description{ Extracts fitted values from a fitted GARCH object. } \section{Methods}{ \describe{ \item{object = "ANY"}{ Generic function. } \item{object = "fGARCH"}{ Extractor function for fitted values. } } } \details{ The function extracts the \code{@fitted} value slot from an object of class \code{"fGARCH"} as returned by the function \code{garchFit}. The class of the returned value depends on the input to the function \code{garchFit} who created the object. The returned value is always of the same class as the input object to the argument \code{data} in the function \code{garchFit}, i.e. if you fit a \code{"timeSeries"} object, you will get back from the function \code{fitted} also a \code{"timeSeries"} object, if you fit an object of class \code{"zoo"}, you will get back again a \code{"zoo"} object. The same holds for a \code{"numeric"} vector, for a \code{"data.frame"}, and for objects of class \code{"ts", "mts"}. In contrast, the slot itself returns independent of the class of the data input always a numceric vector, i.e. the function call r\code{slot(object, "fitted")} will return a numeric vector. } \note{ \code{fitted} is a generic function which extracts fitted values from objects returned by modeling functions. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## Swiss Pension fund Index - x = as.timeSeries(data(LPP2005REC)) ## garchFit - # Fit LPP40 Bechmark: fit = garchFit(LPP40 ~ garch(1, 1), data = 100*x, trace = FALSE) fit ## fitted - # Fitted values are now a "timeSeries" oject: fitted = fitted(fit) head(fitted) class(fitted) ## slot - # The slot contains a numeric Vector: fitted = slot(fit, "fitted") head(fitted) class(fitted) } \keyword{models} fGarch/man/dist-stdSlider.Rd0000644000176200001440000000137513202277106015412 0ustar liggesusers\name{stdSlider} \alias{stdSlider} \title{Student-t Distribution Slider} \description{ Displays interactively the dependence of the Student-t distribution on its parameters. } \usage{ stdSlider(type = c("dist", "rand")) } \arguments{ \item{type}{ a character string denoting which interactive plot should be displayed. Either a distribution plot \code{type="dist"}, the default value, or a random variates plot, \code{type="rand"}. } } \value{ a Tcl object. } %\references{ %} \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ \dontrun{ ## stdSlider - require(tcltk) stdSlider("dist") stdSlider("rand") } } \keyword{distribution} fGarch/man/class-fGARCH.Rd0000644000176200001440000000653413202277106014613 0ustar liggesusers\name{fGARCH-class} \docType{class} \alias{fGARCH-class} \alias{fUGARCHSPEC-class} \alias{update,fGARCH-method} \title{Class "fGARCH"} \description{ The class fGARCH represents a model of an heteroskedastic time series process. } \section{Objects from the Class}{ Objects can be created by calls of the function \code{garchFit}. This object is a parameter estimate of an empirical GARCH process. } \section{Slots}{ \describe{ \item{\code{call}:}{Object of class \code{"call"}: the call of the \code{garch} function. } \item{\code{formula}:}{Object of class \code{"formula"}: a formula object specifying mean and variance equation. } \item{\code{method}:}{Object of class \code{"character"}: a string denoting the optimization method, by default the returneds string is "Max Log-Likelihood Estimation". } \item{\code{data}:}{Object of class \code{"list"}: a list with one entry named \code{x}, containing the data of the time series to be estimated, the same as given by the input argument \code{series}. } \item{\code{fit}:}{Object of class \code{"list"}: a list with the results from the parameter estimation. The entries of the list depend on the selected algorithm, see below. } \item{\code{residuals}:}{Object of class \code{"numeric"}: a numeric vector with the residual values. } \item{\code{fitted}:}{Object of class \code{"numeric"}: a numeric vector with the fitted values. } \item{\code{h.t}:}{Object of class \code{"numeric"}: a numeric vector with the conditional variances. } \item{\code{sigma.t}:}{Object of class \code{"numeric"}: a numeric vector with the conditional standard deviations. } \item{\code{title}:}{Object of class \code{"character"}: a title string. } \item{\code{description}:}{Object of class \code{"character"}: a string with a brief description. } } } \section{Methods}{ \describe{ \item{plot}{\code{signature(x = "fGARCH", y = "missing")}: plots an object of class 'fGARCH'. } \item{show}{\code{signature(object = "fGARCH")}: prints an object of class 'fGARCH'. } \item{summary}{\code{signature(object = "fGARCH")}: summarizes an object of class 'fGARCH'. } \item{predict}{\code{signature(object = "fGARCH")}: forecasts mean and volatility from an object of class 'fGARCH'. } \item{fitted}{\code{signature(object = "fGARCH")}: extracts fitted values from an object of class 'fGARCH'. } \item{residuals}{\code{signature(object = "fGARCH")}: extracts fresiduals from an object of class 'fGARCH'. } \item{volatility}{\code{signature(object = "fGARCH")}: extracts conditional volatility from an object of class 'fGARCH'. } \item{coef}{\code{signature(object = "fGARCH")}: extracts fitted coefficients from an object of class 'fGARCH'. } \item{formula}{\code{signature(x = "fGARCH")}: extracts formula expression from an object of class 'fGARCH'. } } } \author{ Diethelm Wuertz and Rmetrics Core Team. } \keyword{programming} fGarch/man/dist-absMoments.Rd0000644000176200001440000000201213202277106015552 0ustar liggesusers\name{absMoments} \alias{absMoments} \title{Absolute Moments of GARCH Distributions} \description{ Computes absolute Moments of the skew Normal, skew GED, and standardized skew Student-t distributions } \usage{ absMoments(n, density = c("dnorm", "dged", "dstd"), \dots) } \arguments{ \item{density}{ a character string naming the symmetric density function. } \item{n}{ the number of absolute Moments. } \item{\dots}{ parameters passed to the density function. } } \value{ \code{absMoments} returns a numeric vector of length \code{n} with the values of the absolute moments of the selected density function. } \references{ Fernandez C., Steel M.F.J. (2000); \emph{On Bayesian Modelling of Fat Tails and Skewness}, Preprint, 31 pages. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## absMoment - absMoments(4, "dstd", nu = 4) } \keyword{distribution} fGarch/man/methods-residuals.Rd0000644000176200001440000000443513202277106016150 0ustar liggesusers\name{residuals-methods} \docType{methods} \alias{residuals-methods} \alias{residuals,ANY-method} \alias{residuals,fGARCH-method} \title{Extract GARCH Model Residuals} \description{ Extracts residuals from a fitted GARCH object. } \usage{ \S4method{residuals}{fGARCH}(object, standardize = FALSE) } \arguments{ \item{object}{ an object of class \code{"fGARCH"} as returned from the function \code{garchFit}. } \item{standardize}{ a logical flag, should the residuals be standardized? } } \section{Methods}{ \describe{ \item{object = "ANY"}{ Generic function } \item{object = "fGARCH"}{ Extractor function for residual from an object of class \code{"fGARCH"}. } } } \details{ The function extracts the \code{@residuals} slot from an object of class \code{"fGARCH"} as returned by the function \code{garchFit}. The class of the returned value depends on the input to the function \code{garchFit} who created the object. The returned value is always of the same class as the input object to the argument \code{data} in the function \code{garchFit}, i.e. if you fit a \code{"timeSeries"} object, you will get back from the function \code{fitted} also a \code{"timeSeries"} object, if you fit an object of class \code{"zoo"}, you will get back again a \code{"zoo"} object. The same holds for a \code{"numeric"} vector, for a \code{"data.frame"}, and for objects of class \code{"ts", "mts"}. In contrast, the slot itself returns independent of the class of the data input always a numceric vector, i.e. the function call r\code{slot(object, "fitted")} will return a numeric vector. } \note{ \code{residuals} is a generic function which extracts residual values from objects returned by modeling functions. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## Swiss Pension func Index - x = as.timeSeries(data(LPP2005REC)) ## garchFit fit = garchFit(LPP40 ~ garch(1, 1), data = 100*x, trace = FALSE) fit ## residuals - res = residuals(fit) head(res) class(res) ## slot - res = slot(fit, "residuals") head(res) } \keyword{models} fGarch/man/00fGarch-package.Rd0000644000176200001440000001213613202277106015434 0ustar liggesusers\name{fGarch-package} \alias{fGarch-package} \alias{fGarch} \docType{package} \title{Modelling Heterskedasticity in Financial Time Series} \description{ The Rmetrics "fGarch" package is a collection of functions to analyze and model heteroskedastic behavior in financial time series models. . } \details{ \tabular{ll}{ Package: \tab fGarch \cr Type: \tab Package\cr Version: \tab R 3.0.1\cr Date: \tab 2014\cr License: \tab GPL Version 2 or later\cr Copyright: \tab (c) 1999-2014 Rmetrics Assiciation\cr URL: \tab \url{https://www.rmetrics.org} } } \section{1 Introduction}{ GARCH, Generalized Autoregressive Conditional Heteroskedastic, models have become important in the analysis of time series data, particularly in financial applications when the goal is to analyze and forecast volatility. For this purpose, the family of GARCH functions offers functions for simulating, estimating and forecasting various univariate GARCH-type time series models in the conditional variance and an ARMA specification in the conditional mean. The function \code{garchFit} is a numerical implementation of the maximum log-likelihood approach under different assumptions, Normal, Student-t, GED errors or their skewed versions. The parameter estimates are checked by several diagnostic analysis tools including graphical features and hypothesis tests. Functions to compute n-step ahead forecasts of both the conditional mean and variance are also available. The number of GARCH models is immense, but the most influential models were the first. Beside the standard ARCH model introduced by Engle [1982] and the GARCH model introduced by Bollerslev [1986], the function \code{garchFit} also includes the more general class of asymmetric power ARCH models, named APARCH, introduced by Ding, Granger and Engle [1993]. The APARCH models include as special cases the TS-GARCH model of Taylor [1986] and Schwert [1989], the GJR-GARCH model of Glosten, Jaganathan, and Runkle [1993], the T-ARCH model of Zakoian [1993], the N-ARCH model of Higgins and Bera [1992], and the Log-ARCH model of Geweke [1986] and Pentula [1986]. There exist a collection of review articles by Bollerslev, Chou and Kroner [1992], Bera and Higgins [1993], Bollerslev, Engle and Nelson [1994], Engle [2001], Engle and Patton [2001], and Li, Ling and McAleer [2002] which give a good overview of the scope of the research.\cr } \section{2 Time Series Simulation}{ contains functions to simulate artificial GARCH and APARCH time series processes. \preformatted{ garchSpec specifies an univariate GARCH time series model garchSim simulates a GARCH/APARCH process } } \section{3 Parameter Estimation}{ contains functions to fit the parameters of GARCH and APARCH time series processes. \preformatted{ garchFit fits the parameters of a GARCH process } \emph{Extractor Functions:} \preformatted{ residuals extracts residuals from a fitted 'fGARCH' object fitted extracts fitted values from a fitted 'fGARCH' object volatility extracts conditional volatility from a fitted 'fGARCH' object coef extracts coefficients from a fitted 'fGARCH' object formula extracts formula expression from a fitted 'fGARCH' object } } \section{4 Forecasting}{ contains functions to forcecast mean and variance of GARCH and APARCH processes. \preformatted{ predict forecasts from an object of class 'fGARCH' } } \section{5 Standardized Distribution Functions}{ This section contains functions to model standardized distribution functions. \emph{Skew Normal Distribution:} \preformatted{ [dpqr]norm Normal distribution function [dpqr]snorm Skew Normal distribution function [s]normFit fits parameters of [skew] Normal distribution } \emph{Skew Generalized Error Distribution:} \preformatted{ [dpqr]ged Generalized Error distribution function [dpqr]sged Skew Generalized Error distribution function [s]gedFit fits parameters of [skew] Generalized Error distribution } \emph{Skew Standardized Student-t Distribution:} \preformatted{ [dpqr]std Standardized Student-t distribution function [dpqr]sstd Skew standardized Student-t distribution function [s]stdFit fits parameters of [skew] Student-t distribution } \emph{Abdolute Moments:} \preformatted{ absMoments computes absolute Moments of these distribution } } \section{About Rmetrics}{ The \code{fGarch} Rmetrics package is written for educational support in teaching "Computational Finance and Financial Engineering" and licensed under the GPL. } % Diethelm Wuertz and Yohan Chalabi, with contributions from % Michal Miklovac, Pierre Chausse, and Chris Boudt. \keyword{package} fGarch/man/garchSpec.Rd0000644000176200001440000001504113202277106014406 0ustar liggesusers\name{garchSpec} \alias{garchSpec} \title{Univariate GARCH Time Series Specification} \description{ Specifies an univariate GARCH time series model. } \usage{ garchSpec(model = list(), presample = NULL, cond.dist = c("norm", "ged", "std", "snorm", "sged", "sstd"), rseed = NULL) } \arguments{ \item{cond.dist}{ a character string naming the desired conditional distribution. Valid values are \code{"norm"}, \code{"ged"}, \code{"std"}, \code{"snorm"}, \code{"sged"}, \code{"sstd"}. The default value is the normal distribution. } \item{model}{ a list of GARCH model parameters: \cr \code{omega} - the constant coefficient of the variance equation, by default 1e-6; \cr \code{alpha} - the value or vector of autoregressive coefficients, by default 0.1, specifying a model of order 1; \cr \code{beta} - the value or vector of variance coefficients, by default 0.8, specifying a model of order 1; \cr The values for the linear part are: \cr \code{mu} - the mean value, by default NULL; \cr \code{ar} - the autoregressive ARMA coefficients, by default NULL; \cr \code{ma} - the moving average ARMA coefficients, by default NULL. \cr The parameters for the conditional distributions are:\cr \code{skew} - the skewness parameter (also named "xi"), by default 0.9, effective only for the \code{"dsnorm"}, the \code{"dsged"}, and the \code{"dsstd"} skewed conditional distributions; \cr \code{shape} - the shape parameter (also named "nu"), by default 2 for the \code{"dged"} and \code{"dsged"}, and by default 4 for the \code{"dstd"} and \code{"dsstd"} conditional distributions.\cr \cr Note, the default \code{model=list()} specifies Bollerslev's GARCH(1,1) model with normal conditional distributed innovations. } \item{presample}{ a numeric three column matrix with start values for the series, for the innovations, and for the conditional variances. For an ARMA(m,n)-GARCH(p,q) process the number of rows must be at least max(m,n,p,q)+1, longer presamples are cutted. Note, all presamples are initialized by a normal-GARCH(p,q) process. } \item{rseed}{ single integer argument, the seed for the intitialization of the random number generator for the innovations. Using the default value \code{rseed=NULL} then the random number generation will be started with \code{set.seed(0)}. } } \details{ The function \code{garchSpec} specifies a GARCH or APARCH time series process which we can use for simulating artificial GARCH and/or APARCH models. This is very useful for testing the GARCH parameter estimation results, since your model parameters are known and well specified. For example specifying a subet AR(5[1,5])-GARCH(2,1) model with a standardized Student-t distribution with four degrees of freedom will return the following printed output: \preformatted{ garchSpec(model = list(ar = c(0.5,0,0,0,0.1), alpha = c(0.1, 0.1), beta = 0.75, shape = 4), cond.dist = "std") Formula: ~ ar(5) + garch(2, 1) Model: ar: 0.5 0 0 0 0.1 omega: 1e-06 alpha: 0.1 0.1 beta: 0.75 Distribution: std Distributional Parameter: nu = 4 Presample: time z h y 0 0 -0.3262334 2e-05 0 -1 -1 1.3297993 2e-05 0 -2 -2 1.2724293 2e-05 0 -3 -3 0.4146414 2e-05 0 -4 -4 -1.5399500 2e-05 0 } The "Formula" describes the formula expression specifying the generating process, "Model" lists the associated model parameters, "Distribution" the type of the conditional distribution function in use, "Distributional Parmeters" lists the distributional parameter (if any), and the "Presample' shows the presample input matrix. If we have specified \code{presample=NULL} in the argument list, then the presample is generated automatically by default as norm-AR()-GARCH() process. } \value{ The returned value is an object of class \code{"fGARCHSPEC"}. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## garchSpec - # Normal Conditional Distribution: spec = garchSpec() spec # Skewed Normal Conditional Distribution: spec = garchSpec(model = list(skew = 0.8), cond.dist = "snorm") spec # Skewed GED Conditional Distribution: spec = garchSpec(model = list(skew = 0.9, shape = 4.8), cond.dist = "sged") spec ## More specifications ... # Default GARCH(1,1) - uses default parameter settings garchSpec(model = list()) # ARCH(2) - use default omega and specify alpha, set beta=0! garchSpec(model = list(alpha = c(0.2, 0.4), beta = 0)) # AR(1)-ARCH(2) - use default mu, omega garchSpec(model = list(ar = 0.5, alpha = c(0.3, 0.4), beta = 0)) # AR([1,5])-GARCH(1,1) - use default garch values and subset ar[.] garchSpec(model = list(mu = 0.001, ar = c(0.5,0,0,0,0.1))) # ARMA(1,2)-GARCH(1,1) - use default garch values garchSpec(model = list(ar = 0.5, ma = c(0.3, -0.3))) # GARCH(1,1) - use default omega and specify alpha/beta garchSpec(model = list(alpha = 0.2, beta = 0.7)) # GARCH(1,1) - specify omega/alpha/beta garchSpec(model = list(omega = 1e-6, alpha = 0.1, beta = 0.8)) # GARCH(1,2) - use default omega and specify alpha[1]/beta[2] garchSpec(model = list(alpha = 0.1, beta = c(0.4, 0.4))) # GARCH(2,1) - use default omega and specify alpha[2]/beta[1] garchSpec(model = list(alpha = c(0.12, 0.04), beta = 0.08)) # snorm-ARCH(1) - use defaults with skew Normal garchSpec(model = list(beta = 0, skew = 0.8), cond.dist = "snorm") # sged-GARCH(1,1) - using defaults with skew GED garchSpec(model = list(skew = 0.93, shape = 3), cond.dist = "sged") # Taylor Schwert GARCH(1,1) - this belongs to the family of APARCH Models garchSpec(model = list(delta = 1)) # AR(1)-t-APARCH(2, 1) - a little bit more complex specification ... garchSpec(model = list(mu = 1.0e-4, ar = 0.5, omega = 1.0e-6, alpha = c(0.10, 0.05), gamma = c(0, 0), beta = 0.8, delta = 1.8, shape = 4, skew = 0.85), cond.dist = "sstd") } \keyword{models} fGarch/man/dist-sged.Rd0000644000176200001440000000431613202277106014375 0ustar liggesusers\name{sged} \alias{sged} \alias{dsged} \alias{psged} \alias{qsged} \alias{rsged} \title{Skew Generalized Error Distribution} \description{ Functions to compute density, distribution function, quantile function and to generate random variates for the skew generalized error distribution. } \usage{ dsged(x, mean = 0, sd = 1, nu = 2, xi = 1.5, log = FALSE) psged(q, mean = 0, sd = 1, nu = 2, xi = 1.5) qsged(p, mean = 0, sd = 1, nu = 2, xi = 1.5) rsged(n, mean = 0, sd = 1, nu = 2, xi = 1.5) } \arguments{ \item{mean, sd, nu, xi}{ location parameter \code{mean}, scale parameter \code{sd}, shape parameter \code{nu}, skewness parameter \code{xi}. } \item{n}{ the number of observations. } \item{p}{ a numeric vector of probabilities. } \item{x, q}{ a numeric vector of quantiles. } \item{log}{ a logical; if TRUE, densities are given as log densities. } } \value{ \code{d*} returns the density, \code{p*} returns the distribution function, \code{q*} returns the quantile function, and \code{r*} generates random deviates, \cr all values are numeric vectors. } \references{ Nelson D.B. (1991); \emph{Conditional Heteroscedasticity in Asset Returns: A New Approach}, Econometrica, 59, 347--370. Fernandez C., Steel M.F.J. (2000); \emph{On Bayesian Modelling of Fat Tails and Skewness}, Preprint, 31 pages. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## sged - par(mfrow = c(2, 2)) set.seed(1953) r = rsged(n = 1000) plot(r, type = "l", main = "sged", col = "steelblue") # Plot empirical density and compare with true density: hist(r, n = 25, probability = TRUE, border = "white", col = "steelblue") box() x = seq(min(r), max(r), length = 201) lines(x, dsged(x), lwd = 2) # Plot df and compare with true df: plot(sort(r), (1:1000/1000), main = "Probability", col = "steelblue", ylab = "Probability") lines(x, psged(x), lwd = 2) # Compute quantiles: round(qsged(psged(q = seq(-1, 5, by = 1))), digits = 6) } \keyword{distribution} fGarch/man/methods-volatility.Rd0000644000176200001440000000561213202277106016353 0ustar liggesusers\name{volatility-methods} \docType{methods} % \alias{volatility-methods} % \alias{volatility,ANY-method} % \alias{volatility,fGARCH-method} \alias{volatility.fGARCH} \title{Extract GARCH Model Volatility} \description{ Extracts volatility from a fitted GARCH object. } \usage{ % \S4method{volatility}{fGARCH}(object, type = c("sigma", "h"), \dots) \method{volatility}{fGARCH}(object, type = c("sigma", "h"), \dots) } \arguments{ \item{object}{ an object of class \code{fGARCH} as returned from the function \code{garchFit()}. } \item{type}{ a character string denoting if the conditional standard deviations \code{"sigma"} or the variances \code{"h"} should be returned. } \item{\dots}{ additional arguments to be passed. } } \section{Methods}{ \describe{ \item{object = "ANY"}{ Generic function. } \item{object = "fGARCH"}{ Extractor function for volatility or standard deviation from an object of class \code{"fGARCH"}. } } } \details{ The function extracts the \code{@volatility} from the slots \code{@sigma.t} or \code{@h.t} of an object of class \code{"fGARCH"} as returned by the function \code{garchFit}. The class of the returned value depends on the input to the function \code{garchFit} who created the object. The returned value is always of the same class as the input object to the argument \code{data} in the function \code{garchFit}, i.e. if you fit a \code{"timeSeries"} object, you will get back from the function \code{fitted} also a \code{"timeSeries"} object, if you fit an object of class \code{"zoo"}, you will get back again a \code{"zoo"} object. The same holds for a \code{"numeric"} vector, for a \code{"data.frame"}, and for objects of class \code{"ts", "mts"}. In contrast, the slot itself returns independent of the class of the data input always a numceric vector, i.e. the function call r\code{slot(object, "fitted")} will return a numeric vector. } \note{ \code{volatility} is a generic function which extracts volatility values from objects returned by modeling functions. } \author{ Diethelm Wuertz for the Rmetrics \R-port. } \examples{ ## Swiss Pension func Index - x = as.timeSeries(data(LPP2005REC)) ## garchFit fit = garchFit(LPP40 ~ garch(1, 1), data = 100*x, trace = FALSE) fit ## volatility - # Standard Deviation: volatility = volatility(fit, type = "sigma") head(volatility) class(volatility) # Variance: volatility = volatility(fit, type = "h") head(volatility) class(volatility) ## slot - volatility = slot(fit, "sigma.t") head(volatility) class(volatility) volatility = slot(fit, "h.t") head(volatility) class(volatility) } \keyword{models}