  We study the impact of contagion in a network of firms facing credit risk. We
describe an intensity based model where the homogeneity assumption is broken by
introducing a random environment that makes it possible to take into account
the idiosyncratic characteristics of the firms. We shall see that our model
goes behind the identification of groups of firms that can be considered
basically exchangeable. Despite this heterogeneity assumption our model has the
advantage of being totally tractable. The aim is to quantify the losses that a
bank may suffer in a large credit portfolio. Relying on a large deviation
principle on the trajectory space of the process, we state a suitable law of
large number and a central limit theorem useful to study large portfolio
losses. Simulation results are provided as well as applications to portfolio
loss distribution analysis.
