[R] R - MATLAB apply like function
Dear all, I very often use the R function apply, for speedup purposes. I am now also using MATLAB, and would like to use the same kind of function. I have already asked MATLAB people, and the answer is : vectorize... but of course, this is not always possible. So, instead of using a FOR loop all the time, I tried using the bsxfun. So you R people, who might also use MATLAB, do you have any solution? Are you also nervous about this fact (maybe also because of this R-MATLAB question). Thanks for your help, Dave [[alternative HTML version deleted]] __ R-help@r-project.org 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 communication
Dear all, Imagine that you have a small LAN with two computers. I would like to run R on both, and possible to run computations from one computer to the other one. TCP IP protocole would be preferable. Which package would you use for that? I would be very glad if you could also provide me with some lines of code, e.g., create a matrix X in computer 1, transfer its value to the second computer, make some calculation, and get the value back. Thanks for your help, David [[alternative HTML version deleted]] __ R-help@r-project.org 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] AdMit version 1-01.01
Dear all, The new version of AdMit (version 1.01-01) is now available from CRAN. SUMMARY The package provides functions to perform the fitting of an adaptive mixture of Student-t distributions to a target density through its kernel function. The mixture approximation can then be used as the importance density in importance sampling or as the candidate density in the Metropolis-Hastings algorithm to obtain quantities of interest for the target density itself. We believe that this approach may be applicable in many fields of research and hope that the R package AdMit will be fruitful for many researchers like econometricians or applied statisticians. MODIFICATIONS o change in AdMit.R to deal with convergence problems for simple cases. o the documentation file has been improved (thanks to Achim Zeilis for comments). o a package vignette has been added. o a paper describing the package in detail has been published in the Journal of Statistical Software: http://www.jstatsoft.org/v29/i03. Abstract: This paper presents the R package AdMit which provides functions to approximate and sample from a certain target distribution given only a kernel of the target density function. The core algorithm consists in the function AdMit which fits an adaptive mixture of Student-t distributions to the density of interest via its kernel function. Then, importance sampling or the independence chain Metropolis-Hastings algorithm are used to obtain quantities of interest for the target density, using the fitted mixture as the importance or candidate density. The estimation procedure is fully automatic and thus avoids the time-consuming and difficult task of tuning a sampling algorithm. The relevance of the package is shown in two examples. The first aims at illustrating in detail the use of the functions provided by the package in a bivariate bimodal distribution. The second shows the relevance of the adaptive mixture procedure through the Bayesian estimation of a mixture of ARCH model fitted to foreign exchange log-returns data. The methodology is compared to standard cases of importance sampling and the Metropolis-Hastings algorithm using a naive candidate and with the Griddy-Gibbs approach. o creation of /doc folder with AdMitJSS.txt and AdMitRnews.txt files (the R codes used for JSS and Rnews papers). o CITATION file simplified. o 'coda' package is now Suggests REFERENCES Ardia D, Hoogerheide LF, van Dijk HK (2008). AdMit: Adaptive Mixture of Student-t Distributions in R. R package version 1.01-01. URL http://CRAN.R-project.org/package=AdMit. Ardia D, Hoogerheide LF, van Dijk HK (2009). Adaptive Mixture of Student-t Distributions as a Flexible Candidate Distribution for Efficient Simulation: The R Package AdMit. Journal of Statistical Software, 29(3), 1-32. URL http://www.jstatsoft.org/v29/i03/. Hoogerheide LF (2006). Essays on Neural Network Sampling Methods and Instrumental Variables. Ph.D. thesis, Tinbergen Institute, Erasmus University Rotterdam. Book nr. 379 of the Tinbergen Institute Research Series. Hoogerheide LF, Kaashoek JF, van Dijk HK (2007). On the Shape of Posterior Densities and Credible Sets in Instrumental Variable Regression Models with Reduced Rank: An Application of Flexible Sampling Methods using Neural Networks. Journal of Econometrics, 139(1), 154-180. doi:10.1016/j.jeconom.2006.06.009. Hoogerheide LF, van Dijk HK (2008a). Bayesian Forecasting of Value at Risk and Expected Shorfall Using Adaptive Importance Sampling. Technical Report 2008-092/4, Tinbergen Institute, Erasmus University Rotterdam. URL http://www.tinbergen.nl/ discussionpapers/08092.pdf. Hoogerheide LF, van Dijk HK (2008b). Possibly Ill-Behaved Posteriors in Econometric Models: On the Connection Between Model Structures, Non-Elliptical Credible Sets and Neural Network Simulation Techniques. Technical Report 2008-036/4, Tinbergen Institute, Erasmus University Rotterdam. URL http://www.tinbergen.nl/discussionpapers/08036.pdf. Best regards, David Ardia (package's maintainer) Lennart F. Hoogerheide Herman K. van Dijk [[alternative HTML version deleted]] ___ R-packages mailing list r-packa...@r-project.org https://stat.ethz.ch/mailman/listinfo/r-packages __ R-help@r-project.org 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] Measure of non-ellipticity
Dear all, Do you know if there exists a way to measure de degree of non-ellipticity in a cloud of points. For instance, if you have 1000 draws in dimension d, is there any measure (statistic) which indicates if the cloud of points is elliptical or not (i.e., has been generated from an elliptical distribution). If yes, is it implemented in R? Thanks for your answer, David [[alternative HTML version deleted]] __ R-help@r-project.org 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] AdMit 1.00-02
'AdMit' 1.00-02 is a contributed R package which provides functions to perform the fitting of an adaptive mixture of Student-t distributions to a target density through its kernel function. The mixture approximation can then be used as the importance density in importance sampling or as the candidate density in the Metropolis-Hastings algorithm to obtain quantities of interest for the target density itself. http://cran.at.r-project.org/web/packages/AdMit/index.html -- David Ardia H-building, room 11-26 Econometric Institute Erasmus University PO Box 1738 NL 3000 DR Rotterdam The Netherlands Phone: +31 (0)10 408 2269 ___ R-packages mailing list [EMAIL PROTECTED] https://stat.ethz.ch/mailman/listinfo/r-packages __ R-help@r-project.org 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] No rule to make target 'R/Copy'
Dear all, I am currently building a package with C code (in scr folder). Everything was ok, but now, I get the following error message when compiling the package using R CMD INSTALL: make[2]: *** No rule to make target 'R/Copy', needed in [...] What does that mean? I can still compile other packages containing C code, but not that one. No 00UNLOCK directory has been created . I am on a IBM PC, and use windows XP. Thanks for your help -- David Ardia H-building, room 11-26 Econometric Institute Erasmus University PO Box 1738 NL 3000 DR Rotterdam The Netherlands Phone: +31 (0)10 408 2269 __ R-help@r-project.org 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] No rule to make target 'R/Copy'
No... don't think so. I rerun my computer, moved some folders (I deleted the folder with .C file), rerun the compilation, and it worked... Not sure to understand why. Any idea? Prof Brian Ripley wrote: Do you have a space in some file name? Starting 'Copy '? On Fri, 25 Apr 2008, Ardia David wrote: Dear all, I am currently building a package with C code (in scr folder). Everything was ok, but now, I get the following error message when compiling the package using R CMD INSTALL: make[2]: *** No rule to make target 'R/Copy', needed in [...] What does that mean? I can still compile other packages containing C code, but not that one. No 00UNLOCK directory has been created . I am on a IBM PC, and use windows XP. Thanks for your help -- David Ardia H-building, room 11-26 Econometric Institute Erasmus University PO Box 1738 NL 3000 DR Rotterdam The Netherlands Phone: +31 (0)10 408 2269 __ R-help@r-project.org 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. -- David Ardia H-building, room 11-26 Econometric Institute Erasmus University PO Box 1738 NL 3000 DR Rotterdam The Netherlands Phone: +31 (0)10 408 2269 __ R-help@r-project.org 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] optimization and gradient
Dear all, I am using the functions 'optim' and 'nlminb'. For both, you can provide a function which computes the gradient of the objective function (to enhance speed and precision). In my case, both the objective function and the gradient take time to be computed and share many common computations (similar matrix, products, etc...). Therefore, I have to compute these quantities twice which slows down the procedure. How can I get rid of that in a similar way as with 'nlmin' which allows the attribute 'gradient' in the output of the objective function? Thanks a lot for your answer -- David Ardia H-building, room 11-26 Econometric Institute Erasmus University PO Box 1738 NL 3000 DR Rotterdam The Netherlands Phone: +31 (0)10 408 2269 __ R-help@r-project.org 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.