<?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: Quantile Function Error on a Matrix of Probabilities in Proc IML in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Quantile-Function-Error-on-a-Matrix-of-Probabilities-in-Proc-IML/m-p/314966#M3111</link>
    <description>&lt;P&gt;The inverse CDF of 0 is not defined when elements of X are zero. The error is that you are trying to evaluate a function (QUANTILE) for values that are outside the domain of the function, which is (0, 1).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Nov 2016 21:14:15 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2016-11-28T21:14:15Z</dc:date>
    <item>
      <title>Quantile Function Error on a Matrix of Probabilities in Proc IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Quantile-Function-Error-on-a-Matrix-of-Probabilities-in-Proc-IML/m-p/314963#M3110</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*NORMINV of Random Binomial Probability of Default*/
%let N = 10;
%let M= 3;
proc iml;
call randseed(123);
x = j(&amp;amp;N,&amp;amp;M);
q=j(&amp;amp;N,&amp;amp;M);
p = {.100 .200 .500};
p_mat = repeat(p, &amp;amp;N);
stdev_mat=p_mat#(1-p_mat);
N_mat = repeat(&amp;amp;N, &amp;amp;N, &amp;amp;M);
call randgen(x, "Binomial", p_mat, N_mat);
x=x/&amp;amp;N;/*Random probability of default*/
q = quantile("Normal", x); /*Quantile of the probability
 from normal distribution (Distance to default)*/
mean=mean(x);
max=x[&amp;lt;&amp;gt;,];
min=x[&amp;gt;&amp;lt;,];
print p,mean,max,min,x,q;
Quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;I have generated random variables using Binnomial distribution and converted them into a&amp;nbsp;matrix of probabilities of default (x=x/&amp;amp;N). Now I want to calculate distance to default by finding the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;quantile of these probabilities ( matrix q) assuming standard normal distribution. However, I am getting an error on the Quantile function (q) i.e.&amp;nbsp;&lt;STRONG&gt;ERROR: (execution) Invalid argument to function.&amp;nbsp;&lt;/STRONG&gt;Please help and thanks in advance.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 21:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Quantile-Function-Error-on-a-Matrix-of-Probabilities-in-Proc-IML/m-p/314963#M3110</guid>
      <dc:creator>abbaskashif</dc:creator>
      <dc:date>2016-11-28T21:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Quantile Function Error on a Matrix of Probabilities in Proc IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Quantile-Function-Error-on-a-Matrix-of-Probabilities-in-Proc-IML/m-p/314966#M3111</link>
      <description>&lt;P&gt;The inverse CDF of 0 is not defined when elements of X are zero. The error is that you are trying to evaluate a function (QUANTILE) for values that are outside the domain of the function, which is (0, 1).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 21:14:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Quantile-Function-Error-on-a-Matrix-of-Probabilities-in-Proc-IML/m-p/314966#M3111</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-11-28T21:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Quantile Function Error on a Matrix of Probabilities in Proc IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Quantile-Function-Error-on-a-Matrix-of-Probabilities-in-Proc-IML/m-p/315274#M3114</link>
      <description>&lt;P&gt;Ture.&amp;nbsp;&lt;SPAN&gt;I'll have to try to get around this, perhaps by replacing zeros with infinitesimally small probabilities.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 17:23:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Quantile-Function-Error-on-a-Matrix-of-Probabilities-in-Proc-IML/m-p/315274#M3114</guid>
      <dc:creator>abbaskashif</dc:creator>
      <dc:date>2016-11-29T17:23:47Z</dc:date>
    </item>
  </channel>
</rss>

