Hi
Maybe I am wrong but it seems to me that it is cumulative data from recent
epidemy in some state.
If yes, instead of inventing wheel I would go to canned and proved solution
using tools from
https://www.repidemicsconsortium.org/
I found useful and enlightening this blog especially first part
We can use nls2 to try each value in 10:100 as a possible split point
picking the one with lowest residual sum of squares:
library(nls2)
fm <- nls2(Y ~ cbind(1, pmin(X, X0)), start = data.frame(X0 = 10:100),
algorithm = "plinear-brute")
plot(Y ~ X)
lines(fitted(fm) ~ X, col = "red")
> fm
You need to mathematically define 'turning point' first: "end of
exponential phase" is subjective and meaningless. Once you have a precise
mathematical formulation in hand, you can proceed.
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things
Hello,
Are you looking for a segmented regression?
fit <- lm(Y ~ X)
seg <- segmented::segmented(fit, seg.Z = ~X)
seg$psi[, 'Est.']
#[1] 29.21595
plot(X, Y)
plot(seg, add = TRUE)
Hope this helps,
Rui Barradas
Às 16:12 de 14/05/20, Luigi Marongiu escreveu:
Dear all,
I am trying to find a
Dear all,
I am trying to find a turning point in some data. In the initial phase, the
data increases more or less exponentially (thus it is linear in a nat log
transform), then reaches a plateau. I would like to find the point that
marks the end of the exponential phase.
I understand that the
5 matches
Mail list logo