<?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: PERT-sampling of data in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/PERT-sampling-of-data/m-p/245425#M12932</link>
    <description>&lt;P&gt;Xia wrote that, so you'll have to ask him what he was thinking.&amp;nbsp; It looks like he was trying to specify the density for the triangular distribution on [0,1] with peak at &amp;amp;peak. However, the formula he gave is incorrect since it can become negative and doesn't integrate to 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want the density of the triangular distribution, use the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Triangle;
do x = 0 to 1 by 0.01;
   pdf = ifn((x&amp;lt;=&amp;amp;peak), 2*x/&amp;amp;peak, 2*(1-x)/(1-&amp;amp;peak));
   output;
end;
run;

/* visualize distribution: should have peak at &amp;amp;peak */
proc sgplot data=Triangle;
series x=x y=pdf;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 22 Jan 2016 11:50:37 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2016-01-22T11:50:37Z</dc:date>
    <item>
      <title>PERT-sampling of data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PERT-sampling-of-data/m-p/245423#M12931</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this question is admissible as it is not about SAS-syntax, but about the meaning of Rick_SAS's &amp;amp; Ksharp's&amp;nbsp;line of code? The ifn-part, of course, is clear, I am looking for a substantial interpretation or a source of this formula:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;_RATE_= ifn((prob&amp;lt;=&amp;amp;peak),prob,2*&amp;amp;peak-prob)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The complete program was:&lt;/P&gt;
&lt;P&gt;%let peak=0.7;&lt;BR /&gt;title 'Simulation from Normal';&lt;BR /&gt;data normal;&lt;BR /&gt;call streaminit(1234);&lt;BR /&gt;do i=1 to 100000;&lt;BR /&gt;&amp;nbsp;x=rand('normal');&lt;BR /&gt;&amp;nbsp;prob = cdf("Normal", x);&lt;BR /&gt;&amp;nbsp;_RATE_= ifn((prob&amp;lt;=&amp;amp;peak),prob,2*&amp;amp;peak-prob); * &amp;lt;-- distribution function of PERT?? ;&lt;BR /&gt;&amp;nbsp;output;&lt;BR /&gt;end;&lt;BR /&gt;drop prob ;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc surveyselect data=normal&amp;nbsp; out=want method=PPS_WR N=10000;&lt;BR /&gt;size _RATE_;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* specify the probability variable */&lt;BR /&gt;run;&lt;BR /&gt;proc sgplot data=want;&lt;BR /&gt;histogram x;&lt;BR /&gt;density x/type=kernel;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The original post was:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Statistical-Procedures/Change-statistical-moments-parameters-of-a-sample/m-p/243746#U243746" target="_blank"&gt;https://communities.sas.com/t5/SAS-Statistical-Procedures/Change-statistical-moments-parameters-of-a-sample/m-p/243746#U243746&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;amp;kind regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2016 11:35:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PERT-sampling-of-data/m-p/245423#M12931</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2016-01-22T11:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: PERT-sampling of data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PERT-sampling-of-data/m-p/245425#M12932</link>
      <description>&lt;P&gt;Xia wrote that, so you'll have to ask him what he was thinking.&amp;nbsp; It looks like he was trying to specify the density for the triangular distribution on [0,1] with peak at &amp;amp;peak. However, the formula he gave is incorrect since it can become negative and doesn't integrate to 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want the density of the triangular distribution, use the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Triangle;
do x = 0 to 1 by 0.01;
   pdf = ifn((x&amp;lt;=&amp;amp;peak), 2*x/&amp;amp;peak, 2*(1-x)/(1-&amp;amp;peak));
   output;
end;
run;

/* visualize distribution: should have peak at &amp;amp;peak */
proc sgplot data=Triangle;
series x=x y=pdf;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Jan 2016 11:50:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PERT-sampling-of-data/m-p/245425#M12932</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-01-22T11:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: PERT-sampling of data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PERT-sampling-of-data/m-p/245797#M12951</link>
      <description>&lt;P&gt;Yes. My function is not right only suited for peak=0.5 . What I am trying to do is this . And need new function to compute the sample prob of a value from Normal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1600i6458163693207403/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="x.png" title="x.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2016 03:14:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PERT-sampling-of-data/m-p/245797#M12951</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-01-25T03:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: PERT-sampling of data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PERT-sampling-of-data/m-p/245798#M12952</link>
      <description>&lt;P&gt;Rick's formula is right . Try this one .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let peak=0.7;
title 'Simulation from Normal';
data normal;
call streaminit(1234);
do i=1 to 100000;
 x=rand('normal');
 prob = cdf("Normal", x);
 if prob=&amp;amp;peak then _RATE_=2;
  else _RATE_= ifn((prob&amp;lt;&amp;amp;peak), 2*prob/&amp;amp;peak, 2*(1-prob)/(1-&amp;amp;peak)); * &amp;lt;-- special sample prob for a value from normal;
 output;
end;
drop prob ;
run;
proc surveyselect data=normal  out=want method=PPS_WR N=10000;
size _RATE_;    /* specify the probability variable */
run;
proc sgplot data=want;
histogram x;
density x/type=kernel;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edited&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2016 03:35:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PERT-sampling-of-data/m-p/245798#M12952</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-01-25T03:35:17Z</dc:date>
    </item>
  </channel>
</rss>

