[R-SIG-Finance] Demean or not to demean

alexios ghalanos alexios at 4dscape.com
Wed Aug 12 10:54:45 CEST 2015


The mean is estimated using maximum likelihood when include.mean=TRUE,
else it is zero (that should be clear from the vignette).

As to the assumptions on zero mean residuals, any
econometric/statistical reference should
answer that.

Alexios


On 12/08/2015 09:48, Gareth McEwan wrote:
> If one specifies "include.mean = TRUE" in "ugarchspec", does the
> "ugarchfit" function then use that (conditional mean) estimate to
> center/demean the innovations before subsequently fitting the GARCH
> portion of the model?
> 
> Moreover, I'm trying to 
> (1) understand the consequences/disadvantages of not demeaning the data
> prior to passing through to the GARCH routine, i.e., 
> 
> (2) what effects take place when setting "include.mean = FALSE" in the
> "mean.model" specification
> 
> Many thanks
> Gareth
> 
> 
> 
> Refer:
> On 11/08/2015 10:33, Gareth McEwan wrote:
> 
>     Hi all
> 
>     I was hoping someone could shed light or direct me to a resource (or
>     two)
>     regarding a "demean" question.
> 
>     As I understand, QMLEs estimated on "demeaned" log return data vs
>     straight
>     "log return" data behave quite differently in finite samples
>     (particularly
>     for nonlinear MA models where the MA parameter is of interest).
>     Apparently,
>     for linear AR models, demeaning data does not seriously affect
>     estimation
>     of non-intercept parameters (refer: Yong Bao "Should We Demean Data?").
> 
>     For monthly financial log return data, I find ARMA specifications
>     are not
>     significant, but some sample *means *ARE significant, while others
>     are not.
>     In either case, I add the GARCH model specification with various error
>     distributions from the "rugarch" package.
> 
>     Code example:
>     x.log.ret = diff(log(price.x) #i.e. not "demeaned"
>     spec <- ugarchspec(variance.model=list(model="sGARCH",garchOrder=c(1,1),
>                
>      submodel=NULL,external.regressors=NULL,variance.targeting=F),
>                  mean.model=list(*armaOrder = c(0,0)*,* include.mean = T*,
>     external.regressors=NULL),
>                  distribution.model="std")
>     tempgarch <- ugarchfit(spec=spec,data=x.log.ret,solver="hybrid")
> 
>     I work through the steps necessary to fitting a *t*Copula from which to
>     simulate and ultimately work my way back to simulated returns.
> 
>     The goal here is to extract from the matrix of simulated returns those
>     groups of returns coinciding with certain pre-determined
>     "scenarios". These
>     are then used for portfolio optimization.
> 
>     In the "global respect" of the methodology, can anyone shed light on the
>     merits/demerits of not first demeaning the data? I haven't found any
>     glaring problems, but it bothers me that the "rugarch" package
>     operates on
>     demeaned data.
> 
> 
> The rugarch package does NOT operate on demeaned data. It offers the
> option (default=TRUE) through "include.mean" on whether to demean the
> data or not. In case you are not demeaning, then the data are passed
> straight to the GARCH routine and assumed as the zero-mean residuals.
> 
> On Wed, Aug 12, 2015 at 10:37 AM, Gareth McEwan <mcewan.gareth at gmail.com
> <mailto:mcewan.gareth at gmail.com>> wrote:
> 
>     Hmmm, I did, initially (to R-sig-finance email address).
> 
>     You then replied (which I thought would address the R-sig-finance
>     group), and me to your reply (also thinking it would address the group).
> 
>     I'll double check..
> 
>     On Wed, Aug 12, 2015 at 10:34 AM, alexios ghalanos
>     <alexios at 4dscape.com <mailto:alexios at 4dscape.com>> wrote:
> 
>         You should post your question to the mailing list.
> 
>         A.
> 
>         On 12/08/2015 09:30, Gareth McEwan wrote:
>         > Sorry to keep bothering you Alexios (I know you're busy).
>         >
>         > Referring to my most recent response: if one specifies "include.mean =
>         > TRUE" in "ugarchspec", does the "ugarchfit" function use that
>         > (unconditional mean?) estimate to center/demean the innovations?
>         >
>         > I'm trying to understand how the "include.mean = T" is used in fitting
>         > the model.
>         >
>         > Many thanks
>         > Gareth
>         >
>         >
>         > On Tue, Aug 11, 2015 at 1:22 PM, Gareth McEwan <mcewan.gareth at gmail.com <mailto:mcewan.gareth at gmail.com>
>         > <mailto:mcewan.gareth at gmail.com <mailto:mcewan.gareth at gmail.com>>> wrote:
>         >
>         >     Hi Alexios
>         >
>         >     Is it correct then to say that by specifying "include.mean = TRUE"
>         >     in "ugarchspec", the "ugarchfit" function uses that (unconditional
>         >     mean) estimate to demean the data before subsequently fitting the
>         >     GARCH portion of the model?
>         >
>         >     Many thanks
>         >     Gareth
>         >
>         >
>         >
>         >     On Tue, Aug 11, 2015 at 12:02 PM, alexios <alexios at 4dscape.com <mailto:alexios at 4dscape.com>
>         >     <mailto:alexios at 4dscape.com <mailto:alexios at 4dscape.com>>>
>         wrote:
>         >
>         >         On 11/08/2015 10:33, Gareth McEwan wrote:
>         >
>         >             Hi all
>         >
>         >             I was hoping someone could shed light or direct me
>         to a
>         >             resource (or two)
>         >             regarding a "demean" question.
>         >
>         >             As I understand, QMLEs estimated on "demeaned" log
>         return
>         >             data vs straight
>         >             "log return" data behave quite differently in
>         finite samples
>         >             (particularly
>         >             for nonlinear MA models where the MA parameter is of
>         >             interest). Apparently,
>         >             for linear AR models, demeaning data does not
>         seriously
>         >             affect estimation
>         >             of non-intercept parameters (refer: Yong Bao
>         "Should We
>         >             Demean Data?").
>         >
>         >             For monthly financial log return data, I find ARMA
>         >             specifications are not
>         >             significant, but some sample *means *ARE
>         significant, while
>         >             others are not.
>         >             In either case, I add the GARCH model
>         specification with
>         >             various error
>         >             distributions from the "rugarch" package.
>         >
>         >             Code example:
>         >             x.log.ret = diff(log(price.x) #i.e. not "demeaned"
>         >             spec <-
>         >           
>          ugarchspec(variance.model=list(model="sGARCH",garchOrder=c(1,1),
>         >
>         >             
>         submodel=NULL,external.regressors=NULL,variance.targeting=F),
>         >                          mean.model=list(*armaOrder = c(0,0)*,*
>         >             include.mean = T*,
>         >             external.regressors=NULL),
>         >                          distribution.model="std")
>         >             tempgarch <-
>         ugarchfit(spec=spec,data=x.log.ret,solver="hybrid")
>         >
>         >             I work through the steps necessary to fitting a
>         *t*Copula
>         >             from which to
>         >             simulate and ultimately work my way back to
>         simulated returns.
>         >
>         >             The goal here is to extract from the matrix of
>         simulated
>         >             returns those
>         >             groups of returns coinciding with certain
>         pre-determined
>         >             "scenarios". These
>         >             are then used for portfolio optimization.
>         >
>         >             In the "global respect" of the methodology, can
>         anyone shed
>         >             light on the
>         >             merits/demerits of not first demeaning the data? I
>         haven't
>         >             found any
>         >             glaring problems, but it bothers me that the "rugarch"
>         >             package operates on
>         >             demeaned data.
>         >
>         >
>         >         The rugarch package does NOT operate on demeaned data.
>         It offers
>         >         the option (default=TRUE) through "include.mean" on
>         whether to
>         >         demean the data or not. In case you are not demeaning,
>         then the
>         >         data are passed straight to the GARCH routine and
>         assumed as the
>         >         zero-mean residuals.
>         >
>         >
>         >
>         >             Thank you very much for the help
>         >             Gareth
>         >
>         >
>         >         Alexios
>         >
>         >
>         >
> 
> 
>



More information about the R-SIG-Finance mailing list