[Gogarch-commits] r15 - in pkg: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Jan 31 23:10:38 CET 2009
Author: bpfaff
Date: 2009-01-31 23:10:38 +0100 (Sat, 31 Jan 2009)
New Revision: 15
Modified:
pkg/DESCRIPTION
pkg/NAMESPACE
pkg/R/All-generics.R
pkg/R/GoGARCH-coef.R
pkg/R/GoGARCH-residuals.R
pkg/R/GoGARCH-show.R
pkg/R/Goestml-coef.R
pkg/R/Goestml-residuals.R
pkg/R/Goestml-show.R
pkg/man/GoGARCH-class.Rd
pkg/man/Goestml-class.Rd
Log:
Functions and methods added.
Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION 2009-01-29 22:56:41 UTC (rev 14)
+++ pkg/DESCRIPTION 2009-01-31 22:10:38 UTC (rev 15)
@@ -1,12 +1,13 @@
Package: gogarch
-Version: 0.2-8
+Version: 0.3-0
Type: Package
Title: Generalized Orthogonal GARCH (GO-GARCH) models
-Date: 2009-01-29
+Date: 2009-01-31
Author: Bernhard Pfaff
Maintainer: Bernhard Pfaff <bernhard at pfaffikus.de>
-Depends: R (>= 2.7.0), stats, methods, fGarch
+Depends: R (>= 2.7.0), methods, stats, fGarch
Suggests: vars
Description: Implementation of the GO-GARCH model class.
License: GPL (>= 2)
-LazyLoad: no
+LazyLoad: yes
+LazyLoad: yes
Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE 2009-01-29 22:56:41 UTC (rev 14)
+++ pkg/NAMESPACE 2009-01-31 22:10:38 UTC (rev 15)
@@ -1,45 +1,17 @@
## Import packages
-import("methods")
+import(methods)
## Import functions
-importFrom("stats",
- "coef",
- "logLik",
- "residuals",
- "resid")
+importFrom(stats, coef, logLik, residuals)
## Classes
-exportClasses("Goestml",
- "GoGARCH",
- "Goinit",
- "Orthom")
+exportClasses(Goestml, GoGARCH, Goinit, Orthom)
## Methods
-exportMethods("angles",
- "cvar",
- "ccor",
- "ccov",
- "coef",
- "converged",
- "goest",
- "logLik",
- "M",
- "print",
- "show",
- "t",
- "residuals",
- "resid")
+exportMethods(angles, cvar, ccor, ccov, coef, converged, goest, logLik, M, print, show, t, residuals)
## Functions
-export("gogarch",
- "goinit",
- "gollh",
- "gotheta",
- "Rd2",
- "UprodR",
- "unvech",
- "validOrthomObject",
- "validGoinitObject")
+export(gogarch, goinit, gollh, gotheta, Rd2, UprodR, unvech, validOrthomObject, validGoinitObject)
Modified: pkg/R/All-generics.R
===================================================================
--- pkg/R/All-generics.R 2009-01-29 22:56:41 UTC (rev 14)
+++ pkg/R/All-generics.R 2009-01-31 22:10:38 UTC (rev 15)
@@ -26,3 +26,10 @@
## Generic definition for extracting convergence codes
##
setGeneric("converged", function(object, ...) standardGeneric("converged"))
+##
+## Setting Generics for coef, residuals, logLik and t
+##
+setGeneric("coef")
+setGeneric("residuals")
+setGeneric("t")
+setGeneric("logLik")
Modified: pkg/R/GoGARCH-coef.R
===================================================================
--- pkg/R/GoGARCH-coef.R 2009-01-29 22:56:41 UTC (rev 14)
+++ pkg/R/GoGARCH-coef.R 2009-01-31 22:10:38 UTC (rev 15)
@@ -1,5 +1,5 @@
setMethod(f = "coef", signature(object = "GoGARCH"), definition = function(object){
- garchc <- matrix(unlist(lapply(object at models, function(x) coef(x))), nrow = ncol(object at X), byrow = TRUE)
+ garchc <- matrix(unlist(lapply(object at models, coef)), nrow = ncol(object at X), byrow = TRUE)
colnames(garchc) <- names(object at models[[1]]@fit$par)
rownames(garchc) <- paste("y", 1:nrow(garchc), sep = "")
return(garchc)
Modified: pkg/R/GoGARCH-residuals.R
===================================================================
--- pkg/R/GoGARCH-residuals.R 2009-01-29 22:56:41 UTC (rev 14)
+++ pkg/R/GoGARCH-residuals.R 2009-01-31 22:10:38 UTC (rev 15)
@@ -1,7 +1,7 @@
-setMethod(f = "residuals", signature(object = "GoGARCH"), definition = function(object, ...){
+setMethod(f = "residuals", signature(object = "GoGARCH"), definition = function(object, standardize = FALSE){
m <- ncol(object at X)
n <- nrow(object at X)
- resl <- lapply(object at models, residuals, ...)
+ resl <- lapply(object at models, residuals, standardize = standardize)
resm <- matrix(c(unlist(resl)), ncol = m, nrow = n)
ynames <- paste("y", 1:2, sep = "")
colnames(resm) <- ynames
@@ -9,14 +9,4 @@
return(resm)
})
-setMethod(f = "resid", signature(object = "GoGARCH"), definition = function(object, ...){
- m <- ncol(object at X)
- n <- nrow(object at X)
- resl <- lapply(object at models, residuals, ...)
- resm <- matrix(c(unlist(resl)), ncol = m, nrow = n)
- ynames <- paste("y", 1:2, sep = "")
- colnames(resm) <- ynames
- rownames(resm) <- rownames(object at X)
- return(resm)
-})
Modified: pkg/R/GoGARCH-show.R
===================================================================
--- pkg/R/GoGARCH-show.R 2009-01-29 22:56:41 UTC (rev 14)
+++ pkg/R/GoGARCH-show.R 2009-01-31 22:10:38 UTC (rev 15)
@@ -20,9 +20,10 @@
print(solve(object at Z), quote = FALSE)
cat("\n")
}
- cat("Estimated GARCH coefficients:\n")
+ cat("Estimated GARCH coefficients:\n")
print(coef(object))
cat("\n")
cat("Convergence codes of component GARCH models:\n")
- print(converged(object))
+ print(converged(object))
+ invisible(object)
})
Modified: pkg/R/Goestml-coef.R
===================================================================
--- pkg/R/Goestml-coef.R 2009-01-29 22:56:41 UTC (rev 14)
+++ pkg/R/Goestml-coef.R 2009-01-31 22:10:38 UTC (rev 15)
@@ -1,4 +1,4 @@
setMethod(f = "coef", signature(object = "Goestml"), definition = function(object){
- coef(as(object, "GoGARCH"))
+ callNextMethod()
})
Modified: pkg/R/Goestml-residuals.R
===================================================================
--- pkg/R/Goestml-residuals.R 2009-01-29 22:56:41 UTC (rev 14)
+++ pkg/R/Goestml-residuals.R 2009-01-31 22:10:38 UTC (rev 15)
@@ -1,9 +1,5 @@
-setMethod(f = "residuals", signature(object = "Goestml"), definition = function(object, ...){
- residuals(as(object, "GoGARCH"), ...)
+setMethod(f = "residuals", signature(object = "Goestml"), definition = function(object, standardize = FALSE){
+ callNextMethod(object = object, standardize = standardize)
})
-setMethod(f = "resid", signature(object = "Goestml"), definition = function(object, ...){
- resid(as(object, "GoGARCH"), ...)
-})
-
Modified: pkg/R/Goestml-show.R
===================================================================
--- pkg/R/Goestml-show.R 2009-01-29 22:56:41 UTC (rev 14)
+++ pkg/R/Goestml-show.R 2009-01-31 22:10:38 UTC (rev 15)
@@ -1,3 +1,3 @@
setMethod(f = "show", signature(object = "Goestml"), definition = function(object){
- show(as(object, "GoGARCH"))
+ callNextMethod()
})
Modified: pkg/man/GoGARCH-class.Rd
===================================================================
--- pkg/man/GoGARCH-class.Rd 2009-01-29 22:56:41 UTC (rev 14)
+++ pkg/man/GoGARCH-class.Rd 2009-01-31 22:10:38 UTC (rev 15)
@@ -12,7 +12,6 @@
\alias{coef,GoGARCH-method}
\alias{converged,GoGARCH-method}
\alias{residuals,GoGARCH-method}
-\alias{resid,GoGARCH-method}
\title{Class "GoGARCH": Estimated GO-GARCH Models}
Modified: pkg/man/Goestml-class.Rd
===================================================================
--- pkg/man/Goestml-class.Rd 2009-01-29 22:56:41 UTC (rev 14)
+++ pkg/man/Goestml-class.Rd 2009-01-31 22:10:38 UTC (rev 15)
@@ -19,7 +19,6 @@
\alias{converged,Goestml-method}
\alias{logLik,Goestml-method}
\alias{residuals,Goestml-method}
-\alias{resid,Goestml-method}
\alias{show,Goestml-method}
\title{Class "Goestml": GO-GARCH models estimated by Maximum-Likelihood}
More information about the Gogarch-commits
mailing list