mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-09-16 22:20:23 +00:00
Whitespace and documentation fixes
This commit is contained in:
parent
19e95311c2
commit
373f543894
5 changed files with 45 additions and 27 deletions
|
|
@ -1,9 +1,9 @@
|
|||
# Generated by roxygen2: do not edit by hand
|
||||
|
||||
S3method(plot,prophet)
|
||||
S3method(predict,prophet)
|
||||
export(fit.prophet)
|
||||
export(make_future_dataframe)
|
||||
export(plot.prophet)
|
||||
export(predictive_samples)
|
||||
export(prophet)
|
||||
export(prophet_plot_components)
|
||||
|
|
|
|||
|
|
@ -800,6 +800,22 @@ sample_posterior_predictive <- function(m, df) {
|
|||
return(sim.values)
|
||||
}
|
||||
|
||||
#' Sample from the posterior predictive distribution.
|
||||
#'
|
||||
#' @param m Prophet object.
|
||||
#' @param df Dataframe with dates for predictions (column ds), and capacity
|
||||
#' (column cap) if logistic growth.
|
||||
#'
|
||||
#' @return A list with items "trend", "seasonal", and "yhat" containing
|
||||
#' posterior predictive samples for that component.
|
||||
#'
|
||||
#' @export
|
||||
predictive_samples <- function(m, df) {
|
||||
df <- setup_dataframe(m, df)$df
|
||||
sim.values <- sample_posterior_predictive(m, df)
|
||||
return(sim.values)
|
||||
}
|
||||
|
||||
#' Prophet uncertainty intervals.
|
||||
#'
|
||||
#' @param m Prophet object.
|
||||
|
|
@ -827,7 +843,6 @@ predict_uncertainty <- function(m, df) {
|
|||
return(intervals)
|
||||
}
|
||||
|
||||
|
||||
#' Simulate observations from the extrapolated generative model.
|
||||
#'
|
||||
#' @param m Prophet object.
|
||||
|
|
@ -1175,20 +1190,4 @@ plot_yearly <- function(m, uncertainty = TRUE, yearly_start = 0) {
|
|||
return(gg.yearly)
|
||||
}
|
||||
|
||||
#' Sample from the posterior predictive distribution.
|
||||
#'
|
||||
#' @param m Prophet object.
|
||||
#' @param df Dataframe with dates for predictions (column ds), and capacity
|
||||
#' (column cap) if logistic growth.
|
||||
#'
|
||||
#' @return A list with items "trend", "seasonal", and "yhat" containing
|
||||
#' posterior predictive samples for that component.
|
||||
#'
|
||||
#' @export
|
||||
predictive_samples <- function(m, df) {
|
||||
df <- setup_dataframe(m, df)$df
|
||||
sim.values <- sample_posterior_predictive(m, df)
|
||||
return(sim.values)
|
||||
}
|
||||
|
||||
# fb-block 3
|
||||
|
|
@ -4,8 +4,8 @@
|
|||
\alias{plot.prophet}
|
||||
\title{Plot the prophet forecast.}
|
||||
\usage{
|
||||
plot.prophet(x, fcst, uncertainty = TRUE, plot_cap = TRUE, xlabel = "ds",
|
||||
ylabel = "y", ...)
|
||||
\method{plot}{prophet}(x, fcst, uncertainty = TRUE, plot_cap = TRUE,
|
||||
xlabel = "ds", ylabel = "y", ...)
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{Prophet object.}
|
||||
|
|
|
|||
19
R/man/sample_posterior_predictive.Rd
Normal file
19
R/man/sample_posterior_predictive.Rd
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/prophet.R
|
||||
\name{sample_posterior_predictive}
|
||||
\alias{sample_posterior_predictive}
|
||||
\title{Prophet posterior predictive samples.}
|
||||
\usage{
|
||||
sample_posterior_predictive(m, df)
|
||||
}
|
||||
\arguments{
|
||||
\item{m}{Prophet object.}
|
||||
|
||||
\item{df}{Prediction dataframe.}
|
||||
}
|
||||
\value{
|
||||
List with posterior predictive samples for each component.
|
||||
}
|
||||
\description{
|
||||
Prophet posterior predictive samples.
|
||||
}
|
||||
Loading…
Reference in a new issue