# Aggregations and trends The "aggregate" option provides flexibility in how data is aggregated within the graph, allowing users to modify the visualization to display trends more effectively. ## None Screenshot 2024-03-14 at 20 06 44 The graph is display with an automatic binning, aggregating depending on zooming level. When zooming in is possible to see each day with the actual number of new stars on that day: Screenshot 2024-03-14 at 20 07 20 ## Trend The trend service uses [Prophet](https://github.com/facebook/prophet), maintained in a separate [repository](https://github.com/emanuelef/daily-stars-predictor). If the service is unavailable, the browser fits a robust, regularized piecewise linear trend. It groups observed daily star counts into calendar weeks, fits the average daily rates, and limits changes in the fitted slope to capture longer-term movement. Histories shorter than six weeks use individual days to retain enough observations for the fit. Robust fitting reduces the influence of isolated spikes. Missing dates are not treated as zero-star days. This local model is separate from Prophet and may produce different estimates. The local trend includes a 30-day projection starting the day after the last observation. It continues the latest fitted direction, with estimated daily stars bounded at zero. If fewer than seven observations exist within the final 14 calendar days, the projection holds the final fitted rate constant. Historical cumulative totals remain unchanged; projected totals add each estimated day's stars to the last observed total. The subtitle identifies locally calculated results, and dashed lines mark projected dates. “Recent + projection” shows the last 30 observed days alongside the estimates. Screenshot 2024-03-14 at 20 13 21 ## Yearly Binning The data is aggregated by year regardless of the zooming. The value is the daily average per year. Screenshot 2024-03-14 at 20 14 37 ## Monthly Binning The data is aggregated by month regardless of the zooming. The value is the daily average per month. Screenshot 2024-03-14 at 20 15 07 ## Weekly Binning The data is aggregated by week regardless of the zooming. The value is the daily average per week. Screenshot 2024-03-14 at 20 15 47 ## Normalize Some repo like [twbs/bootstrap](https://emanuelef.github.io/daily-stars-explorer/#/twbs/bootstrap) shows a spike at the beginning that is making the rest of the days look flat. It's always possible to manually zoom in, but in that case the normalize option can help. Screenshot 2024-03-14 at 20 21 41 Normalize options calculates the 98 percentile of all non zero values and replaces all the values above that with it. Screenshot 2024-03-14 at 20 23 30 ## LOESS Calcualted LOESS regression using https://github.com/HarryStevens/d3-regression?tab=readme-ov-file#regressionLoess Screenshot 2024-03-14 at 21 24 42 ## Running Average Running average on a fixed 120 day window Screenshot 2024-03-14 at 21 26 13 ## Running Median Not sure this is really used or just something I tried but this is the running median on a fixed 120 day window Screenshot 2024-03-14 at 21 27 20 ## Derivative The first-order derivative of a measure represents the rate of change or the slope of the measure's curve at any given point. In other words, it indicates how quickly the new stars are increasing or decreasing atthat point. Since the daily stars are quite noisy the first derivative amplifies that noise, might worth trying to calculate it after smoothing the timeseries. Screenshot 2024-03-14 at 21 28 11 ## Second Derivative Second order discrete derivative. Should indicate the acceleration of the new stars, porsitve values mean it is accelerating. Screenshot 2024-03-14 at 21 30 09