similar to: using R functions in a C loop

Displaying 20 results from an estimated 12000 matches similar to: "using R functions in a C loop"

2015 Nov 03
1
Fwd: Rcpp sugar dpois
Hi. Here is a piece of cpp code. It works, but I do not understand the rational for the use of "R::dpois" to call the function dpois since in the examples I have always found directly "dpois" or "Rcpp::dpois" that both do not work in my code. Could anyone be so patient to explain me why should it be like that? Thaks a lot, Enrico #include <Rcpp.h> using
2012 Jan 05
1
Calling R functions within C/C++
Hello everyone! First of all, please note that I'm working under Windows 7. I have written a Gibbs sampler in R and I'm now in the process of translating it in C++ to increase the speed. I'm relatively new to C++ and this question may be trivial, but my search so far have been unsuccessful. In my Gibbs sampler I am using some basic R functions (like the rep function for example)
2013 Apr 02
3
Array analogue of row and col
? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130402/fd10647d/attachment.pl>
2006 Aug 11
2
about MCMC pack again...
Hello, thank you very much for your previous answers about the C++ code. I am interested in the application of the Gibbs Sampler in the IRT models, so in the function MCMCirt1d and MCMCirtkd. I've found the C++ source codes, as you suggested, but I cannot find anything about the Gibbs Sampler. All the files are for the Metropolis algorithm. Maybe I am not able to read them very well, by the
2014 Oct 24
1
package checking apparently ok but R-forge version does not build
Dear r developers, I'm writing a set of new functions for an existing R package on R-forge (called COGARCH). I wrote the new R code (but still no documentation), and updated the NAMESPACE file. I installed it from my local repository and everything seems to work. I checked the local repository and the check did not produces errors, but 2 warnings and 2 notes (I attach the log) one of which
2009 Aug 17
1
Bayesian data analysis - help with sampler function
I have downloaded the Umacs (Universal Markov chain sampler) and submitted the following sample code from Kerman and Gelman.   s <-Sampler( J=8, sigma.y  =c(15,10,16,11,9,11,10,18),           y  =c(28, 8,-3,7,-1,1,18,12),      theta =Gibbs(theta.update,theta.init),           V =Gibbs(V.update,mu.init),         mu =Gibbs(mu.update,mu.init),         tau =Gibbs(tau.update,tau.init),       
2008 Nov 01
2
sampling from Laplace-Normal
Hi, I have to draw samples from an asymmetric-Laplace-Normal distribution: f(u|y, x, beta, phi, sigma, tau) \propto exp( - sum( ( abs(lo) + (2*tau-1)*lo )/(2*sigma) ) - 0.5/phi*u^2), where lo = (y - x*beta) and y=(y_1, ..., y_n), x=(x_1, ..., x_n) -- sorry for this huge formula -- A WinBUGS Gibbs sampler and the HI package arms sampler were used with the same initial data for all parameters. I
2005 Jul 19
1
initial points for arms in package HI
Dear R-users I have a problem choosing initial points for the function arms() in the package HI I intend to implement a Gibbs sampler and one of my conditional distributions is nonstandard and not logconcave. Therefore I'd like to use arms. But there seem to be a strong influence of the initial point y.start. To show the effect I constructed a demonstration example. It is reproducible
2012 Aug 30
2
Which BUGS should one use?
Hello ALL! Some times ago I started to learn and play with Bayesian stuffs. Many advice use of WinBUGS for Bayesian inference Using Gibbs Sampler. However, WinBUGS is discontinued, and now, development is under OpenBUGS. I wasn't lazy, so I installed both and tried out. In more than 90% of cases they give comparable outcome. But in few cases I got substantial differences. Recently, I read nice
2009 Jan 25
1
Gibbs sampler...did it work?
I am writing a Gibbs sampler. I think it is outputting some of what I want, in that I am getting vector of several thousand values (but not 10,000) in a txt file at the end. My question is, is the error message (see below) telling me that it can't output 10,000 values (draws) because of a limitation in my memory, file size, shape etc, or that there is an error in the sampler itself? >
2006 Jun 26
1
Griddy-Gibbs sampler
Hey everyone, I have read the paper by Ritter and Tanner(1992) on Griddy-Gibbs sampler and I am trying to implement it in R without much luck. I was wondering if anyone had used this or could point me to any example code. Thanks, Liz --------------------------------- [[alternative HTML version deleted]]
2010 Oct 22
2
Linking to lapack
Hello all. I'm developing a package for R holding a Gibbs sampler, which tends to have better performance when written in C than in R. During each iteration in the Gibbs sampler, I need the inverse of a symmetric matrix. For this, I wish to use lapack, as is concisely suggested in "Writing R extensions", since this will have better performance than I could ever write myself. After
2011 Dec 03
2
density function always evaluating to zero
Dear R users, I'm trying to carry out monte carlo integration of a posterior density function which is the product of a normal and a gamma distribution. The problem I have is that the density function always returns 0. How can I solve this problem? Here is my code #generate data x1 <- runif(100, min = -10, max = 10) y <- 2 * x1^2 + rnorm(100) # # # # # # # # Model 0 # # # # # # #
2007 Oct 31
1
Simple Umacs example help..
Hello all... I am just starting to teach myself Bayesian methods, and am interested in learning how to use UMacs. I've read the documentation, but the single example is a bit over my head at the level I am at right now. I was wondering if anyone has any simple examples they'd like to share. I've successfully done a couple of simple gibbs examples, but have had a hard time
2009 Mar 03
1
R - need more memory, or rejection sampling algorithm doesn't work?
Hi all, I am trying to run rejection sampling for the quantity z11 in the function below. Unfortunately I can't simplify the function further so that z11 only appears once. Whenever I run the algorithm, R looks as if it is running it (no error messages or anything), but then nothing happens for minutes...how long should it take to run something like this in R? I have tried in in both linux
2011 Apr 05
1
Gibbs sampling
An embedded and charset-unspecified text was scrubbed... Name: n?o dispon?vel URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110405/06486a8a/attachment.pl>
2007 Apr 16
1
Find zeros of analytic functions
Dear Partecipants to the list, I am Enrico Foscolo, a student of the Faculty of Statistics, University of Bologna, and I am interested under consideration of the search of zeros of one function. I would want to write a code using the software R. I have already read the book "Computing the Zeros of Analytic Functions" (P. Kravanja and M. Van Barel, 2000) that speaks about this problem,
2020 Jun 30
2
Users, home directories and profiles
Check the rights before the folder your trying to change. Im guessing that now has 770, try 771 or 775 or 777 Greetz, Louis > -----Oorspronkelijk bericht----- > Van: Enrico Morelli [mailto:morelli at cerm.unifi.it] > Verzonden: dinsdag 30 juni 2020 14:44 > Aan: samba at lists.samba.org > CC: L.P.H. van Belle > Onderwerp: Re: [Samba] Users, home directories and profiles
2007 May 23
1
Where is package "Umacs"?
We were promised this package last spring but I can't find it anywhere! Does anyone have any info? Thanks. >From RNews: "Umacs (Universal Markov chain sampler) is an R package (to be released in Spring 2006) that facilitates the construction of the Gibbs sampler and Metropolis algorithm for Bayesian inference ..." -- View this message in context:
2020 Jul 08
2
Users, home directories and profiles
On Wed, 8 Jul 2020 11:36:50 +0100 Rowland penny via samba <samba at lists.samba.org> wrote: > On 08/07/2020 09:57, Enrico Morelli wrote: > > On Wed, 8 Jul 2020 09:13:37 +0100 > > Rowland penny via samba <samba at lists.samba.org> wrote: > > > >> On 08/07/2020 08:06, Enrico Morelli wrote: > >>> On Wed, 1 Jul 2020 13:03:50 +0100 >