% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/class_generics_and_maybes.R,
%   R/class_spflow_model.R
\name{predict_effect}
\alias{predict_effect}
\alias{predict,spflow_model-method}
\alias{predict_effect,spflow_model-method}
\title{Prediction methods for the \code{\link[=spflow_model-class]{spflow_model-class()}}}
\usage{
predict_effect(object, ...)

\S4method{predict}{spflow_model}(
  object,
  new_dat = NULL,
  method = "BPA",
  approx_expectation = TRUE,
  expectation_approx_order = 10,
  return_type = "OD",
  add_new_signal = FALSE
)

\S4method{predict_effect}{spflow_model}(
  object,
  new_dat,
  old_signal = NULL,
  approx_expectation = TRUE,
  expectation_approx_order = 10,
  return_type = "OD",
  y_is_log = FALSE
)
}
\arguments{
\item{object}{A \code{\link[=spflow_model-class]{spflow_model-class()}}}

\item{...}{not used (generic).}

\item{new_dat}{A named list of data.frames that contain the new data.
The names should correspond to spflow_network or spflow_pair
objects contained in the \code{\link[=spflow_network_multi-class]{spflow_network_multi-class()}}.}

\item{method}{A character indicating which method to use for computing the
predictions. Should be one of c("TS", "TC", "BP").}

\item{approx_expectation}{A logical, if \code{TRUE} the expected value of the dependent variable is
approximated by a Taylor series. For spatial models this can lead to
significant performance gains.}

\item{expectation_approx_order}{A numeric, defining the order of the Taylor series approximation.}

\item{return_type}{A character indicating the format of the returned values:
\itemize{
\item "V" leads to an atomic vector
\item "M" leads to a OD matrix where missing data is replaced by zeros
\item "OD" leads to a data.frame with columns being the the values
and the id's of the destinations and the origins
}}

\item{add_new_signal}{A logical, if \code{TRUE} the new signal is added to the as a column to
the results. This only works when the return type is "OD".}

\item{old_signal}{A matrix that can be supplied to specify the reference value for the signal.
If not given the signal contained in the model is used.}

\item{y_is_log}{Logical, if \code{TRUE} the dependent variable is considered to be in logarithms and
the effects calculation is adjusted by the method proposed by Laurent et. al. (2023).}
}
\value{
Predicted values in the format specified by the argument return_type.
}
\description{
The methods \code{predict()} and \code{predict_effect()} compute spatial predictions.
The former will return the predicted values of the dependent variables and
the later computes the change in its levels given the input data changes.
}
\details{
The prediction methods used here have been developed or analyzed by \insertCite{Goulard2017;textual}{spflow}.
\insertCite{Dargel2023;textual}{spflow} describe how they can be adapted to the case of interaction models.
}
\references{
\insertAllCited{}

-Laurent, Thibault, Paula Margaretic, and Christine Thomas‚ÄêAgnan. "Generalizing impact computations for the autoregressive spatial interaction model." Geographical Analysis (2023).
}
