Re: rugarch teste

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: rugarch teste

Rafael Bressan
I'm having a problem of convergence with rugarch, trying to fit an
eGARCH(2,1).
I've tried other models, not having out.sample option on, different time
frames, and other time series too. Everything fails to converge ON UBUNTU
17.04.

I stress ubuntu 17.04 because the same code, with the same time series,
works perfectly in the same machine with windows 10 and another one running
Ubuntu 16.04LTS 32-bit.

R version is 3.4.2 (.1 for windows)
rugarch version 1.3-8
Everything running on RStudio Version 1.1.383

I'd like it running in my laptop with 17.04, since it's my "to go"
equipment, and I really prefer to use R in linux rather than in windows.

Could someone, please,  help me to discover and fix this problem?

Below is the simple R code and the 3 sessionInfo(). My csv is taken from
Yahoo! Finance and can be any index, it's not working with BVSP, GSPC,
IPSA, etc.

library(rugarch)
library(PerformanceAnalytics)
library(xts)

tb <- read.csv("./Documentos/UDESC/mefca/artigo-IPSA.csv", stringsAsFactors
= FALSE)
prices <- as.xts(read.zoo(tb, format = "%Y-%m-%d", FUN = as.Date))
losses <- -100*na.omit(Return.calculate(prices$Adj.Close, method = "log"))

ruspec <- ugarchspec(mean.model = list(armaOrder = c(1,0)),
                     variance.model = list(model = "eGARCH", garchOrder =
c(2,1)),
                     distribution.model = "sstd")

fit <- ugarchfit(ruspec, losses, solver = "hybrid")

Warning message:
In .egarchfit(spec = spec, data = data, out.sample = out.sample,  :
ugarchfit-->warning: solver failer to converge.

R version 3.4.2 (2017-09-28)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 17.04

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.7.0
LAPACK: /usr/lib/lapack/liblapack.so.3.7.0

locale:
 [1] LC_CTYPE=pt_BR.UTF-8       LC_NUMERIC=C
LC_TIME=pt_BR.UTF-8        LC_COLLATE=pt_BR.UTF-8
 [5] LC_MONETARY=pt_BR.UTF-8    LC_MESSAGES=pt_BR.UTF-8
LC_PAPER=pt_BR.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
LC_MEASUREMENT=pt_BR.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods
base

other attached packages:
[1] PerformanceAnalytics_1.4.3541 xts_0.10-0
zoo_1.8-0
[4] rugarch_1.3-8

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.13                magrittr_1.5
knitr_1.17
 [4] misc3d_0.8-4                xtable_1.8-2
lattice_0.20-35
 [7] R6_2.2.2                    FNN_1.1
Rsolnp_1.16
[10] GeneralizedHyperbolic_0.8-1 SkewHyperbolic_0.3-2
tools_3.4.2
[13] spd_2.0-1                   grid_3.4.2
KernSmooth_2.23-15
[16] htmltools_0.3.6             yaml_2.1.14
digest_0.6.12
[19] rgl_0.98.1                  numDeriv_2016.8-1
Matrix_1.2-11
[22] shiny_1.0.5                 nloptr_1.0.4
DistributionUtils_0.5-1
[25] ks_1.10.7                   htmlwidgets_0.9
codetools_0.2-15
[28] mime_0.5                    compiler_3.4.2
multicool_0.1-10
[31] expm_0.999-2                jsonlite_1.5
truncnorm_1.0-7
[34] mvtnorm_1.0-6               httpuv_1.3.5

R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=Portuguese_Brazil.1252  LC_CTYPE=Portuguese_Brazil.1252
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Brazil.1252

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets
methods   base

other attached packages:
[1] PerformanceAnalytics_1.4.3541 xts_0.10-0
zoo_1.8-0
[4] rugarch_1.3-8

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.13                magrittr_1.5
knitr_1.17
 [4] misc3d_0.8-4                xtable_1.8-2
lattice_0.20-35
 [7] R6_2.2.2                    FNN_1.1
Rsolnp_1.16
[10] GeneralizedHyperbolic_0.8-1 SkewHyperbolic_0.3-2
tools_3.4.1
[13] spd_2.0-1                   grid_3.4.1
KernSmooth_2.23-15
[16] htmltools_0.3.6             yaml_2.1.14
digest_0.6.12
[19] rgl_0.98.1                  numDeriv_2016.8-1
Matrix_1.2-10
[22] shiny_1.0.5                 nloptr_1.0.4
DistributionUtils_0.5-1
[25] ks_1.10.7                   htmlwidgets_0.8
codetools_0.2-15
[28] mime_0.5                    compiler_3.4.1
multicool_0.1-10
[31] expm_0.999-2                jsonlite_1.5
truncnorm_1.0-7
[34] mvtnorm_1.0-6               httpuv_1.3.5


R version 3.4.2 (2017-09-28)
Platform: i686-pc-linux-gnu (32-bit)
Running under: Ubuntu 16.04.3 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

locale:
 [1] LC_CTYPE=pt_BR.UTF-8       LC_NUMERIC=C
LC_TIME=pt_BR.UTF-8
 [4] LC_COLLATE=pt_BR.UTF-8     LC_MONETARY=pt_BR.UTF-8
LC_MESSAGES=pt_BR.UTF-8
 [7] LC_PAPER=pt_BR.UTF-8       LC_NAME=C
LC_ADDRESS=C
[10] LC_TELEPHONE=C             LC_MEASUREMENT=pt_BR.UTF-8
LC_IDENTIFICATION=C

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods
base

other attached packages:
[1] PerformanceAnalytics_1.4.3541 xts_0.10-0
zoo_1.8-0
[4] rugarch_1.3-8

loaded via a namespace (and not attached):
 [1] ggplot2_2.2.1               lattice_0.20-35
compiler_3.4.2
 [4] htmlwidgets_0.9             xtable_1.8-2
Rcpp_0.12.13
 [7] shiny_1.0.3                 plyr_1.8.4
tools_3.4.2
[10] DistributionUtils_0.5-1     SkewHyperbolic_0.3-2
truncnorm_1.0-7
[13] R6_2.2.2                    knitr_1.17
scales_0.5.0
[16] spd_2.0-1                   multicool_0.1-10
rgl_0.98.1
[19] digest_0.6.12               gtable_0.2.0
mime_0.5
[22] numDeriv_2016.8-1           KernSmooth_2.23-15
Matrix_1.2-11
[25] ks_1.10.7                   htmltools_0.3.6
misc3d_0.8-4
[28] munsell_0.4.3               grid_3.4.2
colorspace_1.3-2
[31] FNN_1.1                     httpuv_1.3.5
rlang_0.1.2
[34] Rsolnp_1.16                 nloptr_1.0.4
magrittr_1.5
[37] GeneralizedHyperbolic_0.8-1 lazyeval_0.2.0
yaml_2.1.14
[40] mvtnorm_1.0-6               codetools_0.2-15
jsonlite_1.5
[43] tibble_1.3.4                expm_0.999-2



2017-11-21 16:27 GMT-02:00 Rafael Bressan <[hidden email]>:

> library(rugarch)
> library(PerformanceAnalytics)
> library(xts)
>
> tb <- read.csv("./Documentos/UDESC/mefca/artigo-IPSA.csv",
> stringsAsFactors = FALSE)
> prices <- as.xts(read.zoo(tb, format = "%Y-%m-%d", FUN = as.Date))
> losses <- -100*na.omit(Return.calculate(prices$Adj.Close, method = "log"))
>
> ruspec <- ugarchspec(mean.model = list(armaOrder = c(1,0)),
>                      variance.model = list(model = "eGARCH", garchOrder =
> c(2,1)),
>                      distribution.model = "sstd")
>
> fit <- ugarchfit(ruspec, losses, solver = "hybrid")
>
>

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
Reply | Threaded
Open this post in threaded view
|

Re: rugarch teste

Rafael Bressan
Did the obvious and it worked. Remove and reinstall the package (rugarch
only).
Although, no clue why it was not converging before .

2017-11-21 17:34 GMT-02:00 Rafael Bressan <[hidden email]>:

> I'm having a problem of convergence with rugarch, trying to fit an
> eGARCH(2,1).
> I've tried other models, not having out.sample option on, different time
> frames, and other time series too. Everything fails to converge ON UBUNTU
> 17.04.
>
> I stress ubuntu 17.04 because the same code, with the same time series,
> works perfectly in the same machine with windows 10 and another one running
> Ubuntu 16.04LTS 32-bit.
>
> R version is 3.4.2 (.1 for windows)
> rugarch version 1.3-8
> Everything running on RStudio Version 1.1.383
>
> I'd like it running in my laptop with 17.04, since it's my "to go"
> equipment, and I really prefer to use R in linux rather than in windows.
>
> Could someone, please,  help me to discover and fix this problem?
>
> Below is the simple R code and the 3 sessionInfo(). My csv is taken from
> Yahoo! Finance and can be any index, it's not working with BVSP, GSPC,
> IPSA, etc.
>
> library(rugarch)
> library(PerformanceAnalytics)
> library(xts)
>
> tb <- read.csv("./Documentos/UDESC/mefca/artigo-IPSA.csv",
> stringsAsFactors = FALSE)
> prices <- as.xts(read.zoo(tb, format = "%Y-%m-%d", FUN = as.Date))
> losses <- -100*na.omit(Return.calculate(prices$Adj.Close, method = "log"))
>
> ruspec <- ugarchspec(mean.model = list(armaOrder = c(1,0)),
>                      variance.model = list(model = "eGARCH", garchOrder =
> c(2,1)),
>                      distribution.model = "sstd")
>
> fit <- ugarchfit(ruspec, losses, solver = "hybrid")
>
> Warning message:
> In .egarchfit(spec = spec, data = data, out.sample = out.sample,  :
> ugarchfit-->warning: solver failer to converge.
>
> R version 3.4.2 (2017-09-28)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 17.04
>
> Matrix products: default
> BLAS: /usr/lib/libblas/libblas.so.3.7.0
> LAPACK: /usr/lib/lapack/liblapack.so.3.7.0
>
> locale:
>  [1] LC_CTYPE=pt_BR.UTF-8       LC_NUMERIC=C
> LC_TIME=pt_BR.UTF-8        LC_COLLATE=pt_BR.UTF-8
>  [5] LC_MONETARY=pt_BR.UTF-8    LC_MESSAGES=pt_BR.UTF-8
> LC_PAPER=pt_BR.UTF-8       LC_NAME=C
>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
> LC_MEASUREMENT=pt_BR.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] parallel  stats     graphics  grDevices utils     datasets  methods
> base
>
> other attached packages:
> [1] PerformanceAnalytics_1.4.3541 xts_0.10-0
> zoo_1.8-0
> [4] rugarch_1.3-8
>
> loaded via a namespace (and not attached):
>  [1] Rcpp_0.12.13                magrittr_1.5
> knitr_1.17
>  [4] misc3d_0.8-4                xtable_1.8-2
> lattice_0.20-35
>  [7] R6_2.2.2                    FNN_1.1
> Rsolnp_1.16
> [10] GeneralizedHyperbolic_0.8-1 SkewHyperbolic_0.3-2
> tools_3.4.2
> [13] spd_2.0-1                   grid_3.4.2
> KernSmooth_2.23-15
> [16] htmltools_0.3.6             yaml_2.1.14
> digest_0.6.12
> [19] rgl_0.98.1                  numDeriv_2016.8-1
> Matrix_1.2-11
> [22] shiny_1.0.5                 nloptr_1.0.4
> DistributionUtils_0.5-1
> [25] ks_1.10.7                   htmlwidgets_0.9
> codetools_0.2-15
> [28] mime_0.5                    compiler_3.4.2
> multicool_0.1-10
> [31] expm_0.999-2                jsonlite_1.5
> truncnorm_1.0-7
> [34] mvtnorm_1.0-6               httpuv_1.3.5
>
> R version 3.4.1 (2017-06-30)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows >= 8 x64 (build 9200)
>
> Matrix products: default
>
> locale:
> [1] LC_COLLATE=Portuguese_Brazil.1252  LC_CTYPE=Portuguese_Brazil.1252
> [3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C
> [5] LC_TIME=Portuguese_Brazil.1252
>
> attached base packages:
> [1] parallel  stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] PerformanceAnalytics_1.4.3541 xts_0.10-0                    zoo_1.8-0
> [4] rugarch_1.3-8
>
> loaded via a namespace (and not attached):
>  [1] Rcpp_0.12.13                magrittr_1.5                knitr_1.17
>  [4] misc3d_0.8-4                xtable_1.8-2                lattice_0.20-35
>  [7] R6_2.2.2                    FNN_1.1                     Rsolnp_1.16
> [10] GeneralizedHyperbolic_0.8-1 SkewHyperbolic_0.3-2        tools_3.4.1
> [13] spd_2.0-1                   grid_3.4.1                  KernSmooth_2.23-15
> [16] htmltools_0.3.6             yaml_2.1.14                 digest_0.6.12
> [19] rgl_0.98.1                  numDeriv_2016.8-1           Matrix_1.2-10
> [22] shiny_1.0.5                 nloptr_1.0.4                DistributionUtils_0.5-1
> [25] ks_1.10.7                   htmlwidgets_0.8             codetools_0.2-15
> [28] mime_0.5                    compiler_3.4.1              multicool_0.1-10
> [31] expm_0.999-2                jsonlite_1.5                truncnorm_1.0-7
> [34] mvtnorm_1.0-6               httpuv_1.3.5
>
>
> R version 3.4.2 (2017-09-28)
> Platform: i686-pc-linux-gnu (32-bit)
> Running under: Ubuntu 16.04.3 LTS
>
> Matrix products: default
> BLAS: /usr/lib/libblas/libblas.so.3.6.0
> LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
>
> locale:
>  [1] LC_CTYPE=pt_BR.UTF-8       LC_NUMERIC=C
> LC_TIME=pt_BR.UTF-8
>  [4] LC_COLLATE=pt_BR.UTF-8     LC_MONETARY=pt_BR.UTF-8
> LC_MESSAGES=pt_BR.UTF-8
>  [7] LC_PAPER=pt_BR.UTF-8       LC_NAME=C
> LC_ADDRESS=C
> [10] LC_TELEPHONE=C             LC_MEASUREMENT=pt_BR.UTF-8
> LC_IDENTIFICATION=C
>
> attached base packages:
> [1] parallel  stats     graphics  grDevices utils     datasets  methods
> base
>
> other attached packages:
> [1] PerformanceAnalytics_1.4.3541 xts_0.10-0
> zoo_1.8-0
> [4] rugarch_1.3-8
>
> loaded via a namespace (and not attached):
>  [1] ggplot2_2.2.1               lattice_0.20-35
> compiler_3.4.2
>  [4] htmlwidgets_0.9             xtable_1.8-2
> Rcpp_0.12.13
>  [7] shiny_1.0.3                 plyr_1.8.4
> tools_3.4.2
> [10] DistributionUtils_0.5-1     SkewHyperbolic_0.3-2
> truncnorm_1.0-7
> [13] R6_2.2.2                    knitr_1.17
> scales_0.5.0
> [16] spd_2.0-1                   multicool_0.1-10
> rgl_0.98.1
> [19] digest_0.6.12               gtable_0.2.0
> mime_0.5
> [22] numDeriv_2016.8-1           KernSmooth_2.23-15
> Matrix_1.2-11
> [25] ks_1.10.7                   htmltools_0.3.6
> misc3d_0.8-4
> [28] munsell_0.4.3               grid_3.4.2
> colorspace_1.3-2
> [31] FNN_1.1                     httpuv_1.3.5
> rlang_0.1.2
> [34] Rsolnp_1.16                 nloptr_1.0.4
> magrittr_1.5
> [37] GeneralizedHyperbolic_0.8-1 lazyeval_0.2.0
> yaml_2.1.14
> [40] mvtnorm_1.0-6               codetools_0.2-15
> jsonlite_1.5
> [43] tibble_1.3.4                expm_0.999-2
>
>
>
> 2017-11-21 16:27 GMT-02:00 Rafael Bressan <[hidden email]>:
>
>> library(rugarch)
>> library(PerformanceAnalytics)
>> library(xts)
>>
>> tb <- read.csv("./Documentos/UDESC/mefca/artigo-IPSA.csv",
>> stringsAsFactors = FALSE)
>> prices <- as.xts(read.zoo(tb, format = "%Y-%m-%d", FUN = as.Date))
>> losses <- -100*na.omit(Return.calculate(prices$Adj.Close, method =
>> "log"))
>>
>> ruspec <- ugarchspec(mean.model = list(armaOrder = c(1,0)),
>>                      variance.model = list(model = "eGARCH", garchOrder =
>> c(2,1)),
>>                      distribution.model = "sstd")
>>
>> fit <- ugarchfit(ruspec, losses, solver = "hybrid")
>>
>>
>

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.