[R] RuGarch issue

GALIB KHAN ghk18 @ending from @c@rletm@il@rutger@@edu
Fri Aug 17 21:27:05 CEST 2018


Sup guys,

Got an interesting issue with the rugarch package.

I noticed that when I changed the order of the external regressors, there
are different values for the robust coefficient matrix. The values should be
the same (according to the ordering of the variables). However, I am getting
drastically different results. At that time the model was arma(2,2) +
garch(1,0).

Is this considered a normal behavior of the rugarch package? I assume that
when you change the ordering of the external regressors the output should be
exactly the same....digit by digit.

I confirmed this issue by creating a generic script that can be tested by
anyone. Has anybody faced this issue before or is there post that describes
the issue that I am facing?

  Maybe I am going insane...for now I will look further into the
documentation that our Alexios has provided

Thanks!
  library(rugarch)


set.seed(1)

x1 <- rnorm(1000,5,1)
x2 <- rnorm(1000,3,3)

y    <- .5*(x1*x2) + rnorm(1000,1,3)
dat  <- data.frame(x1,x2,y)

var1 <- c("x1","x2")
var2 <- c("x2","x1")

# setbounds(spec)<-list(vxreg1=c(-1,1))
model_maker <- function(x_name){
  temp <- dat[,c("y",x_name)]

  spec <- ugarchspec(variance.model      = list(model = "sGARCH",
                                                garchOrder = c(1,0)),

                     mean.model          = list(armaOrder = c(2,2),
                                                external.regressors =
as.matrix(temp[,x_name]),
                                                include.mean= T),

                     distribution.model  = "std")

  fit         <- ugarchfit(spec = spec, data = as.matrix(temp$y),solver =
"hybrid")
  return(fit using fit$robust.matcoef)}

model_maker(var1)
model_maker(var2)

	[[alternative HTML version deleted]]



More information about the R-help mailing list