<?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: How can I use simulation to compare Models by their probabilities? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-simulation-to-compare-Models-by-their/m-p/448787#M69625</link>
    <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;I was reading a paper on simulation and the author ...&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you are going to make a reference to the literature, please provide a full reference.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It's probably&amp;nbsp;fruitless to make a guess based on what you've written, but I'll try my best.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Notice that mu does not depend on the x3 variable at all when&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;the linear combination is 1 + x1 + 2*x2 - 0*x3. However, the table that you pasted also doesn't depend on x3, so the table and the formula are consistent.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The linear combinations&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;lambda = 1 + x1 + 2*x2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;is the base-two representation of the digits [1,4]. That expression is equivalent to&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;lambda = rand("Integer", 1, 8); /* SAS 9.4m5 */&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;or&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;lambda = ceil( 8*rand("uniform") );&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That makes the Poisson random variable&amp;nbsp;&lt;/SPAN&gt;Y ~ Pois(exp(lambda)) a linear combination (mixture model) of&amp;nbsp;four Poisson rv's:&lt;/P&gt;
&lt;P&gt;Pois(exp(1)), Pois(exp(2)),..., and Pois(exp(4)). I suspect that you can analytically compute&amp;nbsp;&lt;SPAN&gt;the mean of a linear combination of k Poisson rv's with equal coefficients 1/k.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I would have expected that the mean of a Pois(exp(1))&amp;nbsp;to be 2.718, whereas the table gives 2.67, so clearly I do not understand all that is going on, but maybe these thoughts&amp;nbsp;will trigger some ideas of your own. Good luck.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Mar 2018 19:37:27 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2018-03-26T19:37:27Z</dc:date>
    <item>
      <title>How can I use simulation to compare Models by their probabilities?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-simulation-to-compare-Models-by-their/m-p/448522#M69604</link>
      <description>&lt;P&gt;I was reading a paper on simulation and the author tries to compare the Poisson probabilities and the empirical (observed) probabilities for each particular covariate pattern to verify if the Poisson model fits the data accurately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The model used in the simulations was defined by;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y= 1+ x1 + 2x2 - 0x3&lt;/P&gt;&lt;P&gt;&lt;EM&gt;x1 is &lt;/EM&gt;&amp;nbsp;from a Bernoulli(0.5) distribution, &lt;EM&gt;x2&lt;/EM&gt; is from a Bernoulli(0.5) distribution, and &lt;EM&gt;x3&lt;/EM&gt; is also from a Bernoulli(0.5) distribution. Simulation results are based on 10000 replications.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My questions are;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The means from each covariate pattern from their respective distributions are shown as in the picture shown. How could I adjust my code to obtain such means? I don’t get what these means actually are. And how do I differentiate these two distributions.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ssas.png" style="width: 288px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19435i4EC378EC494AF26D/image-size/large?v=v2&amp;amp;px=999" role="button" title="ssas.png" alt="ssas.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let NumSamples = 10000; 
data s1;
call streaminit(1234);
do SampleID=1 to &amp;amp;NumSamples; 
   x1=rand("Bernolli",0.5);
   x2=rand("Bernolli",0.5);
   x3=rand("Bernolli",0.5);
   mu = exp(1 + x1 + 2*x2 - 0*x3);
   y = rand("poisson", mu);
   output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Each covariate pattern has a different set of probabilities based on the above means. I don’t understand how I would calculate probabilities especially on empirical distribution. i.e for the pattern x1=1, x2=0, x3=0 the probability under Poisson is 0.0007 while that based on empirical distribution is 0.0032&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Mar 2018 19:49:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-simulation-to-compare-Models-by-their/m-p/448522#M69604</guid>
      <dc:creator>john1111</dc:creator>
      <dc:date>2018-03-25T19:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use simulation to compare Models by their probabilities?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-simulation-to-compare-Models-by-their/m-p/448528#M69605</link>
      <description>&lt;P&gt;The point of doing a simulation is usually to compare an observed value&amp;nbsp;with the distribution of simulated values. If your observed value is outside the bulk of simulated values then you can infer that&amp;nbsp;it is not compatible with one or more of your simulated process assumptions.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Mar 2018 22:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-simulation-to-compare-Models-by-their/m-p/448528#M69605</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-03-25T22:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use simulation to compare Models by their probabilities?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-simulation-to-compare-Models-by-their/m-p/448568#M69606</link>
      <description>&lt;P&gt;Calling&amp;nbsp;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684" target="_blank"&gt;@Rick_SAS&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 07:58:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-simulation-to-compare-Models-by-their/m-p/448568#M69606</guid>
      <dc:creator>john1111</dc:creator>
      <dc:date>2018-03-26T07:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use simulation to compare Models by their probabilities?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-simulation-to-compare-Models-by-their/m-p/448787#M69625</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;I was reading a paper on simulation and the author ...&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you are going to make a reference to the literature, please provide a full reference.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It's probably&amp;nbsp;fruitless to make a guess based on what you've written, but I'll try my best.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Notice that mu does not depend on the x3 variable at all when&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;the linear combination is 1 + x1 + 2*x2 - 0*x3. However, the table that you pasted also doesn't depend on x3, so the table and the formula are consistent.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The linear combinations&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;lambda = 1 + x1 + 2*x2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;is the base-two representation of the digits [1,4]. That expression is equivalent to&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;lambda = rand("Integer", 1, 8); /* SAS 9.4m5 */&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;or&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;lambda = ceil( 8*rand("uniform") );&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That makes the Poisson random variable&amp;nbsp;&lt;/SPAN&gt;Y ~ Pois(exp(lambda)) a linear combination (mixture model) of&amp;nbsp;four Poisson rv's:&lt;/P&gt;
&lt;P&gt;Pois(exp(1)), Pois(exp(2)),..., and Pois(exp(4)). I suspect that you can analytically compute&amp;nbsp;&lt;SPAN&gt;the mean of a linear combination of k Poisson rv's with equal coefficients 1/k.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I would have expected that the mean of a Pois(exp(1))&amp;nbsp;to be 2.718, whereas the table gives 2.67, so clearly I do not understand all that is going on, but maybe these thoughts&amp;nbsp;will trigger some ideas of your own. Good luck.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 19:37:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-I-use-simulation-to-compare-Models-by-their/m-p/448787#M69625</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-03-26T19:37:27Z</dc:date>
    </item>
  </channel>
</rss>

