[Gogarch-commits] r13 - in pkg: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jan 27 21:18:28 CET 2009


Author: bpfaff
Date: 2009-01-27 21:18:28 +0100 (Tue, 27 Jan 2009)
New Revision: 13

Added:
   pkg/R/All-classes.R
   pkg/R/All-generics.R
   pkg/R/GoGARCH-show.R
   pkg/R/Goestml-goest.R
   pkg/R/Orthom-M.R
   pkg/R/Orthom-t.R
   pkg/R/gogarch.R
   pkg/R/gotheta.R
   pkg/man/GoGARCH-class.Rd
   pkg/man/Goestml-class.Rd
   pkg/man/goest-methods.Rd
   pkg/man/gogarch.Rd
   pkg/man/gotheta.Rd
Modified:
   pkg/DESCRIPTION
   pkg/NAMESPACE
   pkg/R/Goinit-class.R
   pkg/R/Goinit-show.R
   pkg/R/Orthom-class.R
   pkg/R/gollh.R
   pkg/man/Orthom-class.Rd
   pkg/man/gollh.Rd
Log:
Classes, methods and functions added.


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2009-01-25 13:28:37 UTC (rev 12)
+++ pkg/DESCRIPTION	2009-01-27 20:18:28 UTC (rev 13)
@@ -1,8 +1,8 @@
 Package: gogarch
-Version: 0.0-9
+Version: 0.1-6
 Type: Package
 Title: Generalized Orthogonal GARCH (GO-GARCH) models
-Date: 2009-01-25
+Date: 2009-01-27
 Author: Bernhard Pfaff
 Maintainer: Bernhard Pfaff <bernhard at pfaffikus.de>
 Depends: R (>= 2.7.0), methods, fGarch

Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE	2009-01-25 13:28:37 UTC (rev 12)
+++ pkg/NAMESPACE	2009-01-27 20:18:28 UTC (rev 13)
@@ -2,10 +2,11 @@
 import(methods)
 
 ## Functions
-export(goinit, gollh, Rd2, UprodR, unvech, validOrthomObject, validGoinitObject)
+export(goest, gogarch, goinit, gollh, gotheta, M, Rd2, t, UprodR, unvech, validOrthomObject, validGoinitObject)
 
 ## Classes       
-exportClasses("Goinit", "Orthom")
+exportClasses("Goestml", "GoGARCH", "Goinit", "Orthom")
 
 ## Methods
-exportMethods("show", "print")
+exportMethods("goest", "M", "print", "show", "t")
+

Added: pkg/R/All-classes.R
===================================================================
--- pkg/R/All-classes.R	                        (rev 0)
+++ pkg/R/All-classes.R	2009-01-27 20:18:28 UTC (rev 13)
@@ -0,0 +1,18 @@
+##
+## Class definition of initial GO-GARCH objects
+##
+setClass(Class = "Goinit", representation(X = "matrix", V = "matrix", P = "matrix", Dsqr = "matrix", garchf = "formula"))
+##
+## Class definition of GO-GARCH objects
+##
+setClass(Class = "GoGARCH", representation(Z = "matrix", Y = "matrix", H = "list", models = "list", estby = "character"), contains = "Goinit")
+##
+## Class definition of GO-GARCH objects, estimated by Maximum-Likelihood
+##
+setClass(Class = "Goestml", representation(opt = "list"), contains = "GoGARCH")
+##
+## Class definition of orthogonal matrices
+##
+setClass(Class = "Orthom", representation(M = "matrix"))
+
+

Added: pkg/R/All-generics.R
===================================================================
--- pkg/R/All-generics.R	                        (rev 0)
+++ pkg/R/All-generics.R	2009-01-27 20:18:28 UTC (rev 13)
@@ -0,0 +1,8 @@
+##
+## Generic definition for estimating GO-GARCH models
+##
+setGeneric("goest", function(object, initial, garchlist, ...) standardGeneric("goest"))
+##
+## Generic definition for extracting object at M for objects of class Orthom
+##
+setGeneric("M", function(object, ...) standardGeneric("M"))

Added: pkg/R/GoGARCH-show.R
===================================================================
--- pkg/R/GoGARCH-show.R	                        (rev 0)
+++ pkg/R/GoGARCH-show.R	2009-01-27 20:18:28 UTC (rev 13)
@@ -0,0 +1,28 @@
+setMethod(f = "show", signature = "GoGARCH", definition = function(object){
+  title <- "*** GO-GARCH ***"
+  stars <- paste(rep("*", nchar(title)), collapse = "")
+  cat("\n")
+  cat(paste(stars, "\n"))
+  cat(paste(title, "\n"))
+  cat(paste(stars, "\n"))  
+  cat("\n")
+  cat(paste("Components estimated by:", object at estby))
+  cat("\n")
+  cat(paste("Dimension of data matrix:", paste("(", nrow(object at X), " x ", ncol(object at X), ").", sep = "")))
+  cat("\n")
+  cat(paste("Formula for component GARCH models:", paste(as.character(object at garchf), collapse = " "), "\n"))
+  cat("\n")  
+  if(length(object at Z) != 0){
+    cat("Linar Map Z:\n")
+    print(object at Z, quote = FALSE)
+    cat("\n")
+    cat("and its inverse:\n")
+    print(solve(object at Z), quote = FALSE)
+    cat("\n")
+  }
+  garchc <- matrix(unlist(lapply(object at models, function(x) coef(x))), nrow = ncol(object at X), byrow = TRUE)
+  colnames(garchc) <- names(object at models[[1]]@fit$par)
+  rownames(garchc) <- paste("y", 1:nrow(garchc), sep = "")
+  cat("Estimated GARCH coefficients:\n")
+  print(garchc) 
+})

Added: pkg/R/Goestml-goest.R
===================================================================
--- pkg/R/Goestml-goest.R	                        (rev 0)
+++ pkg/R/Goestml-goest.R	2009-01-27 20:18:28 UTC (rev 13)
@@ -0,0 +1,6 @@
+setMethod(f = "goest", signature = c(object = "Goestml", initial = "numeric", garchlist = "list"), definition = function(object, initial, garchlist, ...){
+  llobj <- nlminb(start = initial, objective = gollh, object = object, garchlist = garchlist, lower = 1.5e-8, upper = pi/2, ...)
+  gotheta <- gotheta(llobj$par, object)
+  result <- new("Goestml", opt = llobj, estby = "maximum likelihood", gotheta)
+  return(result)  
+})

Modified: pkg/R/Goinit-class.R
===================================================================
--- pkg/R/Goinit-class.R	2009-01-25 13:28:37 UTC (rev 12)
+++ pkg/R/Goinit-class.R	2009-01-27 20:18:28 UTC (rev 13)
@@ -30,7 +30,6 @@
   }
 }
 ##
-## Class definition of initial GO-GARCH objects
+## Setting as validity function
 ##
-setClass(Class = "Goinit", representation(X = "matrix", V = "matrix", P = "matrix", Dsqr = "matrix", garchf = "formula"), validity = validGoinitObject)
-
+setValidity("Goinit", validGoinitObject)

Modified: pkg/R/Goinit-show.R
===================================================================
--- pkg/R/Goinit-show.R	2009-01-25 13:28:37 UTC (rev 12)
+++ pkg/R/Goinit-show.R	2009-01-27 20:18:28 UTC (rev 13)
@@ -21,11 +21,6 @@
     print(formatC(object at Dsqr), quote = FALSE)
     cat("\n")
   }
-  if(length(object at V) != 0){
-    cat("Variance/Covariance matrix:\n")
-    print(formatC(object at V), quote = FALSE)
-    cat("\n")
-  }
   cat(paste("Formula for component GARCH models:\n", paste(as.character(object at garchf), collapse = " "), "\n"))
 }
 )

Added: pkg/R/Orthom-M.R
===================================================================
--- pkg/R/Orthom-M.R	                        (rev 0)
+++ pkg/R/Orthom-M.R	2009-01-27 20:18:28 UTC (rev 13)
@@ -0,0 +1,4 @@
+##
+## M-method for objects of class Orthom
+##
+setMethod(f = "M", signature = "Orthom", function(object) object at M)

Modified: pkg/R/Orthom-class.R
===================================================================
--- pkg/R/Orthom-class.R	2009-01-25 13:28:37 UTC (rev 12)
+++ pkg/R/Orthom-class.R	2009-01-27 20:18:28 UTC (rev 13)
@@ -20,7 +20,6 @@
   }
 }
 ##
-## Class definition of orthogonal matrices
+## Setting as validity function
 ##
-setClass(Class = "Orthom", representation(M = "matrix"), validity = validOrthomObject)
-
+setValidity("Orthom", validOrthomObject)

Added: pkg/R/Orthom-t.R
===================================================================
--- pkg/R/Orthom-t.R	                        (rev 0)
+++ pkg/R/Orthom-t.R	2009-01-27 20:18:28 UTC (rev 13)
@@ -0,0 +1,4 @@
+##
+## Transpose method for objects of class Orthom
+##
+setMethod("t", "Orthom", function(x) t(x at M))

Added: pkg/R/gogarch.R
===================================================================
--- pkg/R/gogarch.R	                        (rev 0)
+++ pkg/R/gogarch.R	2009-01-27 20:18:28 UTC (rev 13)
@@ -0,0 +1,20 @@
+gogarch <- function(data, formula, scale = FALSE, method = c("ml"), initial = NULL, garchlist = list(init.rec = "mci", delta = 2, skew = 1, shape = 4, cond.dist = "norm", include.mean = FALSE, include.delta = NULL, include.skew = NULL, include.shape = NULL, leverage = NULL, trace = FALSE, algorithm = "nlminb", hessian = "ropt", control = list(), title = NULL, description = NULL), ...){
+  method <- match.arg(method)
+  d <- ncol(data)
+  if(is.null(initial)){
+    l <- d * (d - 1)/2
+    initial <- seq(3.0, 0.1, length.out = l)
+  } else {
+    l <- length(initial)
+    if (l != d * (d - 1)/2) {
+      stop(paste("\nLength of initial vector does not match implied dimension of orthogonal matrix.\n", "It should have length: ", d, sep = ""))
+    }
+  }
+  gini <- goinit(X = data, garchf = formula, scale = scale)
+  gomod <- new("GoGARCH", gini)
+  if(method == "ml"){
+    goestml <- new("Goestml", gomod)
+    gogarch <- goest(object = goestml, initial = initial, garchlist = garchlist, ...)
+  }
+  return(gogarch)
+}

Modified: pkg/R/gollh.R
===================================================================
--- pkg/R/gollh.R	2009-01-25 13:28:37 UTC (rev 12)
+++ pkg/R/gollh.R	2009-01-27 20:18:28 UTC (rev 13)
@@ -1,21 +1,19 @@
 gollh <-
-function(params, X, P, Dsqr, m, n, formula = ~ garch(1,1), garchlist = list(
+function(params, object, garchlist = list(
          init.rec = "mci", delta = 2, skew = 1, shape = 4, cond.dist = "norm",
          include.mean = FALSE, include.delta = NULL, include.skew = NULL,
          include.shape = NULL, leverage = NULL, trace = FALSE,
          algorithm = "nlminb", hessian = "ropt", control = list(),
          title = NULL, description = NULL)){
-  U <- UprodR(params)
-  Z <- P %*% Dsqr %*% t(U)
-  Zinv <- solve(Z)
-  Y <- X %*% Zinv
-  fitted <- apply(Y, 2, function(x) garchFit(formula = formula, data = x, include.mean = FALSE, trace = FALSE))
-  H <- matrix(unlist(lapply(fitted, function(x) x at h.t)), ncol = m, nrow = n)
+  gotheta <- gotheta(theta = params, object = object, garchlist = garchlist)
+  m <- ncol(object at X)
+  n <- nrow(object at X)
+  H <- matrix(unlist(lapply(gotheta at models, function(x) x at h.t)), ncol = m, nrow = n)
   Hinv <- 1.0 / H
   arg1 <- n * m * log(2 * pi)
-  arg2 <- log(det(Z %*% t(Z))) * n
+  arg2 <- log(det(gotheta at Z %*% t(gotheta at Z))) * n
   arg3 <- sum(log(apply(H, 1, prod)))
-  arg4 <- sum(rowSums(Y * Hinv * Y))
+  arg4 <- sum(rowSums(gotheta at Y * Hinv * gotheta at Y))
   ll <- -0.5 * (arg1 + arg2 + arg3 + arg4)
   negll <- -1.0 * ll
   return(negll)

Added: pkg/R/gotheta.R
===================================================================
--- pkg/R/gotheta.R	                        (rev 0)
+++ pkg/R/gotheta.R	2009-01-27 20:18:28 UTC (rev 13)
@@ -0,0 +1,24 @@
+gotheta <-
+function(theta, object, garchlist = list(init.rec = "mci", delta = 2, skew = 1, shape = 4, cond.dist = "norm", include.mean = FALSE, include.delta = NULL, include.skew = NULL, include.shape = NULL, leverage = NULL, trace = FALSE, algorithm = "nlminb", hessian = "ropt", control = list(), title = NULL, description = NULL)){
+  if(!any(inherits(object, what = c("Goinit", "GoGARCH", "Goestml")))) {
+    stop("\nObject is neither of class 'Goinit', 'GoGARCH' or 'Goestml'.\n")
+  }
+  l <- length(theta)
+  d <- as.integer(0.5 + sqrt(0.5^2 + 2 * l))
+  if (l != d * (d - 1)/2) {
+    stop(paste("\nLength of theta does not match implied dimension of orthogonal matrix.\n", "It should have length: ", d, sep = ""))
+  }
+  m <- ncol(object at X)
+  n <- nrow(object at X)
+  U <- UprodR(theta)@M
+  Z <- object at P %*% object at Dsqr %*% t(U)
+  Zinv <- solve(Z)
+  Y <- object at X %*% Zinv
+  fitted <- apply(Y, 2, function(x) do.call("garchFit", c(list(formula = object at garchf, data = x), garchlist)))
+  H <- matrix(unlist(lapply(fitted, function(x) x at h.t)), ncol = m, nrow = n)
+  Hdf <- data.frame(t(H))
+  Ht <- lapply(Hdf, function(x) Z %*% diag(x) %*% t(Z))
+  names(Ht) <- rownames(object at X)
+  result <- new("GoGARCH", Z = Z, Y = Y, H = Ht, models = fitted, X = object at X, P = object at P, Dsqr = object at Dsqr, V = object at V, garchf = object at garchf)
+  return(result)
+}

Added: pkg/man/GoGARCH-class.Rd
===================================================================
--- pkg/man/GoGARCH-class.Rd	                        (rev 0)
+++ pkg/man/GoGARCH-class.Rd	2009-01-27 20:18:28 UTC (rev 13)
@@ -0,0 +1,61 @@
+\name{GoGARCH-class}
+
+\docType{class}
+
+\encoding{latin1}
+
+\alias{GoGARCH-class}
+\alias{show,GoGARCH-method}
+
+\title{Class "GoGARCH": Estimated GO-GARCH Models}
+
+\description{
+  This class defines the slots for estimated GO-GARCH models. It
+  contains the class \code{Goinit}. 
+}
+
+\section{Objects from the Class}{
+  Objects can be created by calls of the form \code{new("GoGARCH", ...)}. 
+}
+
+\section{Slots}{
+	 \describe{
+    \item{\code{Z}:}{Object of class \code{"matrix"}: Transformation matrix.}
+    \item{\code{Y}:}{Object of class \code{"matrix"}: Extracted
+	 component matrix.}
+    \item{\code{H}:}{Object of class \code{"list"}: List of conditional
+	 variance/covariance matrices.}
+    \item{\code{models}:}{Object of class \code{"list"}: List of
+	 univariate GARCH model fits.}
+    \item{\code{estby}:}{Object of class \code{"character"}: Estimation method.}
+    \item{\code{X}:}{Object of class \code{"matrix"}: The data matrix.}
+    \item{\code{V}:}{Object of class \code{"matrix"}: Covariance matrix
+	 of \code{X}.}
+    \item{\code{P}:}{Object of class \code{"matrix"}: Left singular
+	 values of Var/Cov matrix of \code{X}.}
+    \item{\code{Dsqr}:}{Object of class \code{"matrix"}: Square roots of
+      eigenvalues on diagonal, else zero.}
+    \item{\code{garchf}:}{Object of class \code{"formula"}: Garch
+	 formula used for uncorrelated component GARCH models.}
+  }
+}
+
+\section{Extends}{
+Class \code{"\linkS4class{Goinit}"}, directly.
+}
+
+\section{Methods}{
+  \describe{
+    \S4method{show}{show-method for objects of class \code{GoGARCH}.}
+  }
+}
+
+\author{
+  Bernhard Pfaff
+}
+
+\seealso{
+  \code{\linkS4class{Goinit}}
+}
+
+\keyword{classes}

Added: pkg/man/Goestml-class.Rd
===================================================================
--- pkg/man/Goestml-class.Rd	                        (rev 0)
+++ pkg/man/Goestml-class.Rd	2009-01-27 20:18:28 UTC (rev 13)
@@ -0,0 +1,62 @@
+\name{Goestml-class}
+
+\docType{class}
+
+\encoding{latin1}
+
+\alias{Goestml-class}
+
+\title{Class "Goestml": GO-GARCH  models estimated by
+  Maximum-Likelihood}
+
+\description{This class contains the \code{GoGARCH} class and has the
+  outcome of \code{optim} as an additional slot.
+}
+
+\section{Objects from the Class}{
+Objects can be created by calls of the form \code{new("Goestml", ...)}.
+}
+
+\section{Slots}{
+	 \describe{
+    \item{\code{opt}:}{Object of class \code{"list"}: List returned by
+	 \code{optim}.} 
+    \item{\code{Z}:}{Object of class \code{"matrix"}: Transformation matrix.}
+    \item{\code{Y}:}{Object of class \code{"matrix"}: Extracted
+	 component matrix.}
+    \item{\code{H}:}{Object of class \code{"list"}: List of conditional
+	 variance/covariance matrices.}
+    \item{\code{models}:}{Object of class \code{"list"}: List of
+	 univariate GARCH model fits.}
+    \item{\code{estby}:}{Object of class \code{"character"}: Estimation method.}
+    \item{\code{X}:}{Object of class \code{"matrix"}: The data matrix.}
+    \item{\code{V}:}{Object of class \code{"matrix"}: Covariance matrix
+	 of \code{X}.}
+    \item{\code{P}:}{Object of class \code{"matrix"}: Left singular
+	 values of Var/Cov matrix of \code{X}.}
+    \item{\code{Dsqr}:}{Object of class \code{"matrix"}: Square roots of
+      eigenvalues on diagonal, else zero.}
+    \item{\code{garchf}:}{Object of class \code{"formula"}: Garch
+	 formula used for uncorrelated component GARCH models.}
+  }
+}
+
+\section{Extends}{
+Class \code{"\linkS4class{GoGARCH}"}, directly.
+Class \code{"\linkS4class{Goinit}"}, by class "GoGARCH", distance 2.
+}
+
+\section{Methods}{
+No methods defined with class "Goestml" in the signature.
+}
+
+\author{
+  Bernhard Pfaff
+}
+
+
+\seealso{
+  \code{\linkS4class{GoGARCH}}, \code{\linkS4class{Goinit}} 
+}
+
+\keyword{classes}

Modified: pkg/man/Orthom-class.Rd
===================================================================
--- pkg/man/Orthom-class.Rd	2009-01-25 13:28:37 UTC (rev 12)
+++ pkg/man/Orthom-class.Rd	2009-01-27 20:18:28 UTC (rev 13)
@@ -3,8 +3,11 @@
 \docType{class}
 
 \alias{Orthom-class}
+\alias{M}
+\alias{M,Orthom-method}
+\alias{print,Orthom-method}
 \alias{show,Orthom-method}
-\alias{print,Orthom-method}
+\alias{t,Orthom-method}
 
 \encoding{latin1}
 
@@ -29,8 +32,10 @@
 
 \section{Methods}{
   \describe{
+    \S4method{M}{Returns the slot \code{M} of class \code{Orthom}.}
+    \S4method{print}{print-method for objects of class \code{Orthom}.}
     \S4method{show}{show-method for objects of class \code{Orthom}.}
-    \S4method{print}{print-method for objects of class \code{Orthom}.}
+    \S4method{t}{Transpose of \code{object at M}.}
   }
 }
 

Added: pkg/man/goest-methods.Rd
===================================================================
--- pkg/man/goest-methods.Rd	                        (rev 0)
+++ pkg/man/goest-methods.Rd	2009-01-27 20:18:28 UTC (rev 13)
@@ -0,0 +1,36 @@
+\name{goest-methods}
+
+\encoding{latin1}
+
+\docType{methods}
+
+\alias{goest-methods}
+
+\alias{goest,Goestml,numeric,list-method}
+
+\alias{goest}
+
+\title{Methods for Function goest}
+
+\description{
+  These are methods for estimating GO-GARCH models. Currently only a
+  method for estimating GO-GARCH models by Maximum-Likelihood is implemented.
+}
+
+\section{Methods}{
+\describe{
+\item{object = "Goestml", initial = "numeric", garchlist =
+  "list"}{The starting values for the Euler angles are provided in
+  \code{initial} and the list \code{garchlist} contains the elements
+  that are passed \code{garchFit}.}
+}}
+
+\author{
+  Bernhard Pfaff
+}
+
+\seealso{
+  \code{\link[fGarch]{garchFit}}, \code{\linkS4class{Goestml}}
+}
+
+\keyword{methods}

Added: pkg/man/gogarch.Rd
===================================================================
--- pkg/man/gogarch.Rd	                        (rev 0)
+++ pkg/man/gogarch.Rd	2009-01-27 20:18:28 UTC (rev 13)
@@ -0,0 +1,75 @@
+\name{gogarch}
+
+\encoding{latin1}
+
+\alias{gogarch}
+
+\title{
+  Specification and estimation of GO-GARCH models
+}
+
+\description{
+  This function steers the specification and estimation of GO-GARCH
+  models. 
+}
+\usage{
+gogarch(data, formula, scale = FALSE, method = c("ml"), initial = NULL,
+        garchlist = list(init.rec = "mci", delta = 2, skew = 1, shape =
+        4, cond.dist = "norm", include.mean = FALSE, include.delta = NULL, 
+        include.skew = NULL, include.shape = NULL, leverage = NULL, trace =
+        FALSE, algorithm = "nlminb", hessian = "ropt", control = list(), title
+        = NULL, description = NULL), ...) 
+}
+
+\arguments{
+  \item{data}{Matrix: the original data set.}
+  \item{formula}{Formula: valid formula for univariate GARCH models.}
+  \item{scale}{Logical, if \code{TRUE} the data is scaled. The default
+  is \code{scale = FALSE}.}
+  \item{method}{Character: currently only Maximum-Likelihood estimation
+  is implemented.}
+  \item{initial}{Numeric: starting values for Euler angles (see Details).}
+  \item{garchlist}{List: Elements are passed to \code{garchFit}.}
+  \item{\dots}{Ellipsis argument: is passed to \code{nlminb}.}
+}
+
+\details{
+If the argument \code{initial} is left \code{NULL}, the starting values
+are computed according \code{seq(3.0, 0.1, length.out = l)}, whereby
+\code{l} is the length of \code{initial}. This length must be equal to
+\eqn{m * (m - 1)/2}, whereby \eqn{m} is the number of columns of
+\code{data}.  
+}
+
+\value{
+  An object of class \code{Goestml} is returned which extends the
+  \code{GoGARCH} class.
+}
+
+\references{
+  Van der Weide, Roy (2002), GO-GARCH: A Multivariate Generalized
+  Orthogonal GARCH Model, \emph{Journal of Applied Econometrics},
+  \bold{17(5)}, 549 -- 564.
+}
+
+\author{
+  Bernhard Pfaff
+}
+
+\seealso{
+  \code{\linkS4class{GoGARCH}}, \code{\linkS4class{Goestml}}, \code{\link{goest-methods}}
+}
+\examples{
+\dontrun{
+library(vars)
+data(VDW)
+var1 <- VAR(scale(VDW), p = 1, type = "const")
+resid <- scale(residuals(var1))
+gogarch(resid, ~garch(1, 1))
+}
+}
+
+\keyword{models}
+\concept{GARCH}
+\concept{GO-GARCH}
+\concept{Euler Angles}
\ No newline at end of file

Modified: pkg/man/gollh.Rd
===================================================================
--- pkg/man/gollh.Rd	2009-01-25 13:28:37 UTC (rev 12)
+++ pkg/man/gollh.Rd	2009-01-27 20:18:28 UTC (rev 13)
@@ -14,9 +14,8 @@
 }
 
 \usage{
-gollh(params, X, P, Dsqr, m, n, formula = ~garch(1, 1),
-      garchlist = list(init.rec = "mci", delta = 2, skew = 1,
-      shape = 4, cond.dist = "norm", include.mean = FALSE, 
+gollh(params, object, garchlist = list(init.rec = "mci", delta = 2,
+      skew = 1, shape = 4, cond.dist = "norm", include.mean = FALSE, 
       include.delta = NULL, include.skew = NULL, include.shape = NULL,
       leverage = NULL, trace = FALSE, algorithm = "nlminb",
       hessian = "ropt", control = list(), title = NULL,
@@ -25,14 +24,7 @@
 
 \arguments{
   \item{params}{Vector of initial values for \code{theta}.}
-  \item{X}{Matrix, the original data matrix with dimension \eqn{n \times m}.}
-  \item{P}{Matrix, rotation matrix returned by \code{svd} or
-  \code{prcomp}, dimension \eqn{m \times m}.}
-  \item{Dsqr}{Matrix, square roots of the eigenvalue decomposition on
-  its diagonal, dimension \eqn{m \times m}.}
-  \item{m}{Integer, number of columns of \code{X}.}
-  \item{n}{Integer, number of rows of \code{X}.}
-  \item{formula}{Formula, type of GARCH model, default is \code{~ garch(1,1)}.}
+  \item{object}{An object of class \code{Goinit} or an extension thereof.}
   \item{garchlist}{List, elements are passed to \code{garchFit}.}
 }
 

Added: pkg/man/gotheta.Rd
===================================================================
--- pkg/man/gotheta.Rd	                        (rev 0)
+++ pkg/man/gotheta.Rd	2009-01-27 20:18:28 UTC (rev 13)
@@ -0,0 +1,76 @@
+\name{gotheta}
+
+\alias{gotheta}
+
+\encoding{latin1}
+
+\title{
+  Creates an object of class GoGARCH based on Euler angles
+}
+
+\description{
+  This function returns an object of class \code{GoGARCH} based on an
+  input vector of Euler angles.
+}
+
+\usage{
+gotheta(theta, object, garchlist = list(init.rec = "mci", delta = 2,
+skew = 1, shape = 4, cond.dist = "norm", include.mean = FALSE,
+include.delta = NULL, include.skew = NULL, include.shape = NULL,
+leverage = NULL, trace = FALSE, algorithm = "nlminb", hessian = "ropt",
+control = list(), title = NULL, description = NULL))
+}
+
+\arguments{
+  \item{theta}{Vector of Euler angles.}
+  \item{object}{An object of formal class \code{Goinit} or an extension
+    thereof.}
+  \item{garchlist}{List with optional elements passed to \code{garchFit}.}  
+}
+
+\details{
+  In a first step the orthogonal matrix \eqn{U} is computed as the
+  product of rotation matrices given the vector \code{theta} of Euler
+  angles with the function \code{UprodR}. The linear map \eqn{Z} is
+  computed next as \eqn{Z = P D^{\frac{1}{2}} U'}. The unobserved
+  components \eqn{Y} are calculated as \eqn{Y = X Z^{-1}}. These are
+  then utilized in the estimation of the univariate GARCH models
+  according to \code{object at garchf}. The conditional variance/covariance
+  matrices are calculated according to \eqn{V_t = Z H_t Z'} whereby
+  \eqn{H_t} signifies a matrix with the conditional variances of the
+  unvariate GARCH models on its diagonal.  
+}
+
+\value{
+  Returns an object of class \code{GoGARCH}.
+}
+
+\references{
+  Van der Weide, Roy (2002), GO-GARCH: A Multivariate Generalized
+  Orthogonal GARCH Model, \emph{Journal of Applied Econometrics},
+  \bold{17(5)}, 549 -- 564.
+}
+
+\author{
+  Bernhard Pfaff
+}
+
+\seealso{
+  \code{\linkS4class{Goinit}}, \code{\linkS4class{GoGARCH}},
+  \code{\linkS4class{Goestml}}, \code{\link[fGarch]{garchFit}}
+}
+
+\examples{
+\dontrun{
+library(vars)
+data(VDW)
+var1 <- VAR(VDW, p = 1, type = "const")
+resid <- resid(var1)
+gin <- goinit(resid, scale = TRUE)
+gotheta(0.5, gin)
+}
+}
+
+\keyword{models}
+\concept{GO-GARCH}
+\concept{Euler angles}
\ No newline at end of file



More information about the Gogarch-commits mailing list