A web application for exploratory time series analysis, built for a KNTU course project. Users upload a CSV/XLSX file (or generate a synthetic series) and get autocorrelation (ACF), partial autocorrelation (PACF), trend, differencing, MA-model parameter estimation, and AI-generated (Persian) commentary on the results.
The UI is in Persian (RTL). The frontend is a React + TypeScript SPA; all numerical analysis runs in a Python/Flask backend.
- CSV/XLSX upload & parsing into a labeled time series.
- Autocorrelation (ACF) for lags 1–10, plus trend coefficient estimation via linear regression.
- Partial autocorrelation (PACF) (via
statsmodels) with significance/confidence-bound reference lines on the chart. - First-order differencing of the series, with re-analysis of the differenced data.
- MA(1) series generation from user-supplied φ₁, variance, and sample size.
- MA(q) parameter estimation, using both Method of Moments and MSE/CSS minimization.
- AI feedback (Groq / Llama 3.3) that interprets the ACF and trend results in Persian.
- Dark/light mode, multi-page layout with routing.
- Frontend: React 18 + TypeScript, Vite, React Router, shadcn/ui (Radix primitives) + Tailwind, Recharts for charts,
xlsxfor spreadsheet parsing. - Backend: Python, Flask + Flask-CORS, NumPy/SciPy (parameter optimization),
statsmodels(PACF), Groq API (AI feedback).
src/
App.tsx # single-page analysis flow (upload -> analyze -> difference)
pages/
TimeSeriesPage.tsx # analysis page (routed variant of App.tsx flow)
MA1Generation.tsx # MA(1) series generator page
Layout.tsx # shared layout/navbar shell
components/
Navbar.tsx
FileUploadArea.tsx, AnalysisControls.tsx, ResultsDisplay.tsx, TimeSeriesChart.tsx
ui/ # shadcn/ui component library
utils/
timeSeriesAnalysis.py # all analysis/estimation logic
AI_engine.py # Groq-based AI feedback
types.ts
api_server.py # Flask API exposing the Python analysis functions
Frontend
npm i
npm run devBackend
pip install -r requirements.txt
python api_server.py # runs on http://localhost:5000AI feedback requires a GROQ_API_KEY in a .env file at the project root.
| Endpoint | Purpose |
|---|---|
POST /api/parse-csv |
Parse uploaded CSV content into values/labels |
POST /api/analyze |
Compute ACF, PACF, and trend coefficient |
POST /api/difference |
First-order difference the series and re-analyze it |
POST /api/generate-ma |
Generate a synthetic MA(1) series |
POST /api/estimate-ma-parameters |
Estimate MA(q) parameters (MME and MSE methods) |
POST /api/ai-feedback |
Get AI-generated Persian commentary on ACF/trend results |
GET /api/health |
Health check |
- ehssanhdp — Project scaffolding: React/Vite/TypeScript frontend setup, shadcn/ui component library, Flask API server, core analysis functions (ACF, trend coefficient), AI feedback engine (
AI_engine.py), repo maintenance. - Parsa Sarfarazi — MA(1) series generation feature, first-order differencing, multi-page routing/layout, styling overhaul.
- reyhane-yh — MA(q) parameter estimation (Method of Moments and MSE/CSS minimization) and its API endpoint.
- narimanvt — Partial autocorrelation (PACF) computation and its chart visualization, including significance/confidence-bound reference lines.