[R] How to calculate the derivatives at each data point?

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Tue Jan 31 11:18:12 CET 2023


В Tue, 31 Jan 2023 11:16:21 +0200
konstantinos christodoulou <konstantinos.christodoulou1 using gmail.com>
пишет:

> How can I find the derivatives of the atmospheric measurements at each
> altitude?

Welcome to the world of finite difference methods! If you can find a
good textbook on them, it may be a good idea to skim it.

pracma::fornberg() will give you a numerically stable approximation
(otherwise the Vandermonde matrix required to obtain the Taylor series
coefficients may get hard to solve) to the derivative values you're
interested in, but do note that they are only approximations. In
particular, there's less information for the values at the ends of
the altitude range than for the points in the middle.

>	[[alternative HTML version deleted]]

P.S. Please compose your messages to R-help in plain text:
https://www.r-project.org/posting-guide.html
https://stat.ethz.ch/pipermail/r-help/2023-January/476845.html

-- 
Best regards,
Ivan



More information about the R-help mailing list