>>> Ravi Varadhan, Ph.D.
>>> Assistant Professor,
>>> Division of Geriatric Medicine and Gerontology School of Medicine Johns
Hopkins University
>>>
>>> Ph. (410) 502-2619
>>> email: rvarad
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
: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
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
cine Johns
> Hopkins University
>
> Ph. (410) 502-2619
> email: rvarad...@jhmi.edu
>
>
> -Original Message-
> From: r-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
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 th
On 17 Aug 2011, at 7:08PM, wrote:
> John C Nash 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.
>
> Looks like A
619
email: rvarad...@jhmi.edu
-Original Message-
From: r-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'
Subje
al Message-
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 writes:
> This message is ab
John C Nash 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
> point ou
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 fun
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 ou
11 matches
Mail list logo