[Distr-commits] r814 - in branches/distr-2.4/pkg/distrMod: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon May 21 01:51:22 CEST 2012
Author: ruckdeschel
Date: 2012-05-21 01:51:22 +0200 (Mon, 21 May 2012)
New Revision: 814
Modified:
branches/distr-2.4/pkg/distrMod/NAMESPACE
branches/distr-2.4/pkg/distrMod/R/AllClass.R
branches/distr-2.4/pkg/distrMod/R/AllGeneric.R
branches/distr-2.4/pkg/distrMod/R/AllReturnClasses.R
branches/distr-2.4/pkg/distrMod/R/L2GroupFamilies-methods.R
branches/distr-2.4/pkg/distrMod/R/SimpleL2ParamFamilies.R
branches/distr-2.4/pkg/distrMod/man/InternalReturnClasses-class.Rd
branches/distr-2.4/pkg/distrMod/man/internalClassUnions-class.Rd
Log:
[distrMod:]introduced slot scaleshapename for L2ScaleShapeUnion and methods scalename und scaleshapename (accessor/replacers)
Modified: branches/distr-2.4/pkg/distrMod/NAMESPACE
===================================================================
--- branches/distr-2.4/pkg/distrMod/NAMESPACE 2012-05-20 19:18:58 UTC (rev 813)
+++ branches/distr-2.4/pkg/distrMod/NAMESPACE 2012-05-20 23:51:22 UTC (rev 814)
@@ -58,8 +58,8 @@
exportMethods("nuisance", "main")
exportMethods("validParameter")
exportMethods("startPar", "makeOKPar")
-exportMethods("locscalename", "LogDeriv")
-exportMethods("coerce", "profile")
+exportMethods("locscalename", "scaleshapename", "scalename", "LogDeriv")
+exportMethods("coerce", "profile", "locscalename", "scaleshapename<-")
exportMethods("mleCalc", "mceCalc")
exportMethods("qqplot")
export("distrModMASK")
Modified: branches/distr-2.4/pkg/distrMod/R/AllClass.R
===================================================================
--- branches/distr-2.4/pkg/distrMod/R/AllClass.R 2012-05-20 19:18:58 UTC (rev 813)
+++ branches/distr-2.4/pkg/distrMod/R/AllClass.R 2012-05-20 23:51:22 UTC (rev 814)
@@ -235,7 +235,7 @@
)
## virtual in-between class for common parts in modifyModel - method
-setClass("L2ScaleShapeUnion",
+setClass("L2ScaleShapeUnion", representation(scaleshapename ="character"),
contains = c("L2GroupParamFamily","VIRTUAL")
)
Modified: branches/distr-2.4/pkg/distrMod/R/AllGeneric.R
===================================================================
--- branches/distr-2.4/pkg/distrMod/R/AllGeneric.R 2012-05-20 19:18:58 UTC (rev 813)
+++ branches/distr-2.4/pkg/distrMod/R/AllGeneric.R 2012-05-20 23:51:22 UTC (rev 814)
@@ -284,3 +284,12 @@
if(!isGeneric("withPosRestr<-")){
setGeneric("withPosRestr<-", function(object,value) standardGeneric("withPosRestr<-"))
}
+if(!isGeneric("scaleshapename")){
+ setGeneric("scaleshapename", function(object) standardGeneric("scaleshapename"))
+}
+if(!isGeneric("scaleshapename<-")){
+ setGeneric("scaleshapename<-", function(object, value) standardGeneric("scaleshapename<-"))
+}
+if(!isGeneric("scalename")){
+ setGeneric("scalename", function(object) standardGeneric("scalename"))
+}
Modified: branches/distr-2.4/pkg/distrMod/R/AllReturnClasses.R
===================================================================
--- branches/distr-2.4/pkg/distrMod/R/AllReturnClasses.R 2012-05-20 19:18:58 UTC (rev 813)
+++ branches/distr-2.4/pkg/distrMod/R/AllReturnClasses.R 2012-05-20 23:51:22 UTC (rev 814)
@@ -28,7 +28,9 @@
contains = "L2ParamFamily")
## Gamma family
-setClass("GammaFamily", contains = "L2ScaleShapeUnion")
+setClass("GammaFamily", prototype=prototype(scaleshapename=c("scale"="scale",
+ "shape"="shape")),
+ contains = "L2ScaleShapeUnion")
## Beta family
setClass("BetaFamily",
Modified: branches/distr-2.4/pkg/distrMod/R/L2GroupFamilies-methods.R
===================================================================
--- branches/distr-2.4/pkg/distrMod/R/L2GroupFamilies-methods.R 2012-05-20 19:18:58 UTC (rev 813)
+++ branches/distr-2.4/pkg/distrMod/R/L2GroupFamilies-methods.R 2012-05-20 23:51:22 UTC (rev 814)
@@ -7,6 +7,15 @@
setMethod("locscalename", signature(object = "L2LocationScaleUnion"),
function(object) object at locscalename)
+setMethod("scaleshapename", signature(object = "L2ScaleShapeUnion"),
+ function(object) object at scaleshapename)
+
+setMethod("scalename", signature(object = "L2LocationScaleUnion"),
+ function(object) object at locscalename["scale"])
+
+setMethod("scalename", signature(object = "L2ScaleShapeUnion"),
+ function(object) object at scaleshapename["scale"])
+
setMethod("withPosRestr", signature(object = "L2ScaleShapeUnion"),
function(object) object at param@withPosRestr)
@@ -20,10 +29,20 @@
function(object, value){
if(length(value)>2||length(value)<1)
stop("value of slot 'locscalename' must be of length one or two")
+ if(is.null(names(value))) names(value) <- c("loc","scale")
object at locscalename <- value
object
})
+setReplaceMethod("scaleshapename", "L2ScaleShapeUnion",
+ function(object, value){
+ if(length(value)>2||length(value)<1)
+ stop("value of slot 'scaleshapename' must be of length one or two")
+ if(is.null(names(value))) names(value) <- c("scale","shape")
+ object at scaleshape <- value
+ object
+ })
+
setReplaceMethod("withPosRestr", "L2ScaleShapeUnion",
function(object, value){
if(length(value)!=1)
Modified: branches/distr-2.4/pkg/distrMod/R/SimpleL2ParamFamilies.R
===================================================================
--- branches/distr-2.4/pkg/distrMod/R/SimpleL2ParamFamilies.R 2012-05-20 19:18:58 UTC (rev 813)
+++ branches/distr-2.4/pkg/distrMod/R/SimpleL2ParamFamilies.R 2012-05-20 23:51:22 UTC (rev 814)
@@ -396,7 +396,8 @@
L2Fam at FisherInfo <- FisherInfo
L2Fam at startPar <- startPar
L2Fam at makeOKPar <- makeOKPar
-
+ L2Fam at scaleshapename <- c("scale"="scale","shape"="shape")
+
L2deriv <- EuclRandVarList(RealRandVariable(L2deriv.fct(param),
Domain = Reals()))
Modified: branches/distr-2.4/pkg/distrMod/man/InternalReturnClasses-class.Rd
===================================================================
--- branches/distr-2.4/pkg/distrMod/man/InternalReturnClasses-class.Rd 2012-05-20 19:18:58 UTC (rev 813)
+++ branches/distr-2.4/pkg/distrMod/man/InternalReturnClasses-class.Rd 2012-05-20 23:51:22 UTC (rev 814)
@@ -104,6 +104,8 @@
the "standard" parameter value. }
\item{\code{locscalename}:}{(only loc/scale classes)[inherited from class \code{"L2LocationScaleUnion"}]
object of class \code{"character"}: names of location and scale parameter. }
+ \item{\code{scaleshapename}:}{(only scale/shape classes)[inherited from class \code{"L2ScaleShapeUnion"}]
+ object of class \code{"character"}: names of location and scale parameter. }
}}
Modified: branches/distr-2.4/pkg/distrMod/man/internalClassUnions-class.Rd
===================================================================
--- branches/distr-2.4/pkg/distrMod/man/internalClassUnions-class.Rd 2012-05-20 19:18:58 UTC (rev 813)
+++ branches/distr-2.4/pkg/distrMod/man/internalClassUnions-class.Rd 2012-05-20 23:51:22 UTC (rev 814)
@@ -5,11 +5,18 @@
\alias{MatrixorFunction-class}
\alias{ShowDetails-class}
\alias{L2LocationScaleUnion-class}
+\alias{L2ScaleShapeUnion-class}
\alias{locscalename}
\alias{locscalename,L2LocationScaleUnion-method}
\alias{locscalename<-}
\alias{locscalename<-,L2LocationScaleUnion-method}
-\alias{L2ScaleShapeUnion-class}
+\alias{scaleshapename}
+\alias{scaleshapename,L2ScaleShapeUnion-method}
+\alias{scaleshapename<-}
+\alias{scaleshapename<-,L2ScaleShapeUnion-method}
+\alias{scalename}
+\alias{scalename,L2ScaleShapeUnion-method}
+\alias{scalename,L2LocationScaleUnion-method}
\alias{withPosRestr,L2ScaleShapeUnion-method}
\alias{withPosRestr<-,L2ScaleShapeUnion-method}
\alias{L2ScaleUnion-class}
@@ -54,10 +61,15 @@
\item{\code{"L2ScaleShapeUnion"}}{is a proper, but virtual in-between class
between class \code{"L2GroupParamFamily"} and, e.g., \code{"GammaFamily"},
\code{"GParetoFamily"}, and \code{"EVDFamily"} (the latter from
- extension package \pkg{RobExtremes}. }
+ extension package \pkg{RobExtremes}; it has a slot
+ \code{scaleshapename} (with corresponding accessor and replacement method)
+ to capture the fact that location and scale
+ parameter may carry names other than \code{"shape"} resp. \code{"scale"};
+ used to provide a common class for (parts of) methods
+ \code{scaleshapename} and \code{scaleshapename<-}. }
\item{\code{"L2ScaleUnion"}}{is a class union between \code{"L2ScaleShapeUnion"}
and \code{"L2LocationScaleUnion"} to allow for specific general
- scaling methods. }
+ scaling methods; to this end there is method \code{scalename}. }
}
}
More information about the Distr-commits
mailing list