EGARCH

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

EGARCH

papa
Dear all,
Please, I have a problem with the function ugarchspec (R says function not found) and cannot execute the command
below. Any assistance.
ar9<-arima(next.rtdm, order=c(5,0,0))
b=acf(ar9$residuals)
specm1 <- ugarchspec(variance.model=list(model="eGARCH", garchOrder=c(2,4), submodel = NULL),
mean.model=list(armaOrder=c(5,0), include.mean=TRUE, garchInMean = TRUE))

Kind regards
Papa

        [[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: EGARCH

alexios
Please use the 'new' rugarch package which is now on CRAN (for univariate GARCH models). Also note some changes to the new ugarchspec method documented in the help files.

Regards,

Alexios

On Sep 9, 2011, at 11:28, Papa Senyo <[hidden email]> wrote:

> Dear all,
> Please, I have a problem with the function ugarchspec (R says function not found) and cannot execute the command
> below. Any assistance.
> ar9<-arima(next.rtdm, order=c(5,0,0))
> b=acf(ar9$residuals)
> specm1 <- ugarchspec(variance.model=list(model="eGARCH", garchOrder=c(2,4), submodel = NULL),
> mean.model=list(armaOrder=c(5,0), include.mean=TRUE, garchInMean = TRUE))
>
> Kind regards
> Papa
>
>    [[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.
>

_______________________________________________
[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: EGARCH

papa
Please, it seems the rugarch package is under construction now. Do anyone  have the zip file to share .
kind regards



________________________________
Da: 4dscape.com <[hidden email]>

Cc: "[hidden email]" <[hidden email]>
Inviato: Venerdì 9 Settembre 2011 13:10
Oggetto: Re: [R-SIG-Finance] EGARCH

Please use the 'new' rugarch package which is now on CRAN (for univariate GARCH models). Also note some changes to the new ugarchspec method documented in the help files.

Regards,

Alexios



> Dear all,
> Please, I have a problem with the function ugarchspec (R says function not found) and cannot execute the command
> below. Any assistance.
> ar9<-arima(next.rtdm, order=c(5,0,0))
> b=acf(ar9$residuals)
> specm1 <- ugarchspec(variance.model=list(model="eGARCH", garchOrder=c(2,4), submodel = NULL),
> mean.model=list(armaOrder=c(5,0), include.mean=TRUE, garchInMean = TRUE))
>
> Kind regards
> Papa
>
>    [[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.
>
        [[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: EGARCH

alexios
It is NOT under "construction" on CRAN:
http://cran.r-project.org/web/packages/rugarch/index.html

-Alexios


On 10/09/2011 08:33, Papa Senyo wrote:

> Please, it seems the rugarch package is under construction now. Do
> anyone have the zip file to share .
> kind regards
>
> ------------------------------------------------------------------------
> *Da:* 4dscape.com <[hidden email]>
> *A:* Papa Senyo <[hidden email]>
> *Cc:* "[hidden email]" <[hidden email]>
> *Inviato:* Venerdì 9 Settembre 2011 13:10
> *Oggetto:* Re: [R-SIG-Finance] EGARCH
>
> Please use the 'new' rugarch package which is now on CRAN (for
> univariate GARCH models). Also note some changes to the new ugarchspec
> method documented in the help files.
>
> Regards,
>
> Alexios
>
> On Sep 9, 2011, at 11:28, Papa Senyo <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>  > Dear all,
>  > Please, I have a problem with the function ugarchspec (R says
> function not found) and cannot execute the command
>  > below. Any assistance.
>  > ar9<-arima(next.rtdm, order=c(5,0,0))
>  > b=acf(ar9$residuals)
>  > specm1 <- ugarchspec(variance.model=list(model="eGARCH",
> garchOrder=c(2,4), submodel = NULL),
>  > mean.model=list(armaOrder=c(5,0), include.mean=TRUE, garchInMean = TRUE))
>  >
>  > Kind regards
>  > Papa
>  >
>  > [[alternative HTML version deleted]]
>  >
>  > _______________________________________________
>  > [hidden email] <mailto:[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.
>  >
>
>

_______________________________________________
[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: EGARCH

Liviu Andronic
Dear Alexios


On Sat, Sep 10, 2011 at 9:42 AM, alexios <[hidden email]> wrote:
> It is NOT under "construction" on CRAN:
> http://cran.r-project.org/web/packages/rugarch/index.html
>
To slightly hi-jack the thread, I have troubles building 'rugarch' on
Xubuntu. The command
install.packages("rugarch")

fails with the following last lines:
gcc -I/usr/share/R/include
-I"/usr/local/lib/R/site-library/Rcpp/include"
-I"/usr/local/lib/R/site-library/RcppArmadillo/include"   -fpic
-std=gnu99 -O3 -pipe  -g -c nig.c -o nig.o
Loading required package: fortunes
Loading required package: fortunes
/bin/bash: -c: line 1: syntax error near unexpected token `('
/bin/bash: -c: line 1: `  echo g++ -shared  -o rugarch.so
distributions.o filters.o fracdiff.o fracimport.o garchmodels.o
garchsim.o gig.o nig.o  Shan-Ho Chou: I got a question about
eigenvector. I've tried input a symmetric matrix to both R (using
eigen function) and Minitab, but the result is really different. Can
anyone tell me what's wrong with that? Bill Venables: Simple. Minitab
must be broken. Have you reported it to them?    -- Shan-Ho Chou and
Bill Venables       R-help (July 2007)
-L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp
-Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -llapack -lblas
-lgfortran -lm -lgfortran -lm -L/usr/lib64/R/lib -lR; \'
make: *** [rugarch.so] Error 1
ERROR: compilation failed for package ‘rugarch’
* removing ‘/usr/local/lib/R/site-library/rugarch’
Warning in install.packages :
  installation of package 'rugarch' had non-zero exit status

I always auto-load 'fortunes' at the beginning of an R session (the
reason for the messed up output above), but I'm not sure this would
the cause for the fail. I am also unable to build 'RcppArmadillo'
0.2.29 if that matters, so I can only build against 0.2.25. All the
other deps installed fine. Below I post my R info.

Regards
Liviu


> sessionInfo()
R version 2.13.0 (2011-04-13)
Platform: x86_64-pc-linux-gnu (64-bit)

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

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

other attached packages:
[1] Rsolnp_1.11          truncnorm_1.0-5      chron_2.3-42
numDeriv_2010.11-1
[5] RcppArmadillo_0.2.25 Rcpp_0.9.6           fortunes_1.4-1

loaded via a namespace (and not attached):
[1] tools_2.13.0

_______________________________________________
[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: EGARCH

alexios
Hi Liviu,

I'm not sure what the issue might be...I have built and tested without
problem on fedora 14 x64 and windows 7 (against RcppArmadillo 0.2.28+).

Regards,
Alexios

On 10/09/2011 12:21, Liviu Andronic wrote:

> Dear Alexios
>
>
> On Sat, Sep 10, 2011 at 9:42 AM, alexios<[hidden email]>  wrote:
>> It is NOT under "construction" on CRAN:
>> http://cran.r-project.org/web/packages/rugarch/index.html
>>
> To slightly hi-jack the thread, I have troubles building 'rugarch' on
> Xubuntu. The command
> install.packages("rugarch")
>
> fails with the following last lines:
> gcc -I/usr/share/R/include
> -I"/usr/local/lib/R/site-library/Rcpp/include"
> -I"/usr/local/lib/R/site-library/RcppArmadillo/include"   -fpic
> -std=gnu99 -O3 -pipe  -g -c nig.c -o nig.o
> Loading required package: fortunes
> Loading required package: fortunes
> /bin/bash: -c: line 1: syntax error near unexpected token `('
> /bin/bash: -c: line 1: `  echo g++ -shared  -o rugarch.so
> distributions.o filters.o fracdiff.o fracimport.o garchmodels.o
> garchsim.o gig.o nig.o  Shan-Ho Chou: I got a question about
> eigenvector. I've tried input a symmetric matrix to both R (using
> eigen function) and Minitab, but the result is really different. Can
> anyone tell me what's wrong with that? Bill Venables: Simple. Minitab
> must be broken. Have you reported it to them?    -- Shan-Ho Chou and
> Bill Venables       R-help (July 2007)
> -L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp
> -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -llapack -lblas
> -lgfortran -lm -lgfortran -lm -L/usr/lib64/R/lib -lR; \'
> make: *** [rugarch.so] Error 1
> ERROR: compilation failed for package ‘rugarch’
> * removing ‘/usr/local/lib/R/site-library/rugarch’
> Warning in install.packages :
>    installation of package 'rugarch' had non-zero exit status
>
> I always auto-load 'fortunes' at the beginning of an R session (the
> reason for the messed up output above), but I'm not sure this would
> the cause for the fail. I am also unable to build 'RcppArmadillo'
> 0.2.29 if that matters, so I can only build against 0.2.25. All the
> other deps installed fine. Below I post my R info.
>
> Regards
> Liviu
>
>
>> sessionInfo()
> R version 2.13.0 (2011-04-13)
> Platform: x86_64-pc-linux-gnu (64-bit)
>
> locale:
>   [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
> LC_TIME=en_US.UTF-8
>   [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=C
> LC_MESSAGES=en_US.UTF-8
>   [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
> LC_ADDRESS=C
> [10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8
> LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] Rsolnp_1.11          truncnorm_1.0-5      chron_2.3-42
> numDeriv_2010.11-1
> [5] RcppArmadillo_0.2.25 Rcpp_0.9.6           fortunes_1.4-1
>
> loaded via a namespace (and not attached):
> [1] tools_2.13.0
>
>

_______________________________________________
[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: EGARCH

Dirk Eddelbuettel
In reply to this post by Liviu Andronic

On 10 September 2011 at 13:21, Liviu Andronic wrote:
| Dear Alexios
|
|
| On Sat, Sep 10, 2011 at 9:42 AM, alexios <[hidden email]> wrote:
| > It is NOT under "construction" on CRAN:
| > http://cran.r-project.org/web/packages/rugarch/index.html
| >
| To slightly hi-jack the thread, I have troubles building 'rugarch' on
| Xubuntu. The command

That _must_ be your local problem. Fundamentally, Xubuntu is no different
from all the Debian systems that e.g. CRAN's checks or R-Forge run on.

| install.packages("rugarch")
|
| fails with the following last lines:
| gcc -I/usr/share/R/include
| -I"/usr/local/lib/R/site-library/Rcpp/include"
| -I"/usr/local/lib/R/site-library/RcppArmadillo/include"   -fpic
| -std=gnu99 -O3 -pipe  -g -c nig.c -o nig.o
| Loading required package: fortunes
| Loading required package: fortunes
| /bin/bash: -c: line 1: syntax error near unexpected token `('
| /bin/bash: -c: line 1: `  echo g++ -shared  -o rugarch.so
| distributions.o filters.o fracdiff.o fracimport.o garchmodels.o
| garchsim.o gig.o nig.o  Shan-Ho Chou: I got a question about
| eigenvector. I've tried input a symmetric matrix to both R (using
| eigen function) and Minitab, but the result is really different. Can
| anyone tell me what's wrong with that? Bill Venables: Simple. Minitab
| must be broken. Have you reported it to them?    -- Shan-Ho Chou and
| Bill Venables       R-help (July 2007)
| -L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp
| -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -llapack -lblas
| -lgfortran -lm -lgfortran -lm -L/usr/lib64/R/lib -lR; \'
| make: *** [rugarch.so] Error 1
| ERROR: compilation failed for package ‘rugarch’
| * removing ‘/usr/local/lib/R/site-library/rugarch’
| Warning in install.packages :
|   installation of package 'rugarch' had non-zero exit status
|
| I always auto-load 'fortunes' at the beginning of an R session (the

Don't do that.  Some of the Rcpp-related build scripts (such as RcppArmadillo
and hence rugarch) need to ask R where the given package directory is in
order to link against.

If you send unconditional output, it messes this up.

If you really need fortunes displayed, protect it inside

    if (interactive()) {
        require(fortunes)
        ...
    }

or something.

Dirk

| reason for the messed up output above), but I'm not sure this would
| the cause for the fail. I am also unable to build 'RcppArmadillo'
| 0.2.29 if that matters, so I can only build against 0.2.25. All the
| other deps installed fine. Below I post my R info.
|
| Regards
| Liviu
|
|
| > sessionInfo()
| R version 2.13.0 (2011-04-13)
| Platform: x86_64-pc-linux-gnu (64-bit)
|
| locale:
|  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
| LC_TIME=en_US.UTF-8
|  [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=C
| LC_MESSAGES=en_US.UTF-8
|  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
| LC_ADDRESS=C
| [10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8
| LC_IDENTIFICATION=C
|
| attached base packages:
| [1] stats     graphics  grDevices utils     datasets  methods   base
|
| other attached packages:
| [1] Rsolnp_1.11          truncnorm_1.0-5      chron_2.3-42
| numDeriv_2010.11-1
| [5] RcppArmadillo_0.2.25 Rcpp_0.9.6           fortunes_1.4-1
|
| loaded via a namespace (and not attached):
| [1] tools_2.13.0
|
| _______________________________________________
| [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.
--
Two new Rcpp master classes for R and C++ integration scheduled for
New York (Sep 24) and San Francisco (Oct 8), more details are at
http://dirk.eddelbuettel.com/blog/2011/08/04#rcpp_classes_2011-09_and_2011-10
http://www.revolutionanalytics.com/products/training/public/rcpp-master-class.php

_______________________________________________
[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
|

VaR: results unreliable

papa
In reply to this post by alexios
Dear All

Please,my results using standardized residuals for VaR produced unreliable results .Need some assistance?
model1 <- ugarchfit(data = matrix(res.ar1), spec = spec3, out.sample = 0, solver = "nlminb",
  solver.control = list(),
  fit.control = list(stationarity = 1, fixed.se = 0, scale = 0))
a<-residuals(model1)
a
b<-fitted(model1)
c<-a/b
d<-matrix(c)
e<-as.xts(d,as.Date(13301:14174,origin="1970-01-01"))
  library(PerformanceAnalytics)
       VaR(e, p=.99, method="historical",portfolio="single")

VaR calculation produces unreliable result (risk over 100%) for column: 1 : 177.289365852222
    [,1]
VaR  
 -1

Kind regards
Papa





e<-as.xts(d,as.Date(13301:14174,origin="1970-01-01"))
  library(PerformanceAnalytics)
        [[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: VaR: results unreliable

braverock
On Sun, 2011-09-11 at 09:05 +0100, Papa Senyo wrote:
> Dear All
>
> Please,my results using standardized residuals for VaR produced
> unreliable results .Need some assistance?

Thank you for including your code, but you'll also need to include (or
link to) your data for us to evaluate why you are getting the answer you
are getting.  It is not a reproducible example without the data set.

On Sun, 2011-09-11 at 09:05 +0100, Papa Senyo wrote:
> VaR calculation produces unreliable result (risk over 100%) for
> column: 1 : 177.289365852222
>  [,1]
> VaR
>  -1

Without seeing your data, I can only guess.

One possible reason is that you are acting on prices and not returns.
As stated clearly in the PerformanceAnalytics documentation, the VaR
function uses returns, not prices.
 
Regards,

  - Brian

--
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock

_______________________________________________
[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: VaR: results unreliable

alexios
What exactly does residuals(model1)/fitted(model1) represent?
If you want the standardized residuals then that would be:
residuals(model1)/sigma(model1).
The documentation clearly states what each method on the fitted object
represents (i.e. fitted returns the conditional mean, sigma the
conditional standard deviation etc).

Regards,
Alexios


On 11/09/2011 10:17, Brian G. Peterson wrote:

> On Sun, 2011-09-11 at 09:05 +0100, Papa Senyo wrote:
>> Dear All
>>
>> Please,my results using standardized residuals for VaR produced
>> unreliable results .Need some assistance?
>
> Thank you for including your code, but you'll also need to include (or
> link to) your data for us to evaluate why you are getting the answer you
> are getting.  It is not a reproducible example without the data set.
>
> On Sun, 2011-09-11 at 09:05 +0100, Papa Senyo wrote:
>> VaR calculation produces unreliable result (risk over 100%) for
>> column: 1 : 177.289365852222
>>   [,1]
>> VaR
>>   -1
>
> Without seeing your data, I can only guess.
>
> One possible reason is that you are acting on prices and not returns.
> As stated clearly in the PerformanceAnalytics documentation, the VaR
> function uses returns, not prices.
>
> Regards,
>
>    - Brian
>

_______________________________________________
[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: EGARCH

Liviu Andronic
In reply to this post by Dirk Eddelbuettel
On Sat, Sep 10, 2011 at 3:09 PM, Dirk Eddelbuettel <[hidden email]> wrote:

> Don't do that.  Some of the Rcpp-related build scripts (such as RcppArmadillo
> and hence rugarch) need to ask R where the given package directory is in
> order to link against.
>
> If you send unconditional output, it messes this up.
>
> If you really need fortunes displayed, protect it inside
>
>    if (interactive()) {
>        require(fortunes)
>        ...
>    }
>
Nice catch, thanks! I wish it were included in the default
Rprofile.site as an example. Now both rugarch and RcppArmadillo
compile just fine.

Regards
Liviu

_______________________________________________
[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
|

rugarch:out of sample

papa
In reply to this post by alexios
Dear all,


How is the specification of the out of sample done if one wants to carry out the out of sample analysis using the rugarch.
by default out.sample=0
Kind regards
Papa

        [[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:out of sample

alexios
1. Please go through the documentation and extensive examples in the
inst folder of the package.
2. If after doing so you have not understood something or suspect a bug,
put all you questions in ONE email to the list (for usage questions) or
the developer (if related to a suspected bug) with a minimally
REPRODUCIBLE example.

Thanks,
Alexios

On 24/11/2011 11:30, Papa Senyo wrote:
> Dear all,
>
> How is the specification of the out of sample done if one wants to carry
> out the out of sample analysis using the rugarch.
> by default out.sample=0
> Kind regards
> Papa

_______________________________________________
[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.