JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for BUGS Archives


BUGS Archives

BUGS Archives


BUGS@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

BUGS Home

BUGS Home

BUGS  March 2013

BUGS March 2013

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: how to do faster Bayesian analyses

From:

Peter Solymos <[log in to unmask]>

Reply-To:

Peter Solymos <[log in to unmask]>

Date:

Wed, 6 Mar 2013 15:06:11 -0700

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (170 lines)

Hi All,

Now I got curious and checked out the jags.parallel function in
R2jags, and I have issues with the implementation (therefore cc-ed to
Yu-Sung Su).

1) the jags.parallel() sets the seed on the workers by calling
clusterSetRNGStream, so that jags() can assign unique seed values to
the inits using the "base::Mersenne-Twister" RNG in JAGS. This would
ensure that chains rarely overlap (which is the current implementation
in WinBUGS, OpenBUGS having no option to change RNG only seed value).

2) JAGS can do better: it uses 4 RNG's by default one for each chain,
and one can use the L'Ecuyer RNG [load.module("lecuyer")] to make sure
that n.chain>4 will produce unique chains.

3) Martyn Plummer took the effort to expose the RNG initialization
(function parallel.seeds in rjags package), so one can call this
without having to call jags.model(...,
n.adapt=0)$state(internal=TRUE).

4) I used this function in the dclone package to allow parallel
execution for JAGS models using snow type clusters or forking
(jags.parfit function). On snow type clusters, it is possible to call
individual lower level JAGS related functions, replicating the rjags
implementation for parallel computations (parCodaSamples,
parJagsModel, parListFactories, parListModules, parLoadModule,
parSetFactory, parUnloadModule, parUpdate).

5) Also, having a same model file written out >1 times on a Socked
cluster (multiple core PC) might result in read/write access problems
thus conflicts among the cores.

6) Why load the "glm" module within jags() without an option to do so?
It might cause problems due to the limitations of block updating.

Cheers,

Peter

--
Péter Sólymos, Dept Biol Sci, Univ Alberta, T6G 2E9, Canada AB
[log in to unmask], Ph 780.492.8534, http://psolymos.github.com
Alberta Biodiversity Monitoring Institute, http://www.abmi.ca
Boreal Avian Modelling Project, http://www.borealbirds.ca


On Wed, Mar 6, 2013 at 1:42 PM, Sedat Sen <[log in to unmask]> wrote:
> Hi list,
>
> Thanks for those very valuable inputs. They were really helpful for me to
> decide where to start. I think I will start trying JAGS and STAN based on
> your suggestions. It is also good to know that there are other options like
> using C, INLA etc.
>
> Best,
>
> Sedat
>
>
>
>
> On Wed, Mar 6, 2013 at 10:27 AM, Arnaud Mosnier <[log in to unmask]> wrote:
>>
>> I support Paco's proposal, depending on the model structure, you can see a
>> huge improvement if you use JAGS in parallel or not.
>> In my case (i.e. using a complex hierarchical model), the speed increased
>> by a factor 100 or even more.
>>
>> Arnaud
>>
>>
>> 2013/3/6 Francisco Rodriguez Sanchez <[log in to unmask]>
>>>
>>> Hi Sedat,
>>>
>>> I would try running JAGS in parallel (see function jags.parallel in
>>> R2jags package). You may be able to use the same script you already have in
>>> BUGS language, so it won't take you much time to try (but see Jags manual
>>> for slight differences). In most cases I have found a remarkable increase in
>>> speed. If it remains too slow, then you can consider one of the alternatives
>>> that have been suggested in previous messages.
>>>
>>> Cheers,
>>>
>>> Paco
>>>
>>> El 05/03/2013 20:52, Sedat Sen escribió:
>>>
>>> Dear list,
>>>
>>> I am doing a simulation study which involves 16 different conditions
>>> (different sample size, # of items etc.). I will analyze an IRT model using
>>> 100 data sets with a Bayesian method. I can do it with WinBUGS and R. I can
>>> also use R2WinBUGS package. But the problem with my analyses is that it
>>> takes too much time. For instance, it takes 2 days to analyze 10 data sets
>>> when I use bugs function in R. Given that I will do 1600 analyses, I assume
>>> my design will take weeks. I know WinBUGS is quite slow when the model is
>>> complex.
>>>
>>> I was wondering if someone can give me some suggestions on how to
>>> overcome this problem. Can I do these analyses just using R rather than
>>> using R to call WinBUGS? Does it make any difference in terms of time if I
>>> use only R? Suggestion about any other software packages is also welcome.
>>>
>>> Thanks in advance,
>>> --
>>> Sedat
>>> ------------------------------------------------------------------- This
>>> list is for discussion of modelling issues and the BUGS software. For help
>>> with crashes and error messages, first mail [log in to unmask] To mail
>>> the BUGS list, mail to [log in to unmask] Before mailing, please check the
>>> archive at www.jiscmail.ac.uk/lists/bugs.html Please do not mail attachments
>>> to the list. To leave the BUGS list, send LEAVE BUGS to
>>> [log in to unmask] If this fails, mail [log in to unmask], NOT
>>> the whole list
>>>
>>>
>>> --
>>> Dr Francisco Rodriguez-Sanchez
>>> Forest Ecology and Conservation Group
>>> Department of Plant Sciences
>>> University of Cambridge
>>> Downing Street
>>> Cambridge CB2 3EA
>>> United Kingdom
>>> http://sites.google.com/site/rodriguezsanchezf
>>>
>>> ------------------------------------------------------------------- This
>>> list is for discussion of modelling issues and the BUGS software. For help
>>> with crashes and error messages, first mail [log in to unmask] To mail
>>> the BUGS list, mail to [log in to unmask] Before mailing, please check the
>>> archive at www.jiscmail.ac.uk/lists/bugs.html Please do not mail attachments
>>> to the list. To leave the BUGS list, send LEAVE BUGS to
>>> [log in to unmask] If this fails, mail [log in to unmask], NOT
>>> the whole list
>>
>>
>> ------------------------------------------------------------------- This
>> list is for discussion of modelling issues and the BUGS software. For help
>> with crashes and error messages, first mail [log in to unmask] To mail
>> the BUGS list, mail to [log in to unmask] Before mailing, please check the
>> archive at www.jiscmail.ac.uk/lists/bugs.html Please do not mail attachments
>> to the list. To leave the BUGS list, send LEAVE BUGS to
>> [log in to unmask] If this fails, mail [log in to unmask], NOT
>> the whole list
>
>
>
>
> --
> SS
> ------------------------------------------------------------------- This
> list is for discussion of modelling issues and the BUGS software. For help
> with crashes and error messages, first mail [log in to unmask] To mail
> the BUGS list, mail to [log in to unmask] Before mailing, please check the
> archive at www.jiscmail.ac.uk/lists/bugs.html Please do not mail attachments
> to the list. To leave the BUGS list, send LEAVE BUGS to
> [log in to unmask] If this fails, mail [log in to unmask], NOT
> the whole list

-------------------------------------------------------------------
This list is for discussion of modelling issues and the BUGS software.
For help with crashes and error messages, first mail [log in to unmask]
To mail the BUGS list, mail to [log in to unmask]
Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
Please do not mail attachments to the list.
To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

March 2024
January 2024
December 2023
August 2023
March 2023
December 2022
November 2022
August 2022
May 2022
March 2022
February 2022
December 2021
November 2021
October 2021
September 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
December 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
2006
2005
2004
2003
2002
2001
2000
1999
1998


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager