.
Ravi. From: peter dalgaard
[pda...@gmail.com] Sent: Thursday, August 18, 2011 6:37 PM To: Ravi
Varadhan Cc: 'cbe...@tajo.ucsd.edu'; r-de...@stat.math.ethz.ch;
'nas...@uottawa.ca' Subject: Re: [Rd] An example of very slow
computation
: Wednesday, August 17, 2011 2:33 PM
To: 'cbe...@tajo.ucsd.edu'; r-de...@stat.math.ethz.ch; 'nas...@uottawa.ca'
Subject: Re: [Rd] An example of very slow computation
Yes, the culprit is the evaluation of expm(A*t). This is a lazy way of
solving the system of ODEs, where you save analytic
Varadhan
Cc: 'cbe...@tajo.ucsd.edu'; r-de...@stat.math.ethz.ch; 'nas...@uottawa.ca'
Subject: Re: [Rd] An example of very slow computation
On Aug 17, 2011, at 23:24 , Ravi Varadhan wrote:
A principled way to solve this system of ODEs is to use the idea of
fundamental matrix, which is the same
]
On Behalf Of Ravi Varadhan
Sent: Wednesday, August 17, 2011 2:33 PM
To: 'cbe...@tajo.ucsd.edu'; r-de...@stat.math.ethz.ch; 'nas...@uottawa.ca'
Subject: Re: [Rd] An example of very slow computation
Yes, the culprit is the evaluation of expm(A*t). This is a lazy way of
solving the system of ODEs
This message is about a curious difference in timing between two ways of
computing the
same function. One uses expm, so is expected to be a bit slower, but a bit
turned out to
be a factor of 1000. The code is below. We would be grateful if anyone can
point out any
egregious bad practice in our
I think one difference is that negll() is fully vectorized - no loops, whereas
nlogL calls the function sol() inside sapply, i.e. a loop.
Michael
On 17 Aug 2011, at 10:27AM, John C Nash wrote:
This message is about a curious difference in timing between two ways of
computing the
same
John C Nash nas...@uottawa.ca writes:
This message is about a curious difference in timing between two ways of
computing the
same function. One uses expm, so is expected to be a bit slower, but a bit
turned out to
be a factor of 1000. The code is below. We would be grateful if anyone can
-
From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On
Behalf Of cbe...@tajo.ucsd.edu
Sent: Wednesday, August 17, 2011 1:08 PM
To: r-de...@stat.math.ethz.ch
Subject: Re: [Rd] An example of very slow computation
John C Nash nas...@uottawa.ca writes:
This message is about
-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On
Behalf Of Ravi Varadhan
Sent: Wednesday, August 17, 2011 2:33 PM
To: 'cbe...@tajo.ucsd.edu'; r-de...@stat.math.ethz.ch; 'nas...@uottawa.ca'
Subject: Re: [Rd] An example of very slow computation
Yes, the culprit is the evaluation
On 17 Aug 2011, at 7:08PM, cbe...@tajo.ucsd.edu cbe...@tajo.ucsd.edu wrote:
John C Nash nas...@uottawa.ca writes:
This message is about a curious difference in timing between two ways of
computing the
same function. One uses expm, so is expected to be a bit slower, but a bit
turned out
Just a small addition:
If you replace below
sol-function(t)100-sum(expm(A*t)%*%x0)
by
sol-function(t){A@x=A@x*t;100-sum(expm(A)@x * x0)}
(ugly! But avoiding the conversions and generics)
The time on my machine drop further down to 0.3 seconds. (from the original 13
seconds, and then from the
11 matches
Mail list logo