% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spflow_logdet.R
\name{derive_logdet_calculator}
\alias{derive_logdet_calculator}
\alias{derive_approxldet_cartesian}
\alias{derive_approxldet_cartesian2}
\alias{derive_approxldet_noncartesian}
\alias{derive_approxldet_noncartesian2}
\alias{tracevals2params_cartesian}
\alias{tracevals2params_noncartesian}
\alias{trace_template_noncartesian}
\alias{tracevals2approxldet}
\title{A function to compute the Jacobean term in the spatial econometric interaction model}
\usage{
derive_logdet_calculator(
  OW,
  DW,
  n_o,
  n_d,
  model,
  approx_order,
  is_cartesian,
  M_indicator
)

derive_approxldet_cartesian(OW, DW, n_o, n_d, model, approx_order)

derive_approxldet_cartesian2(OW, DW, n_o, n_d, model) # order = 2

derive_approxldet_noncartesian(Wd, Wo, Ww, approx_order, model)

derive_approxldet_noncartesian2(OW, DW, M_indicator, n_o, n_d, model) # order = 2

tracevals2params_cartesian(OW, DW, n_o, n_d, model, approx_order)

tracevals2params_noncartesian(Wd, Wo, Ww, model, approx_order)

trace_template_noncartesian()

tracevals2approxldet(tracevals)
}
\value{
A function that takes the autoregression parameters as an argument and returns the log-determinant value
}
\description{
These are internal functions called within the estimation procedure
}
\details{
The Jacobean term of the model corresponds to the log-determinant of the
spatial filter matrix, which is costly to compute.
To reduce the computational burden of the MLE or MCMC estimators the package
uses a power-series approximation of this term.
This approximation was first proposed by \insertCite{Martin1992;textual}{spflow},
has been adapted to interaction models by \insertCite{LeSage2008;textual}{spflow} and
\insertCite{Dargel2023;textual}{spflow} extend the approximation to the
non-cartesian and rectangular cases, where the OD-matrix can be sparse and where the
list of origins may be different from the list of destinations.

By using this approximation we can avoid to directly calculate the determinant term.
Moreover, it is possible to factor out the autoregression parameters from
all remaining terms, which means that we do not need to repeat the most
costly computations.
}
\references{
\insertAllCited{}
}
\author{
Lukas Dargel
}
\keyword{internal}
