One of the biggest risks arising from financial operations is the risk of counterparty default, commonly known as a “credit risk”. Leaving unmanaged, the credit risk would, with a high probability, result in a crash of a bank. In our paper, we will focus on the credit risk quantification methodology. We will demonstrate that the current regulatory standards for credit risk management are at least not perfect, despite the fact that the regulatory framework for credit risk measurement is more developed than systems for measuring other risks, e.g. market risks or operational risk. Generalizing the well known KMV model, standing behind Basel II, we build a model of a loan portfolio involving a dynamics of the common factor, influencing the bor...