RobinHankin / mvp

https://robinhankin.github.io/mvp/
8 stars 3 forks source link

differentiation WRT a frab #69

Open RobinHankin opened 1 year ago

RobinHankin commented 1 year ago

thinking about the argument to deriv():

suppressMessages(library("mvp"))
(p <- as.mvp("x^4*y*3*z^5"))
#> mvp object algebraically equal to
#> 3 x^4 y z^5
deriv(p,c("x","x","y"))
#> mvp object algebraically equal to
#> 36 x^2 z^5
aderiv(p,x=2,y=1)
#> mvp object algebraically equal to
#> 36 x^2 z^5

$\ldots$ but what we really want is to pass a named vector [here it would be c(x=2,y=1)], or, infinitely preferable, a frab object.