  We develop an arbitrage-free framework for consistent valuation of derivative
trades with collateralization, counterparty credit gap risk, and funding costs,
following the approach first proposed by Pallavicini and co-authors in 2011.
Based on the risk-neutral pricing principle, we derive a general pricing
equation where Credit, Debit, Liquidity and Funding Valuation Adjustments (CVA,
DVA, LVA and FVA) are introduced by simply modifying the payout cash-flows of
the deal. Funding costs and specific close-out procedures at default break the
bilateral nature of the deal price and render the valuation problem a
non-linear and recursive one. CVA and FVA are in general not really additive
adjustments, and the risk for double counting is concrete. We introduce a new
adjustment, called a Non-linearity Valuation Adjustment (NVA), to address
double-counting. The theoretical risk free rate disappears from our final
equations. The framework can be tailored also to CCP trading under initial and
variation margins, as explained in detail in Brigo and Pallavicini (2014). In
particular, we allow for asymmetric collateral and funding rates, replacement
close-out and re-hypothecation. The valuation equation takes the form of a
backward stochastic differential equation or semi-linear partial differential
equation, and can be cast as a set of iterative equations that can be solved by
least-squares Monte Carlo. We propose such a simulation algorithm in a case
study involving a generalization of the benchmark model of Black and Scholes
for option pricing. Our numerical results confirm that funding risk has a
non-trivial impact on the deal price, and that double counting matters too. We
conclude the article with an analysis of large scale implications of
non-linearity of the pricing equations.
