![equation calculator from points equation calculator from points](http://ncalculators.com/images/formulas/linear-interpolation-formula.jpg)
![equation calculator from points equation calculator from points](https://quickonomics.com/wp-content/uploads/2018/11/midpoint-formula.jpg)
I think however I have no idea where the k value is being generated from. When I created a chart in excel they use a different formula x(t) = x(0)*(e^kt) The data I am passing in is over a period of time however the increments in which the time increases are not the same. R += Math.Pow(yvalues/yzero, 1/(Convert.ToDouble(xvalues.ToOADate()) - xzero)) - 1 c is a count of how many r values are added it is not equal to the count of all the values | y | Where y = the first y value #IMPROVMENT - Average 1st y value in range Equation for r = t root|-| - 1 Where y = the current y value | y | Where t = the time sinse the start time (time period) For every value of x (exluding the 1st value) find the r value Xzero = Convert.ToDouble(xvalues.ToOADate()) Find the first value of y (The start value) and the first value of x (The start date)
#Equation calculator from points code#
The equation I have been working off is x(t) = x(0) * ((1+r)^t)Īnd this is the code that I have written to try and replicate the graph: public void ExponentialBestFit(List xvalues, List yvalues) I am aware that there are multiple types of trend line but for now I am trying to calculate exponential growth I am going to be using it to predict future values. I am trying to analyse some data using a C# app and need to calculate trend lines.