Re: [R] filling a list faster

2007-07-13 Thread Matthias . Kohl
another solution: l <- vector(mode = "list", length = 10^5) system.time(for(i in (1:10^5)) l[[i]] <- c(i,i+1,i)) On my system this version is even slightly faster than the matrix version ... Best, Matthias - original message Subject: Re: [R] filling a list faster Sent: Fri, 13 Jul

Re: [R] Generic distributions

2007-03-06 Thread Matthias Kohl
Hello Alberto, hello Greg, in distr you can do: library(distr) N <- Norm(mean = 1, sd = 2) p(N)(0.5) r(N)(100) !!! not: p(N, 0.5) or r(N, 100) !!! A detailed description of package "distr" is given in package "distrDoc". library(distrDoc) vignette("distr") hth Matthias - original messag

Re: [R] RE gap statistic in cluster analysis

2007-02-09 Thread Matthias Kohl
l [EMAIL PROTECTED] > [[alternative HTML version deleted]] > > __ > 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, minima

Re: [R] Integration + Normal Distribution + Directory Browsing Processing Questions

2007-01-22 Thread Matthias Kohl
> > both work fine. Why is pnorm to prefer? > > Nils > > > Matthias Kohl schrieb: > > Hi, > > > > why don't you use pnorm? > > E.g., > > > > pnorm(1, mean = 0.1, sd = 1.2) - pnorm(0, mean = 0.1, sd = 1.2) > > > > Matthias &g

Re: [R] Integration + Normal Distribution + Directory Browsing Processing Questions

2007-01-21 Thread Matthias Kohl
p@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. > > > &g

Re: [R] package dependency tree

2007-01-02 Thread Matthias Kohl
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] Questions regarding "integrate" function

2006-11-18 Thread Matthias Kohl
ter >University of Minnesota > >______ >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-

Re: [R] Computing time for matrix addition or subtraction

2006-11-13 Thread Matthias Kohl
not concerning your subject line, but function "crossprod" may be useful, too Matthias - original message Subject: Re: [R] Computing time for matrix addition or subtraction Sent: Mon, 13 Nov 2006 From: Prof Brian Ripley<[EMAIL PROTECTED]> > On Sun, 12 Nov 2006, YONGWAN CHUN wrote:

Re: [R] median of gamma distribution

2006-07-03 Thread Matthias Kohl
- > > __ > 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 > --- original Nachricht Ende -- Dr. re

Re: [R] Generic code for simulating from a distribution.

2006-04-09 Thread Matthias Kohl
Hi, have a look at the packages distr and distrSim which are on CRAN. hth Matthias - original Nachricht Betreff: [R] Generic code for simulating from a distribution. Gesendet: Mo, 10. Apr 2006 Von: [EMAIL PROTECTED] > Hello all, > > I have the code below to simulate samples of ce

Re: [R] discrete probability distribution

2006-02-23 Thread Matthias Kohl
lp >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > > -- StaMatS - Statistik + Mathematik Service Dr. rer. nat. Matthias Kohl Gottlieb-Keim-Straße 60 95448 Bayreuth Phone: +49 921 50736457 E-Mail: [EMAIL PROTECTED] Home: www.stamats.de ___

Re: [R] New user: Custom probability distribution

2006-02-09 Thread Matthias Kohl
r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > -- StaMatS - Statistik + Mathematik Service Dr. rer. nat. Matthias Kohl Gottlieb-Keim-Straße 60 95448 Bayreuth Phone: +49 921 50736457 E-Mail: [EMAIL PROTECTED] Home: www.stamats.de

Re: [R] Extending a data frame with S4

2006-01-03 Thread Matthias Kohl
the object. >Is there a way to extend a data.frame, or do I need to create an >object that contains the data frame in a slot? > >Thanks for your help, > >Hadley > >______ >R-help@stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/

Re: [R] convolution of the double exponential distribution

2005-12-28 Thread Matthias Kohl
t;David R. Bickel http://davidbickel.com >Research Scientist >Pioneer Hi-Bred International (DuPont) >Bioinformatics and Exploratory Research >7200 NW 62nd Ave.; PO Box 184 >Johnston, IA 50131-0184 >515-334-4739 Tel >515-334-4473 Fax >[EMAIL PROTECTED], [EMAIL PROTECTED] &g

Re: [R] convolution of the double exponential distribution

2005-12-23 Thread Matthias Kohl
list(loc = loc, scale = sca)) D1 <- new("AbscontDistribution", r = rfun, d = dfun, p = pfun, q = qfun) plot(D1) D2 <- D1 + D1 # convolution based on FFT plot(D2) hth, Matthias -- StaMatS - Statistik + Mathematik Service Dipl.Math.(Univ.) Matthias Kohl www.stamats.de __

Re: [R] Loading namespaces

2005-12-08 Thread Matthias Kohl
__ >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-help@stat.math.ethz.ch mailing li

Re: [R] Vectors of S4 Classes

2005-12-05 Thread Matthias Kohl
386-pc-mingw32 >arch i386 >os mingw32 >system i386, mingw32 >status >major2 >minor1.0 >year 2005 >month04 >day 18 >language R > >__ >R-help@stat.math.ethz.ch mailing list >htt

Re: [R] solution of convolution equation

2005-09-29 Thread Matthias Kohl
Anna Oganyan wrote: >Hello, >May be somebody can help me... >I am trying to find a solution of a convolution equation using fft (and >unfortunately I do not have a good background for this). >So I am just trying to figure out how it can be implemented in R. I have >two multidimensional independe

Re: [R] two-tailed exact binomail test

2005-08-27 Thread Matthias Kohl
Peter Dalgaard wrote: >katrina smith <[EMAIL PROTECTED]> writes: > > > >>I am trying to find a definition for the two-tailed exact binomial >>test but have been unsuccessful. Can you help? >> >> > >Just read binom.test. The relevant bit is this: >(m is the mean == n*p) > >else if

Re: [R] rlm/M/MM-estimator questions

2005-07-07 Thread Matthias Kohl
Christian Hennig wrote: >Hi list, > >1) How can the MM-estimator method="MM" in function rlm be tuned to 85% >efficiency? It seems that there is a default tuning to 95%. I presume, but >am not sure, that the MM-estimator uses phi=phi.bisquare as default and >the tuning constant could be set by add

Re: [R] User-defined random variable

2005-05-01 Thread Matthias Kohl
Achim Zeileis wrote: On Sat, 30 Apr 2005, Peter Dalgaard wrote: Paul Smith <[EMAIL PROTECTED]> writes: Dear All I would like to know whether it is possible with R to define a discrete random variable different from the ones already defined inside R and generate random numbers from that user

Re: [R] Using R to illustrate the Central Limit Theorem

2005-04-23 Thread Matthias Kohl
(Ted Harding) wrote: On 21-Apr-05 [EMAIL PROTECTED] wrote: Here's a bit of a refinement on Ted's first suggestion. [ corrected from runif(M*k), N, k) to runif(N*k), N, k) ] N <- 1 graphics.off() par(mfrow = c(1,2), pty = "s") for(k in 1:20) { m <- (rowMeans(matrix(runif(N*k), N, k)) - 0.5

Re: [R] usage and behavior of 'setIs'

2004-10-25 Thread Matthias . Kohl
Thank you, Matthias > Hi Matthias, > > A similar problem to yours (with one level of inheritance less) was > disccussed this month on the r-devel list. > You find an answer from JChambers here: > > https://stat.ethz.ch/pipermail/r-devel/2004-October/030980.html > > And yes specifying _setAs_ to

[R] usage and behavior of 'setIs'

2004-10-25 Thread Matthias . Kohl
Hello, am I using 'setIs' in the correct way in the subsequent (artifical) example? Do I have to specify explicit 'setAs' for 'list' and 'vector' or should this work automatically, since "getClass("List1")" states an explicit coerce also for these classes. I'm working with R 2.0.0 Patched (2004-

Re: [R] Gumbel distribution

2004-10-14 Thread Matthias . Kohl
please, take a look at package "evd" Matthias > Does R have built in Gumbel distribution (pdf, ecdf, hazard, parameters > estimation) for the minimum case? Thanks > > Anne > [[alternative HTML version deleted]] > > __ > [EMAIL PROTECTED] mailing

Re: [R] setClassUnion

2004-10-14 Thread Matthias . Kohl
sorry, please replace exportClass by exportClasses > Hello, > > I have a question concerning "setClassUnion". > I'm working with R 2.0.0 Patched (2004-10-06) on windows 2000. > > I tried to use "setClassUnion" in a package I am currently working on. > The situation is similar to the following exam

[R] setClassUnion

2004-10-14 Thread Matthias . Kohl
Hello, I have a question concerning "setClassUnion". I'm working with R 2.0.0 Patched (2004-10-06) on windows 2000. I tried to use "setClassUnion" in a package I am currently working on. The situation is similar to the following example: The DESCRIPTION file has entries: Depends: R (>= 2.0.0),

Re: [R] How to pass strings to functions? [once once more, now With content I hope...]

2004-07-08 Thread Matthias . Kohl
> Dear expeRts, > > I fail to succesfully pass strings to functions. It comes down to the > observation that > > > plot(someVariable,anotherVariable) > > works fine, but > > > x <- "someVariable" > > y <- "anotherVariable" > > plot(x,y) > > does not. > > Does this have something to do with the

[R] questions about setMethod("Arith", ...)

2004-07-06 Thread Matthias Kohl
Hi, we have some questions concerning the definition of new arithmetic methods. In our package "distr" (on CRAN) we define some new arithmetic methods for "+", "-", "*", "/". After loading "distr" the corresponding arithmetic methods work. Now, if we define a new class and also a new method for o

Re: [R] Fw: Evaluating strings as variables

2004-06-20 Thread Matthias . Kohl
> "Robin Gruna" <[EMAIL PROTECTED]> writes: > >> I have the following problem: I have a list as follows, >> >> > values <- list(red = 1, yellow = 2, blue = 3) >> >> > values >> $red >> [1] 1 >> >> $yellow >> [1] 2 >> >> $blue >> [1] 3 >> >> There is also a vector containing the diffrent "colors" as

[R] setValidity() changes "Extends"?

2004-06-11 Thread Matthias Kohl
Hi, I'm using Version 1.9.0 (2004-04-12) on Windows NT/98/2000 and found the following difference between using setClass(..., valdity = ), respectively using setValidity() afterwards: setValidity() changes the "Extends"-part of a derived class, is this intended or a bug or am I missing someth

Re: [R] "privileged slots"

2004-05-28 Thread Matthias Kohl
Martin Maechler schrieb: "Matthias" == Matthias Kohl <[EMAIL PROTECTED]> on Thu, 27 May 2004 14:01:51 +0100 writes: Matthias> Hi all, in the help for RClassUtils I found the Matthias> expression "privileged slots" in function Matthias

[R] "privileged slots"

2004-05-27 Thread Matthias Kohl
Hi all, in the help for RClassUtils I found the expression "privileged slots" in function "checkSlotAssignment" with the explanation: /privileged slots (those that can only be set by accesor functions defined along with the class itself)/ I thought all slots of a (not private) class can be a ac

Re: [R] (offtopic) I need two sets of 5 different color scales

2004-04-10 Thread Matthias . Kohl
maybe, the RColorBrewer package does what you want? see also: ColorBrewer.org > Hi, > > I am plotting a policy function (result from a dynamic stochastic > optimization problem, discretized approximation). The policy function > maps from an 2 x 2 x 2 x 3 x B x F state space to a B x F state space

[R] Exactness of ppois

2004-01-15 Thread Matthias Kohl
Hello, by checking the precision of a convolution algorithm, we found the following "inexactness": We work with R Version 1.8.1 (2003-11-21) on Windows systems (NT, 2000, XP). Try the code: ## Kolmogorov distance between two methods to ## determine P(Poisson(lambda)<=x) Kolm.dist <- function(la

Re: [R] var on a vector

2003-10-02 Thread Matthias Kohl
TIA Hello, help(var) says: The denominator n - 1 is used which gives an unbiased estimator of the (co)variance for i.i.d. observations. Try: n <- length(cars[,1]) var(cars[,1])*(n-1)/n Matthias Kohl __ [EMAIL PROTECTED] mailing list https://www.s