[R] [R-pkgs] New versions for the distr-family of packages and of package startupmsg
We would like to announce the availability on CRAN (with possibly a minor delay until on every mirror) of new versions of our packages in the "distrXXX"-family (version 1.9), i.e.; "distr", "distrEx", "distrSim", "distrTEst", and "distrDoc" as well as of package for managing startup messages, "startupmsg" (0.5). [all of them require R >= 2.2.0] - * Changes *** of "distr" (1.9), "distrEx" (1.9), "distrSim" (1.9), "distrTEst" (1.9), "distrDoc" (1.9) * - There are major changes in "distr" and "distrEx" from this release on; the more important ones can be inspected at http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR and the pages linked to on this page. Special thanks go to Spencer Graves for spotting some errors in 1.8 (which should be fixed by now) and to G.Jay Kerns for detecting some further bugs and providing code for exact kurtosis and skewness functionals. After package installation you may also have a look at NEWS("") for each of the packages mentioned in this mail. - * Changes *** of "startupmsg" (0.5) * - This may be interesting to those annoyed by our "chatty" startup messages ;-) -> From this version on, you may use suppressPackageStartupMessages() to suppress the startup-messages issued by our packages--- compare http://tolstoy.newcastle.edu.au/R/e2/devel/07/04/3039.html - Short Descriptions - "distr": "distr" is to provide a conceptual treatment of random variables (r.v.'s) by means of S4--classes. A virtual mother class "Distribution" is introduced. All distributions of the "stats" package are implemented as subclasses of either "AbscontDistribution" or "DiscreteDistribution". Using these classes, we also provide (default) methods to automatically generate the image distributions under unary mathematical operations as well as a general convolution algorithm. - "distrSim": Classes and methods are provided for a standardized treatment of simulations (also under contaminations) . - "distrTEst": Classes and methods are provided for a standardized treatment of the evaluation of statistical procedures (up to now only estimators) at data/simulations - "distrEx": This package provides some extensions to package "distr" like: * extreme value distribution classes, * expectations +in the form E(X) for the expectation of X where X is some distribution or +in the form E(X,f) for the expectation of f(X) where X is some distribution and f some function in X, * further functionals: var, sd, IQR, mad, median, kurtosis, skewness * truncated moments * distances between distributions (Hellinger, Kolmogorov, total variation, "convex contamination") * conditional distributions in factorized form * conditional expectations in factorized form - "distrDoc": "distrDoc" provides a common vignette to the distrXXX family --------- "startupmsg": provides utilities for start-up messages for packages - We look forward to receiving questions, comments and suggestions Peter Ruckdeschel Matthias Kohl Thomas Stabla Florian Camphausen ___ R-packages mailing list [EMAIL PROTECTED] https://stat.ethz.ch/mailman/listinfo/r-packages __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Offline ? Searching for James Wettenhall's TclTk Examples
Hi, as a starting point for using Tcl/Tk in R, I used to refer to James Wettenhall's nicely presented TclTk Examples formerly hosted at http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/ These days I have been trying to reach these pages but without success. Does anyone know (James, himself, perhaps ;-) whether they are / will be available at some other location --- it would be a pity if not; I found them really useful. Any advice/comment welcome Peter __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] legend + expression
what about legend("topleft", legend = bquote( R[c]2 == .(format(R2c,nsmall=2)) ) ) HTH, Peter __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Packaging under Win32 / cygwin : ZoneAlarm conflict [solved]
just for the record... recently I have had quite some problems with package building under Win XP. After some searching I found out that it was nothing R was to be blamed for but rather my firewall, i.e.; ZoneAlarm. As it seems, this problem has gone unnoticed so far --- I only found Marc Schwartz's posting http://tolstoy.newcastle.edu.au/R/devel/03b/0246.html in the R-lists-archives. In my case it was not only performance, but there seemes to be a serious leakage phenomenon between cygwin's sh (sh.exe dating from 01-27-04) from Dunchan Murdochs' Rtools.exe (cygpopt-0.dll from 04-13-07) and ZoneAlarm (version 70_337_000) I got reports that "fork: resource temporarily unavailable" and finally virtually it shot off my system ... Searching a bit further I found a more recent posting by Luca Trevisani in the cygwin - archives: http://cygwin.com/ml/cygwin/2007-02/msg00673.html who suggests replacing ZoneAlarm by other free firewalls. In the end I did that, i.e.; removed ZoneAlarm completely from my system and replaced it by some other firewall (and also informed ZoneLabs about that conflict) ... and lived happily ever after ;-) Hopefully this information is of help to others running into similar problems. Best, Peter __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] [OT/R+MikTeX] WinAnsi.enc fonts not found by ghostscript by default [solved]
Concerns: OS Win32 / R 2.5.0 Recently (IIRC not with R < 2.3.0), I had some problems including postscript graphics produced in R into LaTeX with MikTeX [version 2.5.2574]: yap, respectively GhostScript/GSView (versions 8.54/4.7 resp.) threw errors. In fact, I realized this was just the same problem as reported in http://tolstoy.newcastle.edu.au/R/help/06/06/28858.html Apparently, by default, GhostScript did not find the corresponding fonts from WinAnsi.enc . --- Solution with MikTeX: Copy the R afm-directory [in my setup to be found in $R_HOME/library/grDevices] into a TDS-compliant own texmf root directory (see MikTeX 2.5 help, chapter 6),i.e.; [myroot]/fonts/afm/[R] where [myroot] is (one of) your own texmf root directory/ies and [R] is an optional subdirectory to afm, e.g. "R". Then refresh FNDB (under MikTeX -> options). This did the job for me. --- I am not sure whether this is the preferred way to do, but I guess the R afm-fonts will not be subject to frequent/substantial changes, so copying them from the $R_HOME directory will probably not be too harmful with respect to upgrading to (subsequent) new versions of R. Any comments on this are welcome, I hope this will be helpful to others as well Peter __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] [R-pkgs] New versions for the distr-family of packages, of startupmsg, and a new package "distrDoc"
We would like to announce the availability on CRAN of new versions of our packages "distr" (1.8), "distrEx" (0.4-4), "distrSim" (1.8), "distrTEst" (1.8), "startupmsg" (0.4) as well as a new package "distrDoc" (1.8) [all of them require R >= 2.2.0] - * Changes *** of "distr" (1.8), "distrEx" (0.4-4), "distrSim" (1.8), "distrTEst" (1.8), "startupmsg" (0.4) * - There are major changes in "distrSim" and "distrTest" from this release on; the more important ones can be inspected at http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR and the pages linked to on this page. After package installation you may also have a look at NEWS("") for all the packages mentioned in this mail. >From this version on, we provide a more detailed manual for the distrXXX family in form of vignette distributed separately in package "distrDoc" (see below). - Short Descriptions - "distr": "distr" is to provide a conceptual treatment of random variables (r.v.'s) by means of S4--classes. A virtual mother class "Distribution" is introduced. All distributions of the "stats" package are implemented as subclasses of either "AbscontDistribution" or "DiscreteDistribution". Using these classes, we also provide (default) methods to automatically generate the image distributions under unary mathematical operations as well as a general convolution algorithm. - "distrSim": Classes and methods are provided for a standardized treatment of simulations (also under contaminations) . - "distrTEst": Classes and methods are provided for a standardized treatment of the evaluation of statistical procedures (up to now only estimators) at data/simulations - "distrEx": This package provides some extensions to package "distr" like: * extreme value distribution classes, * expectations +in the form E(X) for the expectation of X where X is some distribution or +in the form E(X,f) for the expectation of f(X) where X is some distribution and f some function in X, * further functionals: var, sd, IQR, mad, median * truncated moments, * distances between distributions (Hellinger, Kolmogorov, total variation, "convex contamination") * lists of distributions, * conditional distributions in factorized form * conditional expectations in factorized form - "distrDoc": "distrDoc" provides a common vignette to the distrXXX family --------- "startupmsg": provides utilities for start-up messages for packages - We look forward to receiving questions, comments and suggestions Peter Ruckdeschel Matthias Kohl Thomas Stabla Florian Camphausen ___ R-packages mailing list R-packages@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-packages __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] [R-pkgs] New versions for the distr-family of packages, and a new package "startupmsg"
We would like to announce the availability on CRAN of new versions of our packages "distr" (1.7), "distrEx" (0.4-3), "distrSim" (1.7), "distrTEst" (1.7), as well as a new package "startupmsg" [all of them require R >= 2.2.0] - new package "startupmsg" * - ### startupmsg -- v0.3 Utilities for start-up messages for packages: provides: +functions: to display a NEWS file (if existing) and tags from the DESCRIPTION file of a package +conditions: a new sub-condition to 'message' (with a 'types' slot) is introduced, allowing for scalable startup messages by condition "catchers" muffleMessage() [for StartupMessage], onlytypeMessage(), and custom() additionally: + buildStartupMessage: automatically generates a 'complete' start-up message including *a start-up message of type "version" as to information on the package version *a start-up message of type "notabene" (optionally) *a start-up message of "information" mentioning -?"", -NEWS(""), if there is a NEWS file, -the URL tag of the package DESCRIPTION file, (if existing), -a file / a URL to a manual (optional) (to be called in the .onAttach() / .First.lib() function of a package) + takes up thread "Wishlist: 'quietly' argument for .onAttach() / .First.lib()" on r-devel, April 2006, more precisely: Brian Ripley: https://stat.ethz.ch/pipermail/r-devel/2006-April/037281.html Andy Liaw:https://stat.ethz.ch/pipermail/r-devel/2006-April/037286.html Seth Falcon: https://stat.ethz.ch/pipermail/r-devel/2006-April/037317.html and https://stat.ethz.ch/pipermail/r-devel/2006-April/037367.html also compare https://stat.ethz.ch/pipermail/r-devel/2006-April/037382.html - ** Changes ** of "distr" (1.7), "distrEx" (0.4-3), "distrSim" (1.7), "distrTEst" (1.7), * - The most important changes can be inspected at http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR and the pages linked to on this page. After package installation you may also have a look at NEWS("") for all the packages mentioned in this mail. A more detailed manual is available at http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR/distr.pdf - Short Descriptions - "distr": "distr" is to provide a conceptual treatment of random variables (r.v.'s) by means of S4--classes. A virtual mother class "Distribution" is introduced. All distributions of the "stats" package are implemented as subclasses of either "AbscontDistribution" or "DiscreteDistribution". Using these classes, we also provide (default) methods to automatically generate the image distributions under unary mathematical operations as well as a general convolution algorithm. - "distrSim": Classes and methods are provided for a standardized treatment of simulations (also under contaminations) . - "distrTEst": Classes and methods are provided for a standardized treatment of the evaluation of statistical procedures (up to now only estimators) at data/simulations - "distrEx": This package provides some extensions to package "distr" like: * extreme value distribution classes, * expectations +in the form E(X) for the expectation of X where X is some distribution or +in the form E(X,f) for the expectation of f(X) where X is some distribution and f some function in X, * further functionals: var, sd, IQR, mad, median * truncated moments, * distances between distributions (Hellinger, Kolmogorov, total variation, "convex contamination") * lists of distributions, * conditional distributions in factorized form * conditional expectation
Re: [R] distribution of the product of two correlated normal
Yu, Xuesong schrieb: > Many thanks to Peter for your quick and detailed response to my question. > I tried to run your codes, but seems like "u" is not defined for functions fp > and fm. what is u? > I believe t=X1*X2 > > nen0 <- m2+c0*u ## for all u's used in integrate: never positive no, this is not the problem; u is the local integration variable in local functions f, fm, fp over which integrate() performs integration; it is rather the eps = eps default value passed in functions f, fm, fp which causes a "recursive default value reference" - problem; change it as follows: ### #code by P. Ruckdeschel, [EMAIL PROTECTED], rev. 04-25-06 ### # #pdf of X1X2, X1~N(m1,s1^2), X2~N(m2,s2^2), corr(X1,X2)=rho, evaluated at t # # eps is a very small number to catch errors in division by 0 ### # dnnorm <- function(t, m1, m2, s1, s2, rho, eps = .Machine$double.eps ^ 0.5){ a <- s1*sqrt(1-rho^2) b <- s1*rho c <- s2 ### new: f <- function(u, t = t, m1 = m1, m2 = m2, a0 = a, b0 = b, c0 = c, eps0 = eps) # new (04-25-06): eps0 instead of eps as local variable to f { nen0 <- m2+c0*u #catch a division by 0 nen <- ifelse(abs(nen0)>eps0, nen0, ifelse(nen0>0, nen0+eps0, nen0-eps0)) dnorm(u)/a0/nen * dnorm( t/a0/nen -(m1+b0*u)/a0) } -integrate(f, -Inf, -m2/c, t = t, m1 = m1, m2 = m2, a0 = a, b0 = b, c0 = c)$value+ integrate(f, -m2/c, Inf, t = t, m1 = m1, m2 = m2, a0 = a, b0 = b, c0 = c)$value } ### # #cdf of X1X2, X1~N(m1,s1^2), X2~N(m2,s2^2), corr(X1,X2)=rho, evaluated at t # # eps is a very small number to catch errors in division by 0 ### # pnnorm <- function(t, m1, m2, s1, s2, rho, eps = .Machine$double.eps ^ 0.5){ a <- s1*sqrt(1-rho^2) b <- s1*rho c <- s2 ### new: fp <- function(u, t = t, m1 = m1, m2 = m2, a0 = a, b0 = b, c0 = c, eps0 = eps) # new (04-25-06): eps0 instead of eps as local variable to fp {nen0 <- m2+c0*u ## for all u's used in integrate: never negative #catch a division by 0 nen <- ifelse(nen0>eps0, nen0, nen0+eps0) dnorm(u) * pnorm( t/a0/nen- (m1+b0*u)/a0) } ### new: fm <- function(u, t = t, m1 = m1, m2 = m2, a0 = a, b0 = b, c0 = c, eps0 = eps) # new (04-25-06): eps0 instead of eps as local variable to fm {nen0 <- m2+c0*u ## for all u's used in integrate: never positive #catch a division by 0 nen <- ifelse(nen0< (-eps0), nen0, nen0-eps0) dnorm(u) * pnorm(-t/a0/nen+ (m1+b0*u)/a0) } integrate(fm, -Inf, -m2/c, t = t, m1 = m1, m2 = m2, a0 = a, b0 = b, c0 = c)$value+ integrate(fp, -m2/c, Inf, t = t, m1 = m1, m2 = m2, a0 = a, b0 = b, c0 = c)$value } ## For me this gives, e.g.: > pnnorm(0.5,m1=2,m2=3,s1=2,s2=1.4,rho=0.8) [1] 0.1891655 > dnnorm(0.5,m1=2,m2=3,s1=2,s2=1.4,rho=0.8) [1] 0.07805282 Hth, Peter __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] distribution of the product of two correlated normal
Yu, Xuesong writes: > > Does anyone know what the distribution for the product of two correlated > normal? Say I have X~N(a, \sigma1^2) and Y~N(b, \sigma2^2), and the > \rou(X,Y) is not equal to 0, I want to know the pdf or cdf of XY. Thanks > a lot in advance. > There is no closed-form expression (at least not to my knowledge) --- but you could easily write some code for a numerical evaluation of the pdf / cdf: ### #code by P. Ruckdeschel, [EMAIL PROTECTED] 04-24-06 ### # #pdf of X1X2, X1~N(m1,s1^2), X2~N(m2,s2^2), corr(X1,X2)=rho, evaluated at t # # eps is a very small number to catch errors in division by 0 ### # dnnorm <- function(t, m1, m2, s1, s2, rho, eps = .Machine$double.eps ^ 0.5){ a <- s1*sqrt(1-rho^2) b <- s1*rho c <- s2 f <- function(u, t = t, m1 = m1, m2 = m2, a0 = a, b0 = b, c0 = c, eps = eps) { nen0 <- m2+c0*u #catch a division by 0 nen <- ifelse(abs(nen0)>eps, nen0, ifelse(nen0>0, nen0+eps, nen0-eps)) dnorm(u)/a0/nen * dnorm( t/a0/nen -(m1+b0*u)/a0) } -integrate(f, -Inf, -m2/c, t = t, m1 = m1, m2 = m2, a0 = a, b0 = b, c0 = c)$value+ integrate(f, -m2/c, Inf, t = t, m1 = m1, m2 = m2, a0 = a, b0 = b, c0 = c)$value } ### # #cdf of X1X2, X1~N(m1,s1^2), X2~N(m2,s2^2), corr(X1,X2)=rho, evaluated at t # # eps is a very small number to catch errors in division by 0 ### # pnnorm <- function(t, m1, m2, s1, s2, rho, eps = .Machine$double.eps ^ 0.5){ a <- s1*sqrt(1-rho^2) b <- s1*rho c <- s2 fp <- function(u, t = t, m1 = m1, m2 = m2, a0 = a, b0 = b, c0 = c, eps = eps) {nen0 <- m2+c0*u ## for all u's used in integrate: never negative #catch a division by 0 nen <- ifelse(nen0>eps, nen0, nen0+eps) dnorm(u) * pnorm( t/a0/nen- (m1+b0*u)/a0) } fm <- function(u, t = t, m1 = m1, m2 = m2, a0 = a, b0 = b, c0 = c, eps = eps) { nen0 <- m2+c0*u ## for all u's used in integrate: never positive #catch a division by 0 nen <- ifelse(nen0< -eps, nen0, nen0-eps) dnorm(u) * pnorm(-t/a0/nen+ (m1+b0*u)/a0) } integrate(fm, -Inf, -m2/c, t = t, m1 = m1, m2 = m2, a0 = a, b0 = b, c0 = c)$value+ integrate(fp, -m2/c, Inf, t = t, m1 = m1, m2 = m2, a0 = a, b0 = b, c0 = c)$value } ## If you have to evalute dnnorm() or pnnorm() at a lot of values of t for some given m1, m2, s1, s2, rho, then you should first evaluate [p,d]nnorm() on a (smaller) number of gridpoints of values for t first and then use something like approxfun() or splinefun() to give you a much faster evaluable function. Hth, Peter __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] [R-pkgs] after package reorganization: version 1.6 of package "distr" available; new packages "distrEx", "distrSim", "distrTEst", "RandVar"
After some reorganization, we would like to announce the availability on CRAN of a new version (1.6) of our package "distr" as well as the availabilty on CRAN of the new packages "distrEx", "distrSim", "distrTEst", "RandVar". - Changes from 1.5 to 1.6 -[former package "distr"] reorganization: we have split up our package distr into smaller units: * "distr" now only contains the (basic) classes and methods for distributions * "distrSim" requires "distr" and contains classes and methods for data / simulations formerly contained in "distr" * "distrTEst" requires "distr" and "distrSim" and contains classes and methods for evaluation of estimators at data / simulations formerly contained in "distr" -[distrSim] under the hood: signature of method "simulate" adapted in order to prevent collision with corresponding method from the stats package some more details to be found at http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR a more detailed manual is available at http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR/distr.pdf -additional packages by Matthias Kohl: * "distrEx" requires "distr" and contains some extensions to package "distr" (see later) * "RandVar" requires "distr" and "distrEx" and contains classes and methods for random variables (see later) These two packages are described in some detail in Matthias' PhD Thesis "Numerical Contributions to the Asymptotic Theory of Robustness", App. D available on http://stamats.de/ThesisMKohl.pdf - Short Descriptions - Short Description of "distr": "distr" is to provide a conceptual treatment of random variables (r.v.'s) by means of S4--classes. A virtual mother class "Distribution" is introduced. All distributions of the "base" package are implemented as subclasses of either "AbscontDistribution" or "DiscreteDistribution". Using these classes, we also provide (default) methods to automatically generate the image distributions under unary mathematical operations as well as a general convolution algorithm. - Short Description of "distrSim": Classes and methods are provided for a standardized treatment of simulations (also under contaminations) . - Short Description of "distrTEst": Classes and methods are provided for a standardized treatment of the evaluation of statistical procedures (up to now only estimators) at data/simulations - Short Description of "distrEx": This package provides some extensions to package "distr" like: * extreme value distribution classes, *expectations +in the form E(X) for the expectation of X where X is some distribution or +in the form E(X,f) for the expectation of f(X) where X is some distribution and f some function in X, * truncated moments, * distances between distributions (Hellinger, Kolmogorov, total variation, "convex contamination") * lists of distributions, * conditional distributions in factorized form * conditional expectations in factorized form - Short Description of "RandVar": This package introduces classes and methods for random variables (understood as measurable mappings); in particular groups Math and Arith as well as matrix multiplication and expectations are available so that quite general "regular" expressions with random variables are possible. - We look forward to receiving questions, comments and suggestions Peter Ruckdeschel Matthias Kohl Thomas Stabla Florian Camphausen ----- DESCRIPTIONS - Package: distr Version: 1.6 Date: 2005-10-17 Title: distr Authors: Peter Ruckdeschel <[EMAIL PROTECTED]>, Matthias Kohl <[EMAIL PROTECTED]>, Thomas Stabla <[EMAIL PROTECTED]>,
[R] [R-pkgs] version 1.5 of package "distr" available
We would like to announce the availability on CRAN of a new version (1.5) of our package "distr" . - Changes from 1.4 to 1.5 -package is now using /lazy loading/ -minor changes in the help pages -minor enhancements in plot for distributions (Gamma, discrete distributions) -package now includes a demo - folder; try /demo("distr")/ -class /Gamma/ has been renamed /Gammad/ to avoid name collisions -we have a CITATION file now; consider /citation("distr")/ -enhanced demos: +convolution of uniform variables now includes exact expressions +min/max of two variables now available for discrete distributions -rd-Files have now a keyword entry for distribution and thus may be found by the search engine -exact formula for "Unif" o "numeric" where o \in { +,-,*,/ } - Short Description of "distr": "distr" is to provide a conceptual treatment of random variables (r.v.'s) by means of S4--classes. A virtual mother class "Distribution" is introduced. All distributions of the "base" package are implemented as subclasses of either "AbscontDistribution" or "DiscreteDistribution". Using these classes, we also provide (default) methods to automatically generate the image distributions under unary mathematical operations as well as a general convolution algorithm. Additionally, we also provide classes for a standardized treatment of simulations (also under contaminations) and evaluations of statistical procedures on such simulations. --------- DESCRIPTION: Package: distr Version: 1.5 Date: 2005/03/29 Title: distr Authors: Peter Ruckdeschel <[EMAIL PROTECTED]>, Matthias Kohl <[EMAIL PROTECTED]>, Thomas Stabla <[EMAIL PROTECTED]>, Florian Camphausen <[EMAIL PROTECTED]> Maintainer: Peter Ruckdeschel <[EMAIL PROTECTED]> Description: S4 Classes for Distributions Depends: R (>= 2.0.1), (versions for <=2.0.0, on URL cited below), setRNG (>= 2004.3-1) License: GPL version 2 or later URL: http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR/ Reference: http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR/distr.pdf We look forward to receiving questions, comments and suggestions Peter Ruckdeschel Matthias Kohl Thomas Stabla Florian Camphausen ___ R-packages mailing list [EMAIL PROTECTED] https://stat.ethz.ch/mailman/listinfo/r-packages __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] [R-pkgs] new version of package "distr" available
We would like to announce the availability on CRAN of a new version (1.4) of our package "distr" . - Changes from 1.3 to 1.4 -To avoid name collisions with short forms for TRUE and FALSE: classes T and F (T- and F-distributions) renamed to Td and Fd -The package is now loaded as a binary => considerable speed gain -Using subsititute, the bodies of the r,d,p,q-function-slots distributions show the parameter values with which they were generated -Convolutions and applications of the math group may now be traced in r-slot of a distribution object, compare r(sin(Norm()) + cos(Unif() * 3 + 2)) -Parameters of a distribution (mean, sd, etc) are now tested on length 1 *we see the objects as implementations of univariate distributions, so vectors make no sense here; rather one could gather several objects with possibly different parameters to a vector of distributions. Of course, the original R-functions rnorm etc remain unchanged and still allow for vector-valued parameters. * -Classes "Parameter" , "Distribution" , "UnivariateDistribution" are no longer VIRTUAL -"AbscontParameter" and "DiscreteParameter" are replaced by "Parameter" -Type of slots d,p,q and param is changed to "OptionalFunction" and "OptionalParameter" respectively - Short Description of "distr": "distr" is to provide a conceptual treatment of random variables (r.v.'s) by means of S4--classes. A virtual mother class "Distribution" is introduced. All distributions of the "base" package are implemented as subclasses of either "AbscontDistribution" or "DiscreteDistribution". Using these classes, we also provide (default) methods to automatically generate the image distributions under unary mathematical operations as well as a general convolution algorithm. Additionally, we also provide classes for a standardized treatment of simulations (also under contaminations) and evaluations of statistical procedures on such simulations. --------- DESCRIPTION: Package: distr Version: 1.4 Date: 2004/09/23 Title: distr Authors: Peter Ruckdeschel <[EMAIL PROTECTED]>, Matthias Kohl <[EMAIL PROTECTED]>, Thomas Stabla <[EMAIL PROTECTED]>, Florian Camphausen <[EMAIL PROTECTED]> Maintainer: Peter Ruckdeschel <[EMAIL PROTECTED]> Description: S4 Classes for Distributions Depends: R (>= 1.9.0), (versions for <=1.8.x, on URL cited below), setRNG (>= 2004.3-1) License: GPL version 2 or later URL: http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR/ Reference: http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR/distr.pdf We look forward to receiving questions, comments and suggestions Peter Ruckdeschel Matthias Kohl Thomas Stabla Florian Camphausen ___ R-packages mailing list [EMAIL PROTECTED] https://stat.ethz.ch/mailman/listinfo/r-packages __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] setMethod("min", "myclass", ...)
Hello, first of all thank you for your reply to our help request. On Wed, 3 Dec 2003, John Chambers wrote: Thomas Stabla wrote: I have defined a new class setClass("myclass", representation(min = "numeric", max = "numeric")) and want to write accessor functions, so that for foo = new("myclass", min = 0, max = 1) min(foo) # prints 0 max(foo) # prints 1 At first i created a generic function for "min" setGeneric("min", function(..., na.rm = FALSE) standardGeneric("min")) and then tried to use setMethod. And there's my problem, I don't know the name of the first argument which is to be passed to "min". I can't just write: setMethod("min", "myclass", function(..., na.rm = FALSE) [EMAIL PROTECTED]) The same problem occurs with "max". Generally, it's not a good idea to take a well-known function name and make it into an accessor function. We do agree with you in that point in general. Perhaps we should be a little more precise with our problem: We are working on a distribution class which is to provide an object orientated way to allow for (semi--)automatical generation of new distributions out of existing ones that is, we want to allow for expressions like X+Yfor X~F , Y~G, F,G implementated distributions and then to automatically generate the [r,d,p,q]-functions for X+Y another aim will be to allow to pass distributions as arguments to other functions etc... In our case, the function (min) already takes the role of a parameter to *base* functions, i.e. runif, dunif, punif, qunif, in the sequel denoted by [r,d,p,q]unif; the same argument applies to the functions (mean)and (sd) which are parameters to [r,d,p,q]norm. As we want to build distribution classes with a parameter slot using these functions, it seemed natural to us to use the argument names of these existing functions. Perhaps a simple compromise (which we would tend to use now) is to use capitalized versions of the names for our slots. In a functional language, basic function calls such as min(x), sin(x), etc. should have a natural interpretation. Defining methods for these functions is meant to do what it says: provide a method to achieve the general purpose of the function for particular objects. We agree with you again, and in the particular case of our distribution (a) min, max applied to a distribution should well be interpreted as min and max of the support of this distribution (b) mean and sd for a normal distribution also have their natural meaning So in both cases, these functions do have a natural interpretation and do provide a method to achieve the general purpose of the function to our object. If you want accessor functions, they should probably have names that make their purpose obvious. One convention, a la Java properties, would be getMin(x), etc. (the capitalizing is potentially an issue since slot names are case sensitive). We do not like this so much, as we would prefer keeping as close as possible to the naming convention of the parameters already defined in the [r,d,p,q]- functions in the base package. So probably capitalizing is the thing we should do. [Rest of reply snipped]... Thank you once again for your attention, -- Peter Ruckdeschel Thomas Stabla Matthias Kohl Florian Camphausen __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Version Management for Classes as in Green Book sec 7.4?
Just a simple question: Is there any project going on in the R-Community implementing version management for classes as discussed in the ``/Green Book/'', section 7.4 ? I would really appreciate this feature, above all more or less automatically updating objects of an older class definition. Thank you already. -- Peter Ruckdeschel __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help