% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sigmoidal.R
\name{plot_sigmoidal}
\alias{plot_sigmoidal}
\title{Plot a Fitted Sigmoidal Model.}
\usage{
plot_sigmoidal(
  fit,
  data,
  x_col,
  y_col,
  model_type,
  conf_level = NULL,
  n_points = 100,
  main = NULL,
  xlab = NULL,
  ylab = NULL,
  line_col = "red",
  ci_col = "lightblue",
  pch = 16,
  ...
)
}
\arguments{
\item{fit}{A fitted sigmoidal model object from fit_sigmoidal.}

\item{data}{The original data frame used to fit the model.}

\item{x_col}{The name of the x (time) column in the data.}

\item{y_col}{The name of the y (completion) column in the data.}

\item{model_type}{The type of model (pearl, gompertz, or logistic).}

\item{conf_level}{Optional confidence level for confidence bounds (e.g., 0.95 for 95\%).
If NULL (default), no confidence bounds are plotted.}

\item{n_points}{Number of points to use for the fitted curve (default 100).}

\item{main}{Plot title. If NULL, a default title is generated.}

\item{xlab}{X-axis label. If NULL, uses x_col.}

\item{ylab}{Y-axis label. If NULL, uses y_col.}

\item{line_col}{Color for the fitted curve (default "red").}

\item{ci_col}{Color for the confidence band (default "lightblue").}

\item{pch}{Point character for data points (default 16).}

\item{...}{Additional arguments passed to plot().}
}
\value{
Invisibly returns the predictions data frame.
}
\description{
This function creates a base R plot of a fitted sigmoidal model with the
original data points, fitted curve, and optional confidence bounds.
}
\examples{
# Set up a data frame of time and completion percentage data
data <- data.frame(time = 1:10, completion = c(5, 15, 40, 60, 70, 75, 80, 85, 90, 95))

# Fit a logistic model to the data.
fit <- fit_sigmoidal(data, "time", "completion", "logistic")

# Plot the fitted model
plot_sigmoidal(fit, data, "time", "completion", "logistic")

# Plot with 95\% confidence bounds
plot_sigmoidal(fit, data, "time", "completion", "logistic", conf_level = 0.95)

# Customize the plot
plot_sigmoidal(fit, data, "time", "completion", "logistic",
  conf_level = 0.95,
  main = "Project Completion Forecast",
  xlab = "Time (weeks)",
  ylab = "Completion (\%)",
  line_col = "blue",
  ci_col = "lightgray"
)

}
\references{
Damnjanovic, Ivan, and Kenneth Reinschmidt. Data analytics for engineering and
construction project risk management. No. 172534. Cham, Switzerland: Springer, 2020.
}
