Skip to content
Back to formatted view

Raw Message

Message-ID: <20211107162238.5b50fc98@absentia>
Date: 2021-11-07T08:22:38Z
From: Berwin A Turlach
Subject: Environmental oddity --- reproducible example.
In-Reply-To: <20211107193340.444cad96@rolf-Latitude-E7470>

G'day Rolf,

On Sun, 7 Nov 2021 19:33:40 +1300
Rolf Turner <r.turner at auckland.ac.nz> wrote:

> library(Deriv)
> d1 <- Deriv(dnorm,"sd")
> source("d2.txt") # d2.txt is attached
> 
> d1(1,0,3,TRUE) # [1] -0.2962963
> d2(1,0,3,TRUE) # [1] -0.8888889

Fascinating:

R> pryr::call_tree(body(d1))
R> pryr::call_tree(body(d2))

clearly show that the two functions have a different idea to what
expression the final "/sd" is applied too (as an earlier poster
suggested), but I have no idea why.

Deriv() seems to return the correct function, but when it is displayed,
the deparser(?) somehow omits a crucial pair of braces.

Cheers,

	Berwin