# Diff of /trunk/doc/inversion/CostFunctions.tex

trunk/doc/inversion/Drivers.tex revision 4137 by gross, Fri Jan 11 06:41:10 2013 UTC trunk/doc/inversion/CostFunctions.tex revision 4138 by gross, Mon Jan 14 23:57:00 2013 UTC
# Line 1  Line 1
1    \chapter{Cost Function}\label{chapter:ref:inversion cost function}
\chapter{Inversion Drivers}\label{chapter:ref:Drivers}

\section{Driver Classes}
The inversion minimizes an appropriate cost function $J$ to find the physical parameter distribution
(or more precisely the level set function) which gives the best fit to measured data. A
particular inversion case (gravity, magnetic or joint) is managed through
an instance of a specialization of the \class{InversionDriver} class. The task of the class instance
is to set up the appropriate cost function, to manage solution parameters and to run the optimization process.

\subsection{Template}
\begin{classdesc*}{InversionDriver}
template for inversion drivers. By default the limited-memory Broyden-Fletcher-Goldfarb-Shanno (\emph{L-BFGS})~\cite{L-BFGS}\index{L-BFGS} solver is used.
\end{classdesc*}

\begin{methoddesc}[InversionDriver]{getCostFunction}{}
returns the cost function of the inversion. This will be an instance of the \class{InversionCostFunction} class, see section~\ref{chapter:ref:inversion cost function}.
Use this method to access or alter attribute or methods of the underlying cost function.
\end{methoddesc}

\begin{methoddesc}[InversionDriver]{getDomain}{}
returns the domain of the inversion as an \escript \class{Domain} object.
\end{methoddesc}

\begin{methoddesc}[InversionDriver]{setSolverMaxIterations}{\optional{maxiter=\None}}
set the maximum number of iteration steps for the solver used to minimize the cost function. The default value is 200.
If the maximum number is reached, the iteration will be terminated and the \exception{MinimizerMaxIterReached} is thrown.
\end{methoddesc}

\begin{methoddesc}[InversionDriver]{setSolverTolerance}{\optional{tol=\None} \optional{, atol=\None}}
set the tolerance for the the solver used to minimize the cost function. If \member{tol} is set the iteration is terminated
if the relative change of the level set function is less or equal \member{tol}.
If \member{atol} is set the iteration is terminated
if the change of the cost function relative to the initial value is less or equal \member{atol}. If both
tolerances are set both stopping criteria need to be meet. By default \member{tol}=1e-4 and \member{atol}=\None.
\end{methoddesc}

\begin{methoddesc}[InversionDriver]{getLevelSetFunction}{}
returns the level set function as solution of the optimization problem. This method can only be called if the
optimization process as been completed. If the iteration failed the last available approximation of the
solution is returned.
\end{methoddesc}

\begin{methoddesc}[InversionDriver]{run}{}
this method run the optimization solver and returns the physical parameter(s)
from the output of the inversion. Notice that the \method{setup} method must be called before the first call
of \method{run}.
The call can fail as the maximum number is reached in which case
an \exception{MinimizerMaxIterReached} exception is thrown or as there is an incurable break down in the
iteration in which case an \exception{MinimizerIterationIncurableBreakDown} exception is thrown.
\end{methoddesc}

\subsection{Gravity Inversion Driver}
For examples of usage please see Chapter~\ref{Chp:cook:gravity inversion}.

\begin{classdesc}{GravityInversion}{}
Driver class to perform an inversion of  Gravity (Bouguer) anomaly data. This class
is a sub-class of the \class{InversionDriver} class. The class uses the standard
\class{Regularization} class for a single level set function, see Chapter~\ref{Chp:ref:regularization},
\class{DensityMapping} mapping, see Section~\ref{Chp:ref:mapping density}, and the
gravity forward model \class{GravityModel}, see Section~\ref{sec:forward gravity}.
\end{classdesc}

\begin{methoddesc}[GravityInversion]{setup}{
domainbuilder
\optional{, rho0=\None}
\optional{, drho=\None}
\optional{, z0=\None}
\optional{, beta=\None}
\optional{, w0=\None}
\optional{, w1=\None}}
sets up the inversion from an instance \member{domainbuilder} of a \class{DomainBuilder}, see Section~\ref{Chp:ref:domain builder}.
Only gravitational data attached to the \member{domainbuilder} are considered in the inversion.
\member{rho0} defines a reference density anomaly (defaults is 0),
\member{drho} defines a density anomaly (defaults is $2750 \frac{kg}{m^3}$),
\member{z0} defines the depth weighting reference depth (defaults is \None), and
\member{beta} defines the depth weighting exponent (defaults is \None),
see \class{DensityMapping} in Section~\ref{Chp:ref:mapping density}.
\member{w0} and \member{w1} define the weighting factors
$\omega^{(0)}$ and
$\omega^{(1)}$, respectively (see equation~\ref{EQU:REG:1}).
As default \member{w0}=\None and \member{w1}=1 are used.
\end{methoddesc}

\begin{methoddesc}[GravityInversion]{setInitialGuess}{\optional{rho=\None}}
set an initial guess for the density anomaly. As default zero is used.
\end{methoddesc}

\subsection{Magnetic Inversion Driver}
For examples of usage please see Chapter~\ref{Chp:cook:magnetic inversion}.

\begin{classdesc}{MagneticInversion}{}
Driver class to perform an inversion of magnetic anomaly data. This class
is a sub-class of the \class{InversionDriver} class. The class uses the standard
\class{Regularization} class for a single level set function, see Chapter~\ref{Chp:ref:regularization},
\class{SusceptibilityMapping} mapping, see Section~\ref{Chp:ref:mapping susceptibility}, and the linear
magnetic forward model \class{MagneticModel}, see Section~\ref{sec:forward magnetic}.
\end{classdesc}

\begin{methoddesc}[MagneticInversion]{setup}{
domainbuilder
\optional{, k0=\None}
\optional{, dk=\None}
\optional{, z0=\None}
\optional{, beta=\None}
\optional{, w0=\None}
\optional{, w1=\None}}

sets up the inversion from an instance \member{domainbuilder} of a \class{DomainBuilder}, see Section~\ref{Chp:ref:domain builder}.
Only magnetic data attached to the \member{domainbuilder} are considered in the inversion.
\member{k0} defines a reference susceptibility anomaly (defaults is 0),
\member{dk} defines a susceptibility anomaly scale (defaults is $1$),
\member{z0} defines the depth weighting reference depth (defaults is \None), and
\member{beta} defines the depth weighting exponent (defaults is \None),
see \class{SusceptibilityMapping} in Section~\ref{Chp:ref:mapping susceptibility}.
\member{w0} and \member{w1} define the weighting factors
$\omega^{(0)}$ and
$\omega^{(1)}$, respectively (see equation~\ref{EQU:REG:1}).
As default \member{w0}=\None and \member{w1}=1 are used.
\end{methoddesc}

\begin{methoddesc}[MagneticInversion]{setInitialGuess}{\optional{k=\None}}
set an initial guess for the susceptibility anomaly. As default zero is used.
\end{methoddesc}

\subsection{Gravity and Magnetic Joint Inversion Driver}
For examples of usage please see Chapter~\ref{Chp:cook:joint inversion}.

\begin{classdesc}{JointGravityMagneticInversion}{}
Driver class to perform a joint inversion of  Gravity (Bouguer) and magnetic anomaly data. This class
is a sub-class of the \class{InversionDriver} class.
The class uses the standard
\class{Regularization} class for a two level set functions with cross-gradient correlation, see Chapter~\ref{Chp:ref:regularization},
\class{DensityMapping} and \class{SusceptibilityMapping} mappings, see Section~\ref{Chp:ref:mapping}, the
gravity forward model \class{GravityModel}, see Section~\ref{sec:forward gravity}
and the linear
magnetic forward model \class{MagneticModel}, see Section~\ref{sec:forward magnetic}.
\end{classdesc}

\begin{methoddesc}[JointGravityMagneticInversion]{setup}{
domainbuilder
\optional{, rho0=\None}
\optional{, drho=\None}
\optional{, rho_z0=\None}
\optional{, rho_beta=\None}
\optional{, k0=\None}
\optional{, dk=\None}
\optional{, k_z0=\None}
\optional{, k_beta=\None}
\optional{, w0=\None}
\optional{, w1=\None}
\optional{, w_gc=\None}
}
sets up the inversion from an instance \member{domainbuilder} of a \class{DomainBuilder}, see Section~\ref{Chp:ref:domain builder}.
Gravity and magnetic data attached to the \member{domainbuilder} are considered in the inversion.
\member{rho0} defines a reference density anomaly (defaults is 0),
\member{drho} defines a density anomaly (defaults is $2750 \frac{kg}{m^3}$),
\member{rho_z0} defines the depth weighting reference depth for density (defaults is \None), and
\member{rho_beta} defines the depth weighting exponent for density (defaults is \None),
see \class{DensityMapping} in Section~\ref{Chp:ref:mapping density}.
\member{k0} defines a reference susceptibility anomaly (defaults is 0),
\member{dk} defines a susceptibility anomaly scale (defaults is $1$),
\member{k_z0} defines the depth weighting reference depth for susceptibility (defaults is \None), and
\member{k_beta} defines the depth weighting exponent for susceptibility (defaults is \None),
see \class{SusceptibilityMapping} in Section~\ref{Chp:ref:mapping susceptibility}.
\member{w0} and \member{w1} define the weighting factors
$\omega^{(0)}$ and
$\omega^{(1)}$, respectively (see equation~\ref{EQU:REG:1}).
\member{w_gc} sets the weighting factor $\omega^{(c)}$ for the cross gradient term.
As default \member{w0}=\None, \member{w1}=1 and \member{w_gc}=1 are used.
\end{methoddesc}

\begin{methoddesc}[JointGravityMagneticInversion]{setInitialGuess}{\optional{rho=None, } \optional{k=\None}}
set initial guesses for density and susceptibility anomaly. As default zeros are used.
\end{methoddesc}

\section{Cost Function for Inversion}\label{chapter:ref:inversion cost function}
2  The general form of the cost function minimized in the inversion is given in the form (see also Chapter~\ref{Chp:ref:introduction})  The general form of the cost function minimized in the inversion is given in the form (see also Chapter~\ref{Chp:ref:introduction})
3  \label{REF:EQU:DRIVE:10}  \label{REF:EQU:DRIVE:10}
4  J(m) = J^{reg}(m) + \sum_{f} \mu^{data}_{f} \cdot J^{f}(p^f)  J(m) = J^{reg}(m) + \sum_{f} \mu^{data}_{f} \cdot J^{f}(p^f)

Legend:
 Removed from v.4137 changed lines Added in v.4138