Overview
The Prophet model is optimized for medium to long-term predictions (1 week to 1 month) of cryptocurrency prices. Built by Meta (Facebook), Prophet excels at capturing trends and seasonality patterns. Best for: Weekly and monthly forecasts, trend analysis, seasonal patterns Source:source/models/prophet_model.py
When to Use Prophet
Long-term Trends
Predictions from 1 week to 1 month ahead
Seasonality Detection
Automatically identifies daily and weekly patterns
Confidence Intervals
Built-in uncertainty quantification
Robust to Gaps
Handles missing data gracefully
Model Parameters
TheProphetCryptoPredictor accepts the following initialization parameters:
| Parameter | Default | Range | Description |
|---|---|---|---|
changepoint_prior_scale | 0.5 | 0.001-0.5 | Flexibility for trend changes (higher = more flexible) |
seasonality_prior_scale | 10 | 1-20 | Strength of seasonality component |
interval_width | 0.95 | 0.8-0.99 | Width of confidence intervals |
The default
changepoint_prior_scale=0.5 is higher than Prophet’s default (0.05) to handle cryptocurrency volatility.Prophet Configuration
The model is pre-configured with settings optimized for crypto:Seasonality Modes
-
Multiplicative (default): Seasonality scales with trend magnitude
Better for crypto where volatility increases with price -
Additive: Seasonality is constant regardless of trend
Use for more stable assets
Usage Example
Training Process
Data Requirements
- Minimum: 100 data points
- Recommended: 1000+ hourly data points (6+ weeks) for robust seasonality
- Format: DataFrame with
closecolumn and DatetimeIndex - Frequency: Works with hourly (‘H’) or daily (‘D’) data
Data Preparation
Prophet requires data in a specific format:The
prepare_data() method handles this transformation automatically. You only need standard OHLCV data.Training Steps
-
Data Preparation (line 53-70)
Converts to Prophet’sds/yformat -
Model Fitting (line 88)
Prophet decomposes into trend + seasonality + holidays -
Validation (line 92-103)
Generates in-sample predictions for metrics
Performance Metrics
Thetrain() method returns:
Prediction Horizons
| Horizon | Typical MAPE | Direction Accuracy | Use Case |
|---|---|---|---|
| 1-3 days | 5-8% | 55-60% | Short-term trend |
| 1 week | 8-12% | 50-58% | Weekly analysis |
| 2-4 weeks | 12-20% | 48-55% | Monthly outlook |
Predictions with Uncertainty
Prophet automatically generates confidence intervals:Frequency Options
Thepredict_future() method accepts different frequencies:
Backtesting
Use thebacktest_prophet() utility function:
Backtesting Process
- Split data: all except last
test_periodsfor training - Train Prophet on training data
- Predict
test_periodsinto the future - Compare predictions against actual held-out data
- Calculate test metrics (MAE, RMSE, MAPE, direction accuracy)
Trend Analysis
Prophet decomposes predictions into components:Configuration Examples
Conservative (Stable, smooth predictions)
Aggressive (Reactive to changes)
Long-term Forecasting (1+ month)
Understanding Changepoint Prior Scale
This parameter controls how flexible the trend is:- 0.001-0.01: Very rigid, smooth trend (ignores volatility)
- 0.05: Prophet default (too smooth for crypto)
- 0.1-0.3: Moderate flexibility (good for stable crypto)
- 0.4-0.5: High flexibility (default, handles volatility)
Crypto markets are more volatile than traditional stocks, so we use 0.5 instead of Prophet’s default 0.05.
Performance Optimization
Training Speed
Training Speed
- Prophet uses MCMC sampling (slower than XGBoost)
- Typical training time: 5-30 seconds for 1000 data points
- Use daily frequency for datasets >10,000 points
- Consider downsampling very long histories
Memory Usage
Memory Usage
- Lightweight compared to XGBoost
- Stores trend components and seasonality
- Minimal feature engineering (just ds/y format)
Prediction Speed
Prediction Speed
- Fast once trained (~50-100ms for 168 predictions)
- No iterative process (predicts all periods at once)
- Much faster than XGBoost for long horizons
Advantages Over XGBoost
- Direct multi-step prediction: Predicts entire future in one pass (no error accumulation)
- Uncertainty quantification: Built-in confidence intervals
- Trend decomposition: Separate trend from seasonality
- Missing data handling: Automatically handles gaps
- Interpretability: Clear trend and seasonal components
Limitations
- Short-term Accuracy: Less accurate than XGBoost for <72 hour predictions
- Feature Engineering: Cannot use technical indicators (RSI, MACD, etc.)
- Training Time: Slower to train than XGBoost
- Regime Changes: May lag during sudden market shifts
- Volatility: Assumes relatively stable variance (crypto can be chaotic)
When to Choose Prophet
Use Prophet
- Predictions >1 week ahead
- Need confidence intervals
- Want trend decomposition
- Weekly/monthly planning
- Seasonal pattern analysis
Use XGBoost
- Predictions <72 hours
- Need highest accuracy
- Have technical indicators
- Intraday trading
- Short-term momentum
Next Steps
XGBoost Model
Learn about short-term predictions (1-72 hours)
Hybrid Model
Combine XGBoost + Prophet automatically
Model Comparison
Compare all three models side-by-side
API Reference
Detailed API documentation