feature request: elementwise matrix operations

31 views
Skip to first unread message

Seth Flaxman

unread,
May 27, 2015, 1:06:27 PM5/27/15
to stan...@googlegroups.com
I'll open an issue unless this has already been discussed elsewhere.

For a matrix M, exp(M) works, but cos(M), sin(M), fabs(M), pow(M) etc.
do not. I'm trying to do a periodic GP using cos, so this would be
very helpful. I imagine there are other use cases, and of course the
work around is to just write a function/for loop.

Following exp's lead, I guess this should ideally be implemented for
row_vector and vector as well.

Note: at some point there might be a matrix product implemented, so
it's worth figuring out if pow(M) should be the elementwise one, i.e.
figure out what these will be named.

Best,
Seth

Bob Carpenter

unread,
May 27, 2015, 3:04:20 PM5/27/15
to stan...@googlegroups.com
I created a very general issue outlining what I think
we should do:

https://github.com/stan-dev/stan/issues/1464

I assigned it to myself, but it could be broken out into pieces.

Until then, I suggest writing Stan functions that do what you
want which can then be removed later when we implement them.

- Bob
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

Reply all
Reply to author
Forward
0 new messages