I have following time series:
1 10000
2
3
4 20000
5
6
7
8
9
10
11
12
13
14
15
16 200000
And I need to interpolate those values to get the rest of them. How do I do that?
I have following time series:
1 10000
2
3
4 20000
5
6
7
8
9
10
11
12
13
14
15
16 200000
And I need to interpolate those values to get the rest of them. How do I do that?
Copyright © 2021 JogjaFile Inc.
From the comments, it sounds like what you want is a best-fit (as opposed to exact-fit) exponential function. The usual approach to this would be as follows:
Note that if $x,y$ values followed (exactly) the relationship $y = ae^{bx}$, then we would have $$ y = ae^{bx} \implies \log(y) = \ln(a) + bx \leadsto z = a_0 + bx. $$ In other words, the variables $x$ and $z = \ln(y)$ satisfy the relationship $a_0 + bx$ for some numbers $a_0,b$. These numbers would have to satisfy the equation $$ \pmatrix{1&1\\1&4\\1&16} \pmatrix{a_0\\b} = \pmatrix{\ln(10000)\\ \ln(20000)\\ \ln(200000)}. $$ As it turns out, this equation has no exact solution. However, we can obtain the least-squares solution by solving the associated equation $$ \pmatrix{1&1\\1&4\\1&16}^T\pmatrix{1&1\\1&4\\1&16} \pmatrix{a_0\\b} = \pmatrix{1&1\\1&4\\1&16}^T\pmatrix{\ln(10000)\\ \ln(20000)\\ \ln(200000)}. $$ Solving this equation leads to the answer $a_0 = 9.0576, b = 0.1975$. The associated value $a$ is given by $$ \ln(a) = a_0 \implies a = e^{a_0} = 8583.5, $$ which leads to the best-fit model $$ y = 8583.5 \cdot e^{0.1975 \cdot x}. $$