Skip to content
Back to skills

Prophet

ASecurity

R prophet package for time series forecasting. Use for forecasting with seasonality, holidays, and trend changes.

  • 5 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added June 4, 2026
dataperformance

Security analysis

A100/100

Scanned June 4, 2026

npx -y skills add LeoLin990405/r-analytics-skill --skill prophet --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Prophet?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Prophet
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/leolin990405-prophet/badge)](https://www.skillsdirectory.com/skills/leolin990405-prophet)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: prophet
description: R prophet package for time series forecasting. Use for forecasting with seasonality, holidays, and trend changes.
---

# prophet

Facebook's forecasting tool.

## Basic Usage

```r
library(prophet)

# Prepare data (must have 'ds' and 'y' columns)
df <- data.frame(
  ds = dates,
  y = values
)

# Fit model
model <- prophet(df)

# Create future dataframe
future <- make_future_dataframe(model, periods = 365)

# Predict
forecast <- predict(model, future)

# Plot
plot(model, forecast)
dyplot.prophet(model, forecast)  # Interactive
```

## Seasonality

```r
# Default: yearly, weekly, daily (if sub-daily data)
model <- prophet(df)

# Disable seasonality
model <- prophet(df, yearly.seasonality = FALSE)
model <- prophet(df, weekly.seasonality = FALSE)
model <- prophet(df, daily.seasonality = FALSE)

# Custom seasonality
model <- prophet(df, yearly.seasonality = FALSE)
model <- add_seasonality(
  model,
  name = "monthly",
  period = 30.5,
  fourier.order = 5
)
model <- fit.prophet(model, df)

# Multiplicative seasonality
model <- prophet(df, seasonality.mode = "multiplicative")
```

## Holidays

```r
# Define holidays
holidays <- data.frame(
  holiday = c("christmas", "christmas", "newyear", "newyear"),
  ds = as.Date(c("2023-12-25", "2024-12-25", "2024-01-01", "2025-01-01")),
  lower_window = 0,
  upper_window = 1
)

model <- prophet(df, holidays = holidays)

# Country holidays
model <- prophet(df)
model <- add_country_holidays(model, country_name = "US")
model <- fit.prophet(model, df)
```

## Trend

```r
# Linear trend (default)
model <- prophet(df, growth = "linear")

# Logistic growth (with cap)
df$cap <- 100
df$floor <- 0
model <- prophet(df, growth = "logistic")

# Flat trend
model <- prophet(df, growth = "flat")

# Changepoints
model <- prophet(df, changepoints = c("2023-01-01", "2023-06-01"))
model <- prophet(df, n.changepoints = 25)
model <- prophet(df, changepoint.range = 0.8)
model <- prophet(df, changepoint.prior.scale = 0.05)
```

## Regressors

```r
# Add regressor
df$regressor <- regressor_values

model <- prophet(df)
model <- add_regressor(model, "regressor")
model <- fit.prophet(model, df)

# Future must include regressor
future <- make_future_dataframe(model, periods = 365)
future$regressor <- future_regressor_values
forecast <- predict(model, future)
```

## Uncertainty

```r
# Uncertainty intervals
model <- prophet(df, interval.width = 0.95)

# MCMC sampling
model <- prophet(df, mcmc.samples = 300)
```

## Cross-Validation

```r
# Cross-validation
cv <- cross_validation(
  model,
  initial = 730,      # Initial training period (days)
  period = 180,       # Spacing between cutoffs
  horizon = 365       # Forecast horizon
)

# Performance metrics
metrics <- performance_metrics(cv)
head(metrics)

# Plot
plot_cross_validation_metric(cv, metric = "mape")
```

## Components

```r
# Plot components
prophet_plot_components(model, forecast)

# Extract components
forecast$trend
forecast$yearly
forecast$weekly
forecast$holidays
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.