I read from paper Prophet use three main model components: trend, seasonality, and holidays

which g(t) is the trend function like this?

can anyone bring and example how that formula calculate a value?
Ex. like this f(x) = 2x + 4 => f(4) = 2(4) +4 =12
My case is im using this library but i don't know what method or flow inside this model, im need explain to my lecturer
Thanks
Let's say t is discrete, and has values 1, 2, 3, 4, 5.
Suppose then that we have 2 changepoints, one at t=2, and the other at t=4. These are s_1=2 and s_2=4 in the notation of Section 3.1.1 of the paper.
As defined in that section, a(t) is a vector where a_j(t) will be 1 if t is greater than or equal to s_j. Basically, it is an indicator variable that says if we have passed changepoint j yet. So,
a(1) = [0, 0] # We have passed neither changepoint
a(2) = [1, 0] # We have reached the first changepoint
a(3) = [1, 0]
a(4) = [1, 1] # Now we've reached the second changepoint
a(5) = [1, 1]
delta is a vector that is the amount the slope changes at each of the changepoints. So delta=[5, 10] means that at the first changepoint the slope increases by 5, and at the second it increases by 10. k is the initial slope, before any changepoints. Let's say it is k=2.
Let's consider just the first part of the equation, k + a(t)^T delta. This is the slope of the line. If we plug in the stuff above, we see that
t=1: slope is 2 + 0 * 5 + 0 * 10 = 2 # The initial slope
t=2: slope is 2 + 1 * 5 + 0 * 10 = 7 # At the first changepoint, slope increased by 5
t=3: slope is 2 + 1 * 5 + 0 * 10 = 7
t=4: slope is 2 + 1 * 5 + 1 * 10 = 17 # At the second changepoint, slope increased by 10 more
t=5: slope is 2 + 1 * 5 + 1 * 10 = 17
The second part of the equation is just the offset, which is calculated to ensure all of the pieces of this piecewise linear function connect up. As described in Section 3.1.2, gamma_j = -s_j delta_j, so gamma = [-2 * 5, -4 * 10] = [-10, -40]. So the calculation for the offset is exactly the same as for the slope above, just replace k with m (initial offset), and replace delta with gamma.
You can also see it in code here:
https://github.com/facebook/prophet/blob/0a270b4a19cafb084e5ed6ee0cf942198d4c913b/python/fbprophet/forecaster.py#L1216-L1240
@bletham, super helpful
Most helpful comment
Let's say t is discrete, and has values 1, 2, 3, 4, 5.
Suppose then that we have 2 changepoints, one at t=2, and the other at t=4. These are s_1=2 and s_2=4 in the notation of Section 3.1.1 of the paper.
As defined in that section, a(t) is a vector where a_j(t) will be 1 if t is greater than or equal to s_j. Basically, it is an indicator variable that says if we have passed changepoint j yet. So,
delta is a vector that is the amount the slope changes at each of the changepoints. So delta=[5, 10] means that at the first changepoint the slope increases by 5, and at the second it increases by 10. k is the initial slope, before any changepoints. Let's say it is k=2.
Let's consider just the first part of the equation, k + a(t)^T delta. This is the slope of the line. If we plug in the stuff above, we see that
The second part of the equation is just the offset, which is calculated to ensure all of the pieces of this piecewise linear function connect up. As described in Section 3.1.2, gamma_j = -s_j delta_j, so gamma = [-2 * 5, -4 * 10] = [-10, -40]. So the calculation for the offset is exactly the same as for the slope above, just replace k with m (initial offset), and replace delta with gamma.
You can also see it in code here:
https://github.com/facebook/prophet/blob/0a270b4a19cafb084e5ed6ee0cf942198d4c913b/python/fbprophet/forecaster.py#L1216-L1240