Re: [Rd] proposed simulate.glm method

2009-02-14 Thread Prof Brian Ripley
author can provide simulate.(). But I'm not sure I'm answering the question you've asked.. Martin NicLK> Nicholas >> Message: 9 Date: Fri, 13 Feb 2009 21:27:57 +0100 From: >> Martin Maechler Subject: Re: >> [Rd] proposed simulate.glm method To: Heat

Re: [Rd] proposed simulate.glm method

2009-02-14 Thread Nicholas Lewin-Koh
ernatively, the author can provide simulate.(). > > But I'm not sure I'm answering the question you've asked.. > Martin > > NicLK> Nicholas > > > >> Message: 9 Date: Fri, 13 Feb 2009 21:27:57 +0100 From: > >> Martin Maechle

Re: [Rd] proposed simulate.glm method

2009-02-14 Thread Martin Maechler
stion you've asked.. Martin NicLK> Nicholas >> Message: 9 Date: Fri, 13 Feb 2009 21:27:57 +0100 From: >> Martin Maechler Subject: Re: >> [Rd] proposed simulate.glm method To: Heather Turner >> Cc: r-devel@r-project.org, >> Martin Mae

Re: [Rd] proposed simulate.glm method

2009-02-14 Thread Nicholas Lewin-Koh
object to simulate from? Nicholas > Message: 9 > Date: Fri, 13 Feb 2009 21:27:57 +0100 > From: Martin Maechler > Subject: Re: [Rd] proposed simulate.glm method > To: Heather Turner > Cc: r-devel@r-project.org, Martin Maechler > > Message-ID: <18837.55245.15158

Re: [Rd] proposed simulate.glm method

2009-02-13 Thread Martin Maechler
Thank you, Heather and Ben, > "HT" == Heather Turner > on Fri, 13 Feb 2009 15:52:37 + writes: HT> Yes, thanks to Ben for getting the ball rolling. His HT> code was more streamlined than mine, pointing to further HT> simplifications which I've included in the extended

Re: [Rd] proposed simulate.glm method

2009-02-13 Thread Paul Gilbert
If you are generalizing this, the saving of the RNG information to reproduce normally distribution random number also needs to save the normal generator information. (This looks like an omission in simulate.lm.) You might want to consider adding the simple functions setRNG and getRNG from my se

Re: [Rd] proposed simulate.glm method

2009-02-13 Thread Heather Turner
Yes, thanks to Ben for getting the ball rolling. His code was more streamlined than mine, pointing to further simplifications which I've included in the extended version below. The code for the additional families uses functions from MASS and SuppDists - I wasn't sure about the best way to do this

Re: [Rd] proposed simulate.glm method

2009-02-13 Thread Martin Maechler
Thanks a lot, Heather, > "HT" == Heather Turner > on Fri, 13 Feb 2009 11:49:06 + writes: HT> Dear Martin, HT> I think a simulate.glm method ought to be able to work for gnm objects HT> too. David Firth and I started to work on this a long time ago, but HT> stopped

Re: [Rd] proposed simulate.glm method

2009-02-13 Thread Heather Turner
Dear Martin, I think a simulate.glm method ought to be able to work for gnm objects too. David Firth and I started to work on this a long time ago, but stopped part-way through when simulate.lm was introduced, thinking that simulate.glm was probably in the pipeline and we were duplicating effort.

Re: [Rd] proposed simulate.glm method

2009-02-13 Thread Martin Maechler
> "BB" == Ben Bolker > on Thu, 12 Feb 2009 11:29:14 -0500 writes: BB> I have found the "simulate" method (incorporated BB> in some packages) very handy. As far as I can tell the BB> only class for which simulate is actually implemented BB> in base R is lm ... this is a

Re: [Rd] proposed simulate.glm method

2009-02-12 Thread Ben Bolker
Elsewhere (at least in lme4), refit(sim(model)) does the same thing [and so one would need something like apply(sim(model,1000),2,refit)]. sim() is quite interesting, as is Zelig, but I'm not sure I am ready to leap to it yet -- this was basically a suggestion that simulate.glm could be includ

Re: [Rd] proposed simulate.glm method

2009-02-12 Thread Alex D'Amour
There is functionality similar to this included in the Zelig package with it's "sim" method. The "sim" method goes a step further and replicates the fitted model's analysis on the generated datasets as well. I would suggest taking a look -- Zelig supports most (if not all) glm models and a wide ran

[Rd] proposed simulate.glm method

2009-02-12 Thread Ben Bolker
I have found the "simulate" method (incorporated in some packages) very handy. As far as I can tell the only class for which simulate is actually implemented in base R is lm ... this is actually a little dangerous for a naive user who might be tempted to try simulate(X) where X is a glm fit inst