Skip to content

feat: cash-flow forecast engine with exponential smoothing (#70)#762

Open
alexchenai wants to merge 1 commit intorohitdash08:mainfrom
alexchenai:feature/cashflow-forecast-70
Open

feat: cash-flow forecast engine with exponential smoothing (#70)#762
alexchenai wants to merge 1 commit intorohitdash08:mainfrom
alexchenai:feature/cashflow-forecast-70

Conversation

@alexchenai
Copy link
Copy Markdown

Summary

Forecasts future cash flow using historical patterns, exponential smoothing, and linear trend analysis.

Features

  • 6-month historical analysis (spending + income)
  • Exponential smoothing (alpha=0.3) for noise reduction
  • Linear trend detection via least-squares regression
  • Confidence scoring per forecast month (decreases with distance)
  • Optimistic and pessimistic scenario bounds
  • Deficit month identification and personalized recommendations
  • Income recording API for more accurate forecasts

API Endpoints

  • GET /api/analytics/cashflow/forecast?months_ahead=3&current_balance=1000
  • POST /api/analytics/cashflow/income {amount, date, source}

Tests

5 tests: empty state, basic forecast structure, confidence decrease, positive outlook detection, scenario bounds validation.

Closes #70

…08#70)

- Analyzes 6 months of spending and income history
- Exponential smoothing (alpha=0.3) for trend projection
- Linear trend detection using least-squares regression
- Confidence scoring that decreases with forecast distance (0.95 to 0.5)
- Optimistic/pessimistic scenario bounds per forecast month
- Deficit month detection and personalized outlook recommendation
- Income recording API for more accurate forecasts
- 5 tests: empty state, basic forecast, confidence decrease, positive outlook, scenario bounds

Closes rohitdash08#70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cash-flow Forecast Engine

1 participant