瀏覽代碼

Document the parameters stored during fitting.

Ben Letham 8 年之前
父節點
當前提交
459e0fed6c
共有 3 個文件被更改,包括 26 次插入1 次删除
  1. 9 0
      R/R/prophet.R
  2. 8 1
      R/man/fit.prophet.Rd
  3. 9 0
      python/fbprophet/forecaster.py

+ 9 - 0
R/R/prophet.R

@@ -454,6 +454,15 @@ logistic_growth_init <- function(df) {
 
 #' Fit the prophet model.
 #'
+#' This sets m$params to contain the fitted model parameters. It is a list
+#' with the following elements:
+#'   k (M array): M posterior samples of the initial slope.
+#'   m (M array): The initial intercept.
+#'   delta (MxN matrix): The slope change at each of N changepoints.
+#'   beta (MxK matrix): Coefficients for K seasonality features.
+#'   sigma_obs (M array): Noise level.
+#' Note that M=1 if MAP estimation.
+#'
 #' @param m Prophet object.
 #' @param df Data frame.
 #' @param ... Additional arguments passed to the \code{optimizing} or 

+ 8 - 1
R/man/fit.prophet.Rd

@@ -15,6 +15,13 @@ fit.prophet(m, df, ...)
 \code{sampling} functions in Stan.}
 }
 \description{
-Fit the prophet model.
+This sets m$params to contain the fitted model parameters. It is a list
+with the following elements:
+  k (M array): M posterior samples of the initial slope.
+  m (M array): The initial intercept.
+  delta (MxN matrix): The slope change at each of N changepoints.
+  beta (MxK matrix): Coefficients for K seasonality features.
+  sigma_obs (M array): Noise level.
+Note that M=1 if MAP estimation.
 }
 

+ 9 - 0
python/fbprophet/forecaster.py

@@ -457,6 +457,15 @@ class Prophet(object):
     def fit(self, df, **kwargs):
         """Fit the Prophet model.
 
+        This sets self.params to contain the fitted model parameters. It is a
+        dictionary parameter names as keys and the following items:
+            k (Mx1 array): M posterior samples of the initial slope.
+            m (Mx1 array): The initial intercept.
+            delta (MxN array): The slope change at each of N changepoints.
+            beta (MxK matrix): Coefficients for K seasonality features.
+            sigma_obs (Mx1 array): Noise level.
+        Note that M=1 if MAP estimation.
+
         Parameters
         ----------
         df: pd.DataFrame containing the history. Must have columns ds (date