alternative parameterizations of cutpoints/simplex

37 views
Skip to first unread message

Bob Carpenter

unread,
Nov 17, 2012, 1:26:19 PM11/17/12
to stan...@googlegroups.com
This came up on stan-users.

On 11/16/12 8:23 PM, Ben Goodrich wrote:

> Actually, instead of rescaling and / or relocating a simplex, it might work better to consider
> the cumulative sum of a
> simplex to be chunks of the logistic CDF. If you feed those into the inverse CDF, which is known in the case of the
> logistic distribution, then you get cutpoints out.

We can fiddle with the transforms for ordered vars
and for simplexes. Now that I see how important these
geometric decisions are, I keep wondering if we can
find better-behaved general transforms than what we use
now. Andrew -- this is another kind of exploration that
could be good for a grad student because I could easily
see it leading to a neat self-contained paper.

> On Friday, November 16, 2012 3:17:11 PM UTC-5, tds151 wrote:
>
> thank you. just want to clarify that there is not a cumsum function in stan returning a vector. i will then write
> it in the stan script (in the absence of partial indexing).

I added cumulative_sum() function to the to-do list. We've
seen it a few times, so might as well have it. I'm going
to go on a function-writing binge because the requests
are stacking up.

- Bob

Bob Carpenter

unread,
Dec 29, 2012, 2:20:43 PM12/29/12
to stan...@googlegroups.com
g++ itself is a 32-bit program from Rtools? Can it
still compile 64-bit executables for 64-bit R?

The 32-bit limitation is really too bad because of the
amount of memory we want in the compiler. This could
be very limiting for Windows users.

Is there somewhere we can point people to get instructions
on swappin gin a 64-bit compiler?

- Bob

On 12/28/12 9:51 PM, Jiqiang Guo wrote:
> Just to point out that the gcc in Rtools is 32 bits program, which cannot take advantage of all the RAM in a 64 bits OS.


Ben Goodrich

unread,
Dec 29, 2012, 2:39:04 PM12/29/12
to stan...@googlegroups.com
On Saturday, December 29, 2012 2:20:43 PM UTC-5, Bob Carpenter wrote:
g++ itself is a 32-bit program from Rtools?  Can it
still compile 64-bit executables for 64-bit R?

The 32-bit limitation is really too bad because of the
amount of memory we want in the compiler.  This could
be very limiting for Windows users.

Is there somewhere we can point people to get instructions
on swappin gin a 64-bit compiler?

According to 


it seems the executables are 32bit but you can get them to produce 64bit binaries by adding the appropriate flags.

Ben

Daniel Lee

unread,
Dec 29, 2012, 2:39:56 PM12/29/12
to stan...@googlegroups.com
On Sat, Dec 29, 2012 at 2:39 PM, Ben Goodrich <goodri...@gmail.com> wrote:
On Saturday, December 29, 2012 2:20:43 PM UTC-5, Bob Carpenter wrote:
g++ itself is a 32-bit program from Rtools?  Can it
still compile 64-bit executables for 64-bit R?

The 32-bit limitation is really too bad because of the
amount of memory we want in the compiler.  This could
be very limiting for Windows users.

Is there somewhere we can point people to get instructions
on swappin gin a 64-bit compiler?

According to 


it seems the executables are 32bit but you can get them to produce 64bit binaries by adding the appropriate flags.


Is there a simple way to figure out whether or not it compiles a 64-bit executable by default? Should I just run a model with a lot of data?




On 12/28/12 9:51 PM, Jiqiang Guo wrote:
> Just to point out that the gcc in Rtools is 32 bits program, which cannot take advantage of all the RAM in a 64 bits OS.


--
 
 

Ben Goodrich

unread,
Dec 29, 2012, 2:42:45 PM12/29/12
to stan...@googlegroups.com
On Saturday, December 29, 2012 2:39:56 PM UTC-5, Daniel Lee wrote:
On Sat, Dec 29, 2012 at 2:39 PM, Ben Goodrich <goodri...@gmail.com> wrote:
On Saturday, December 29, 2012 2:20:43 PM UTC-5, Bob Carpenter wrote:
g++ itself is a 32-bit program from Rtools?  Can it
still compile 64-bit executables for 64-bit R?

The 32-bit limitation is really too bad because of the
amount of memory we want in the compiler.  This could
be very limiting for Windows users.

Is there somewhere we can point people to get instructions
on swappin gin a 64-bit compiler?

According to 


it seems the executables are 32bit but you can get them to produce 64bit binaries by adding the appropriate flags.


Is there a simple way to figure out whether or not it compiles a 64-bit executable by default? Should I just run a model with a lot of data?

I would imagine that it produces 32bit binaries by default. That is the norm on Windows I think, even 64bit Windows.

Ben

Ben Goodrich

unread,
Dec 29, 2012, 2:44:45 PM12/29/12
to stan...@googlegroups.com
On Saturday, December 29, 2012 2:42:45 PM UTC-5, Ben Goodrich wrote:
On Saturday, December 29, 2012 2:39:56 PM UTC-5, Daniel Lee wrote:
On Sat, Dec 29, 2012 at 2:39 PM, Ben Goodrich <goodri...@gmail.com> wrote:
On Saturday, December 29, 2012 2:20:43 PM UTC-5, Bob Carpenter wrote:
g++ itself is a 32-bit program from Rtools?  Can it
still compile 64-bit executables for 64-bit R?

The 32-bit limitation is really too bad because of the
amount of memory we want in the compiler.  This could
be very limiting for Windows users.

Is there somewhere we can point people to get instructions
on swappin gin a 64-bit compiler?

According to 


it seems the executables are 32bit but you can get them to produce 64bit binaries by adding the appropriate flags.


Is there a simple way to figure out whether or not it compiles a 64-bit executable by default? Should I just run a model with a lot of data?

I would imagine that it produces 32bit binaries by default. That is the norm on Windows I think, even 64bit Windows.

And it says so at the cran link.

Jiqiang Guo

unread,
Dec 29, 2012, 2:45:02 PM12/29/12
to stan...@googlegroups.com
By default, the gcc in rtools generated 32 bit exe code.  We can show that by using the file.exe command in rtools\bin.
See the following examples.

C:\Users\root\Desktop>type a.c
#include <stdio.h>

int main() {
  printf("H.\n");
  return 0;
}

C:\Users\root\Desktop>c:\rtools\gcc-4.6.3\bin\gcc a.c

C:\Users\root\Desktop>c:\rtools\bin\file a.exe
a.exe: PE32 executable for MS Windows (console) Intel 80386 32-bit

C:\Users\root\Desktop>c:\rtools\gcc-4.6.3\bin\gcc -m64 a.c

C:\Users\root\Desktop>c:\rtools\bin\file a.exe
a.exe: PE32+ executable for MS Windows (console) Mono/.Net assembly


--
Jiqiang

--
 
 

Ben Goodrich

unread,
Dec 29, 2012, 2:53:25 PM12/29/12
to stan...@googlegroups.com
On Saturday, December 29, 2012 2:45:02 PM UTC-5, Jiqiang Guo wrote:
By default, the gcc in rtools generated 32 bit exe code.  We can show that by using the file.exe command in rtools\bin.

Maybe have set_cppo() add -m64 to CFLAGS on Windows iff R.version$arch indicates the machine is 64bit?

Ben

Jiqiang Guo

unread,
Dec 29, 2012, 2:53:54 PM12/29/12
to stan...@googlegroups.com
Theoretically it is doable and it is easy to download some 64-bit gcc toolchains 

But most of those that can be downloaded are supporting only either 32bit target or 64bits target.  I guess that is not a problem for an individual.  But without much testing, I am sure enough those are compatible with R for some reason as in my limited experience, I have a 64 bits compiler that can compile models' in RStan but it cranes R.  

--
Jiqiang 

Jiqiang Guo

unread,
Dec 29, 2012, 2:57:20 PM12/29/12
to stan...@googlegroups.com
This is not necessary for R 64 bits on windows since the makefiles used for R CMD SHLIB has -m64 flag.  It is just that gcc itself is 32 bits, which seems to easily have memory issues under -O0. 

--
Jiqiang 

Ben Goodrich

unread,
Dec 29, 2012, 3:06:10 PM12/29/12
to stan...@googlegroups.com
On Saturday, December 29, 2012 2:57:20 PM UTC-5, Jiqiang Guo wrote:
This is not necessary for R 64 bits on windows since the makefiles used for R CMD SHLIB has -m64 flag.  It is just that gcc itself is 32 bits, which seems to easily have memory issues under -O0. 

Okay, well maybe that is another reason to document the possibility of O=s. There was also a post

https://lkml.org/lkml/2012/12/26/8

that doing so leads to faster execution for a couple of the benchmarks relevant to the Linux kernel, but I haven't tested our models with it yet.

Ben


Jiqiang Guo

unread,
Dec 29, 2012, 3:48:30 PM12/29/12
to stan...@googlegroups.com
When Os is set, we cannot achieve any goal of using set_cppo('debug').  
But it is not a problem to add -Os to RStan's set_cppo such as set_cppo("small").  So I will add that. 

--
Jiqiang

--
 
 

Jiqiang Guo

unread,
Jan 2, 2013, 4:51:58 PM1/2/13
to stan...@googlegroups.com
The discussion on Rcpp-dev list made me realized that I should installing Rcpp from source if the compiler used for rstan is different from Rcpp. 
After doing that, switching to a gcc other than that in Rtools seems to work.

--
Jiqiang 

Ben Goodrich

unread,
Jan 2, 2013, 7:28:25 PM1/2/13
to stan...@googlegroups.com
On Wednesday, January 2, 2013 4:51:58 PM UTC-5, Jiqiang Guo wrote:
The discussion on Rcpp-dev list made me realized that I should installing Rcpp from source if the compiler used for rstan is different from Rcpp. 
After doing that, switching to a gcc other than that in Rtools seems to work.

CRAN also suggests compiling Rcpp from source. If you do that, can you get clang to pass test-unit on Windows?

Ben

Reply all
Reply to author
Forward
0 new messages