Re: [Rd] Bug in optim for specific orders of magnitude

2023-01-03 Thread GILLIBERT, Andre

J C Nash wrote:
> Extreme scaling quite often ruins optimization calculations. If you think 
> available methods are capable of doing this, there's a bridge I can sell you 
> in NYC.

Given that optim()seems to have problem with denormals but work correctly with 
values greater than 1e-308, I think that it can hardly be considered a real bug.

There is no miracle solution, but there are a few tricks to work with extreme 
values.
What I call "flogs" are alternative representation of a number x as log(abs(x)) 
and sign(x). It supports very large and very small numbers, but the precision 
of flogs is very poor for very large numbers. Functions for addition, 
substraction, multiplication, etc, can easily be written.

For values that are between 0 and 1 and can be extremely close to 0 or 
extremely close to 1, a cloglog transformations can be used.

Another trick is to detect "hot points". Values that can be extremely close to 
hot points should be expressed as differences to the hot point, and the 
algorithm should be re-written to work with that, which is not always easy to 
do. For instance, the function log1p can be seen as a modification of the log 
function when the hot point is 1. 

In my experience, the algorithm should be rewritten before having to deal with 
denormals, because denormals expand the range of floating point values by a 
quite small amount.

-- 
Sincerely
André GILLIBERT
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] R 4.2.2 on Haiku

2023-01-03 Thread Viechtbauer, Wolfgang (NP)
Hi all,

Not sure if this is of interest to anybody, but with the help of some kind 
folks over at the #haiku channel on IRC, I finally got the current version of R 
to compile under the Haiku operating system (https://www.haiku-os.org):

https://scholar.social/@wviechtb/10962707822595

Kate (https://kate-editor.org) makes for a workable IDE allowing for REPL-like 
interactivity. X11 support is lacking, so graphs are directly created as pdfs, 
but this is workable.

In case you want to give this a try, it's pretty much this:

pkgman install gcc_fortran bzip2_devel lrzip_devel xz_utils_devel 
libpcre2_devel libiconv_devel curl_devel readline_devel tiff4_devel libtool 
ncurses6_devel libpaper_devel lapack_devel tcl_devel xcairo_devel pangomm_devel

wget https://cran.r-project.org/src/base/R-4/R-4.2.2.tar.gz

tar -xzf R-4.2.2.tar.gz
cd R-4.2.2

export CPPFLAGS="-D_BSD_SOURCE"
export LIBS="-lnetwork -lbsd"

./configure --with-x=no --disable-java --enable-R-shlib 
--prefix=/boot/home/
make
make install

Best,
Wolfgang

-- 
Wolfgang Viechtbauer, PhD, Statistician | Department of Psychiatry and
Neuropsychology | Maastricht University | PO Box 616 (VIJV1) | 6200 MD
Maastricht, The Netherlands | +31(43)3884170 | https://www.wvbauer.com

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] 回复: R 4.2.2 on Haiku

2023-01-03 Thread gong yu
thank you very much,  use R on haiku-os several times before. the OS is fast 
and eye-candy, just release beta 4 before new year.
when use R on haiku-os, some package will compiled failed(cairo for example) 
,but most package work seamlessly.

btw, about R on haiku-os , Maybe you could create a git push on haikuports?
haikuports/dev-lang/r at master · haikuports/haikuports 
(github.com)

[https://opengraph.githubassets.com/99315a64241d0f1906ef7bc8d4dab63cc45fb5bb90c51b40d0537e663fca4096/haikuports/haikuports]
haikuports/dev-lang/r at master · 
haikuports/haikuports
Software ports for the Haiku operating system. Contribute to 
haikuports/haikuports development by creating an account on GitHub.
github.com



Yu Gong


发件人: R-devel  代表 Viechtbauer, Wolfgang (NP) 

发送时间: 2023年1月4日 4:25
收件人: R Devel List 
主题: [Rd] R 4.2.2 on Haiku

Hi all,

Not sure if this is of interest to anybody, but with the help of some kind 
folks over at the #haiku channel on IRC, I finally got the current version of R 
to compile under the Haiku operating system (https://www.haiku-os.org):

https://scholar.social/@wviechtb/10962707822595

Kate (https://kate-editor.org) makes for a workable IDE allowing for REPL-like 
interactivity. X11 support is lacking, so graphs are directly created as pdfs, 
but this is workable.

In case you want to give this a try, it's pretty much this:

pkgman install gcc_fortran bzip2_devel lrzip_devel xz_utils_devel 
libpcre2_devel libiconv_devel curl_devel readline_devel tiff4_devel libtool 
ncurses6_devel libpaper_devel lapack_devel tcl_devel xcairo_devel pangomm_devel

wget https://cran.r-project.org/src/base/R-4/R-4.2.2.tar.gz

tar -xzf R-4.2.2.tar.gz
cd R-4.2.2

export CPPFLAGS="-D_BSD_SOURCE"
export LIBS="-lnetwork -lbsd"

./configure --with-x=no --disable-java --enable-R-shlib 
--prefix=/boot/home/
make
make install

Best,
Wolfgang

--
Wolfgang Viechtbauer, PhD, Statistician | Department of Psychiatry and
Neuropsychology | Maastricht University | PO Box 616 (VIJV1) | 6200 MD
Maastricht, The Netherlands | +31(43)3884170 | https://www.wvbauer.com

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel