<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Low Default Portfolio - Pluto &amp;amp; Tasche in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Low-Default-Portfolio-Pluto-amp-Tasche/m-p/950082#M6327</link>
    <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am pleased to inform you that I have developed two distinct SAS macros designed to explain the Low Default Portfolio modeling approach suggested by Pluto &amp;amp; Tasche (&lt;STRONG&gt;&lt;A href="https://arxiv.org/pdf/cond-mat/0411699v3" target="_blank"&gt;https://arxiv.org/pdf/cond-mat/0411699v3&lt;/A&gt;)&lt;/STRONG&gt;. These macros account for both correlated and independent default events. I believe these tools will be highly valuable for the SAS community, particularly in the area of Credit Risk Modeling for Low Default or Zero Default portfolios.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Raphael Chaves&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2024 21:33:02 GMT</pubDate>
    <dc:creator>raphaelchaves</dc:creator>
    <dc:date>2024-11-06T21:33:02Z</dc:date>
    <item>
      <title>Low Default Portfolio - Pluto &amp; Tasche</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Low-Default-Portfolio-Pluto-amp-Tasche/m-p/923305#M6191</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I have used the following R function in order to estimate the upper bound PD given the number of obligors and defaults, considering the Pluto &amp;amp; Tasche approach. I'd be so grateful if you tell me how can I achieve the same results, however, just using PROC IML and SAS native functions, instead of having the R running in the background?&lt;BR /&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Rgs,&lt;/P&gt;&lt;P&gt;Raphael&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc iml;&lt;/P&gt;&lt;P&gt;submit / R;&lt;/P&gt;&lt;P&gt;# Estimates the Upper Pound PD given the number of obligors and defaults&lt;BR /&gt;plutotashe &amp;lt;- function(n, i, theta, rho, T, Conf, N) {&lt;BR /&gt;&lt;BR /&gt;hh = uniroot(error, interval=c(0,1), lower=0.000000001, upper=0.999999999, tol = 1e-8, maxiter=500,&lt;BR /&gt;n=n, i=i, theta=theta, rho=rho, T=T, Conf=Conf, N=N)&lt;BR /&gt;names(hh) = c("UpperBoundPD", "Function", "iter", "estim.prec")&lt;BR /&gt;return(hh)&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;# Error Function&lt;BR /&gt;error &amp;lt;- function(pd, n, i, theta, rho, T, Conf, N) {&lt;/P&gt;&lt;P&gt;AverageSim = 1-mean(replicate(N, sim(pd,n,i,theta,rho, T)))&lt;BR /&gt;error = AverageSim-Conf&lt;BR /&gt;return(error)&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;# Simulation Run&lt;BR /&gt;sim = function(pd, n, i, theta, rho, T) {&lt;/P&gt;&lt;P&gt;# Generate a state of the economy&lt;BR /&gt;Z=array(0,c(T,1))&lt;BR /&gt;Z[1] = rnorm(1)&lt;BR /&gt;if (T &amp;gt; 1) {&lt;BR /&gt;for (j in 2:T) {&lt;BR /&gt;Z[j] = theta*Z[j-1]+sqrt(1-theta^2)*rnorm(1)&lt;BR /&gt;}&lt;BR /&gt;rm(j)&lt;BR /&gt;}&lt;BR /&gt;p = 1-prod(1 - pnorm((qnorm(pd)-Z*sqrt(rho))/sqrt(1-rho))) # Prob of Defaulting&lt;BR /&gt;(tt=binom_cum(n,p,i))&lt;BR /&gt;return(tt)&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;# Cumulative Binomial&lt;BR /&gt;binom_cum = function (n,p,i) {&lt;BR /&gt;bc = 0&lt;BR /&gt;for (j in 0:i) {&lt;BR /&gt;bc = bc + choose(n,j)*(p^j)*((1-p)^(n-j))&lt;BR /&gt;}&lt;BR /&gt;return(bc)&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;n &amp;lt;- 800 #number of obligors&lt;BR /&gt;i &amp;lt;- 0 #number of defaults&lt;BR /&gt;theta &amp;lt;- 0.30 #year-to-year correlation&lt;BR /&gt;rho &amp;lt;- 0.12 #asset correlation&lt;BR /&gt;T &amp;lt;- 5 #number of years&lt;BR /&gt;Conf &amp;lt;- 0.99 #confidence level&lt;BR /&gt;N &amp;lt;- 1000 #number of simulations&lt;/P&gt;&lt;P&gt;plutotashe(n, i, theta,rho,T,Conf, N)&lt;/P&gt;&lt;P&gt;endsubmit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2024 22:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Low-Default-Portfolio-Pluto-amp-Tasche/m-p/923305#M6191</guid>
      <dc:creator>raphaelchaves</dc:creator>
      <dc:date>2024-04-06T22:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Low Default Portfolio - Pluto &amp; Tasche</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Low-Default-Portfolio-Pluto-amp-Tasche/m-p/923343#M6192</link>
      <description>&lt;UL class="lia-list-style-type-square"&gt;
&lt;LI&gt;SAS Global Forum 2015 -- Paper 1400-2015&lt;BR /&gt;Validation and monitoring of PD models for low default portfolios using PROC MCMC&lt;BR /&gt;Machiel Kruger&lt;BR /&gt;Centre for Business Mathematics and Informatics&lt;BR /&gt;North-West University, South Africa&lt;BR /&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings15/1400-2015.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings15/1400-2015.pdf&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;ARTICLE&lt;BR /&gt;LOW DEFAULT PORTFOLIOS: MODELLING AND CALIBRATION APPROACHES&lt;BR /&gt;dd. 21 MAR 2023&lt;BR /&gt;&lt;A href="https://www.finalyse.com/blog/low-default-portfolios-modelling-and-calibration-approaches" target="_blank"&gt;https://www.finalyse.com/blog/low-default-portfolios-modelling-and-calibration-approaches&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;BOOK :&lt;BR /&gt;Credit Risk Analytics 1st Edition&lt;BR /&gt;Measurement Techniques, Applications, and Examples in SAS&lt;BR /&gt;Bart Baesens; Daniel Roesch; Harald Scheule&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2024 15:52:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Low-Default-Portfolio-Pluto-amp-Tasche/m-p/923343#M6192</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2024-04-07T15:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Low Default Portfolio - Pluto &amp; Tasche</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Low-Default-Portfolio-Pluto-amp-Tasche/m-p/950082#M6327</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am pleased to inform you that I have developed two distinct SAS macros designed to explain the Low Default Portfolio modeling approach suggested by Pluto &amp;amp; Tasche (&lt;STRONG&gt;&lt;A href="https://arxiv.org/pdf/cond-mat/0411699v3" target="_blank"&gt;https://arxiv.org/pdf/cond-mat/0411699v3&lt;/A&gt;)&lt;/STRONG&gt;. These macros account for both correlated and independent default events. I believe these tools will be highly valuable for the SAS community, particularly in the area of Credit Risk Modeling for Low Default or Zero Default portfolios.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Raphael Chaves&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 21:33:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Low-Default-Portfolio-Pluto-amp-Tasche/m-p/950082#M6327</guid>
      <dc:creator>raphaelchaves</dc:creator>
      <dc:date>2024-11-06T21:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Low Default Portfolio - Pluto &amp; Tasche</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Low-Default-Portfolio-Pluto-amp-Tasche/m-p/950104#M6328</link>
      <description>&lt;P&gt;Thanks for posting. Your code is beautifully written and commented. I hope others will find it useful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One small comment. I noticed the following lines in the LPD_CORRELATED_DEFAULT.sas file:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;inverse_cdf = j(1,&amp;amp;SIMULATIONS-1,.);
do i = 1 to ncol(inverse_cdf);
   call symputx("j", i);
   inverse_cdf[i] = quantile('normal',num(symget("j"))/&amp;amp;SIMULATIONS);
end;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This code uses SYMPUTX to create a macro variable "j", then immediately gets the value, converts it to a numeric value, and uses it.&amp;nbsp; A more straightforward method is to use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;   inverse_cdf[i] = quantile('normal',i/&amp;amp;SIMULATIONS);&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;directly in the loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if you want to improve the efficiency of your SAS IML programs, you can try to replace loops with vector operations. For example, you can eliminate the loop altogether and instead use&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;i = 1:(&amp;amp;SIMULATIONS-1);
inverse_cdf = quantile('normal',i/&amp;amp;SIMULATIONS);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Best wishes!&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 10:48:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Low-Default-Portfolio-Pluto-amp-Tasche/m-p/950104#M6328</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2024-11-07T10:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: Low Default Portfolio - Pluto &amp; Tasche</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Low-Default-Portfolio-Pluto-amp-Tasche/m-p/950927#M6353</link>
      <description>Hi Ricky!&lt;BR /&gt;Thanks for providing me these improvements! Do you have any idea if SAS has any type of data lab, where users could submit some potential new features to be incorporated as part of SAS language? From my point of view, this one is a great example of function do be deployed as part of an particular SAS Proc Statement, such as: PROC LDPT&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Raphael Chaves&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Nov 2024 14:24:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Low-Default-Portfolio-Pluto-amp-Tasche/m-p/950927#M6353</guid>
      <dc:creator>raphaelchaves</dc:creator>
      <dc:date>2024-11-15T14:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Low Default Portfolio - Pluto &amp; Tasche</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Low-Default-Portfolio-Pluto-amp-Tasche/m-p/950930#M6354</link>
      <description>&lt;P&gt;Product suggestions can be made at&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Product-Suggestions/idb-p/product-suggestions" target="_blank"&gt;SAS Product Suggestions - SAS Support Communities&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 15:11:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Low-Default-Portfolio-Pluto-amp-Tasche/m-p/950930#M6354</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2024-11-15T15:11:52Z</dc:date>
    </item>
  </channel>
</rss>

