  This paper introduces a novel approach for computing netting--set level and
counterparty level exposures, such as Potential Future Exposure (PFE) and
Expected Exposure (EE), along with associated sensitivities. The method is
essentially an extension of the Fourier-cosine series expansion (COS) method,
originally proposed for option pricing. This method can accommodate a broad
range of models where the joint distribution of involved risk factors is
analytically or semi-analytically tractable. This inclusivity encompasses
nearly all CCR models commonly employed in practice. A notable advantage of the
COS method is its sustained efficiency, particularly when handling large
portfolios. A theoretical error analysis is also provided to justify the
method's theoretical stability and accuracy. Various numerical tests are
conducted using real-sized portfolios, and the results underscore its potential
as a significantly more efficient alternative to the Monte Carlo method for
practical usage, particularly applicable to portfolios involving a relatively
modest number of risk factors. Furthermore, the observed error convergence
rates align closely with the theoretical error analysis.
