Re: [R] exponential of a matrix

2008-11-14 Thread Martin Maechler
> "MM" == Martin Maechler <[EMAIL PROTECTED]>
> on Fri, 14 Nov 2008 18:05:54 +0100 writes:

> "DW" == David Winsemius <[EMAIL PROTECTED]>
> on Tue, 11 Nov 2008 17:52:18 -0500 writes:

DW> In 2004 Martyn Plummer said that functionality was
DW> available in packages msm (as MatrixExp) and Lindsey's
DW> rmutils (as mexp)

MM> Well, these two use one of the very dubious ways mentioned below.

oops!  I'm wrong :   MatrixExp() in 'msm',

does, by default (method = "pade") say to use the recommended standard
algorithm (squaring + Pade + scaling).

Last time this came up on the mailing list, for some reason we
had completely overlooked this one ... or it was not yet
available publicly.
My apologies to Chris Jackson, the msm author, whose function
we've overlooked there.

Martin Maechler, ETH Zurich

DW> David Firth also offered:
DW> 
http://www2.warwick.ac.uk/fac/sci/statistics/staff/academic/firth/software/mexp

MM> yes, and that method (and a slight variation of it which uses
MM> LAPACK code) is also part of the 'expm' package on R-forge which
MM> I mentioned in my other reply in this thread (a few minutes
MM> ago).

MM> Martin Maechler


DW> -- David Winsemius


DW> On Nov 11, 2008, at 5:20 PM, Terry Therneau wrote:

>>> Is the matrix exponential available in some package?
>>> 
>>> The cannonical reference is "Nineteen dubious ways to
>>> take the exponential of a matrix".  (Love that title)
>>> 
>>> Terry T.

MM> __
MM> R-help@r-project.org mailing list
MM> https://stat.ethz.ch/mailman/listinfo/r-help
MM> PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
MM> and provide commented, minimal, self-contained, reproducible code.

__
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] exponential of a matrix

2008-11-14 Thread Martin Maechler
> "DW" == David Winsemius <[EMAIL PROTECTED]>
> on Tue, 11 Nov 2008 17:52:18 -0500 writes:

DW> In 2004 Martyn Plummer said that functionality was
DW> available in packages msm (as MatrixExp) and Lindsey's
DW> rmutils (as mexp)

Well, thses two use one of the very dubious ways mentioned below.

DW> David Firth also offered:
DW> 
http://www2.warwick.ac.uk/fac/sci/statistics/staff/academic/firth/software/mexp

yes, and that method (and a slight variation of it which uses
LAPACK code) is also part of the 'expm' package on R-forge which
I mentioned in my other reply in this thread (a few minutes
ago).

Martin Maechler


DW> -- David Winsemius


DW> On Nov 11, 2008, at 5:20 PM, Terry Therneau wrote:

>> Is the matrix exponential available in some package?
>> 
>> The cannonical reference is "Nineteen dubious ways to
>> take the exponential of a matrix".  (Love that title)
>> 
>> Terry T.

__
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] exponential of a matrix

2008-11-14 Thread Martin Maechler
> "PD" == Peter Dalgaard <[EMAIL PROTECTED]>
> on Tue, 11 Nov 2008 23:46:49 +0100 writes:

PD> Terry Therneau wrote:
>> Is the matrix exponential available in some package?

PD> Multiple. At least Matrix and msm. One of Jim Lindsey's
PD> too, but I think that's one of the more dubious ones.

Note also that there has been  the  'expm'  package on R-forge
for a while now.

One reason why we haven't released it to CRAN yet,
is the slightly open issue on the default algorithm to be used.

>> The cannonical reference is "Nineteen dubious ways to
>> take the exponential of a matrix".  (Love that title)
indeed.

PD> Yes, it's a classic. As I recall it, the paper misses
PD> one point, though: You often want a fast way of
PD> computing exp(tQ) (or exp(tQ)%*%v or u%*%exp(tQ)) for
PD> multiple values of t, and it is mainly about finding
PD> exp(Q) as accurately as possible.

I think the paper mentions the problem "en passant";
also that (problem) is anotther important  "TODO" for us authors
of the expm package.

Incidentally, here at ETH we have a master's student working on
these issues for his master's thesis (ending around February'09).

Martin Maechler, ETH Zurich

__
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] exponential of a matrix

2008-11-12 Thread Vincent Goulet

Le mar. 11 nov. à 17:20, Terry Therneau a écrit :



Is the matrix exponential available in some package?


You may also have a look at the expm package for a very  
straightforward operator:


http://r-forge.r-project.org/projects/expm/

Disclaimer: although entirely usable, the package is still considered  
in development. YMMV


Best

Vincent




The cannonical reference is "Nineteen dubious ways to take the  
exponential of a matrix".  (Love that title)


Terry T.

__
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-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] exponential of a matrix

2008-11-11 Thread seanpor

Good morning,

Try expm() in the Matrix package by Douglas Bates and Martin Maechler
http://www.stats.bris.ac.uk/R/web/packages/Matrix/index.html

Note that there is a revised version of that paper, refer:
Cleve Moler and Charles Van Loan (2003) Nineteen dubious ways to compute the
exponential of a matrix, twenty-five years later. SIAM Review 45, 1, 3–49.

Regards,
Sean O'Riordain
[EMAIL PROTECTED]


Peter Dalgaard wrote:
> 
> Terry Therneau wrote:
>>  Is the matrix exponential available in some package?
> 
> Multiple. At least Matrix and msm. One of Jim Lindsey's too, but I think 
> that's one of the more dubious ones.
> 
>>  The cannonical reference is "Nineteen dubious ways to take the
>> exponential of a matrix".  (Love that title)
> 
> Yes, it's a classic. As I recall it, the paper misses one point, though: 
> You often want a fast way of computing exp(tQ) (or exp(tQ)%*%v or 
> u%*%exp(tQ)) for multiple values of t, and it is mainly about finding 
> exp(Q) as accurately as possible.
> 
>>  Terry T.
>> 
>> __
>> 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.
> 
> 
> -- 
> O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
>c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
>   (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
> ~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907
> 
> __
> 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.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/exponential-of-a-matrix-tp20449726p20454590.html
Sent from the R help mailing list archive at Nabble.com.

__
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] exponential of a matrix

2008-11-11 Thread David Winsemius
In 2004 Martyn Plummer said that functionality was available in  
packages msm (as MatrixExp) and Lindsey's rmutils (as mexp)


David Firth also offered:
http://www2.warwick.ac.uk/fac/sci/statistics/staff/academic/firth/software/mexp

--
David Winsemius


On Nov 11, 2008, at 5:20 PM, Terry Therneau wrote:


Is the matrix exponential available in some package?

The cannonical reference is "Nineteen dubious ways to take the  
exponential of a matrix".  (Love that title)


Terry T.


__
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] exponential of a matrix

2008-11-11 Thread Peter Dalgaard

Terry Therneau wrote:

 Is the matrix exponential available in some package?


Multiple. At least Matrix and msm. One of Jim Lindsey's too, but I think 
that's one of the more dubious ones.



 The cannonical reference is "Nineteen dubious ways to take the exponential of a 
matrix".  (Love that title)


Yes, it's a classic. As I recall it, the paper misses one point, though: 
You often want a fast way of computing exp(tQ) (or exp(tQ)%*%v or 
u%*%exp(tQ)) for multiple values of t, and it is mainly about finding 
exp(Q) as accurately as possible.



Terry T.

__
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.



--
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
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] exponential of a matrix

2008-11-11 Thread Terry Therneau
 Is the matrix exponential available in some package?

 The cannonical reference is "Nineteen dubious ways to take the exponential of 
a matrix".  (Love that title)

Terry T.

__
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.