StarTrack-js icon indicating copy to clipboard operation
StarTrack-js copied to clipboard

Organic forecast

Open hipersayanX opened this issue 11 months ago • 3 comments

When showing the forecst trend line, it looks unnatural to show a rect line, instead you can try other formulas that gives a better looking graph. In your case you seems to be calculating the average difference between the oldest and the current period, them sum up the difference over and over, giving you a rect line. Other better options would be calculating the percentual difference between current month and n-months in the post, then project n-months in the future, for example, for calculating the value in B18 you use the formula B18=(B$13*(1+(B$13-B8)/B8)), that will give you an exponential increasing forecast graph. Other option is calculating the difference with the mirrored period, for B18 that is B18=2*C$13-C8. Or you can make an average of booth values. Here is an example graph:

Image

hipersayanX avatar Feb 10 '25 00:02 hipersayanX

This could be a nice addition to this project! I chose least squares regression line because it was the easiest to implement and makes sense in many cases (but not in all).

Would you consider implementing it? If not we can leave the issue open until someone can implement it

seladb avatar Mar 20 '25 08:03 seladb

Where is the function for reading the data, where is the function for the forecast, and where is the function for plotting? os basically, where is the code that do these steps?

hipersayanX avatar Mar 31 '25 04:03 hipersayanX

Here is the function to calculate least squares: https://github.com/seladb/StarTrack-js/blob/ad7ba17ecb59e2d901153ad0b627f9b603fc1cef/src/utils/StargazerStats.ts#L4

And here is where it's being used to calcualte the forecast: https://github.com/seladb/StarTrack-js/blob/ad7ba17ecb59e2d901153ad0b627f9b603fc1cef/src/utils/StargazerStats.ts#L108

seladb avatar Mar 31 '25 06:03 seladb