<?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: high values of MLE in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/high-values-of-MLE/m-p/972112#M6527</link>
    <description>Do you need any further help? If not, you can close this thread.</description>
    <pubDate>Tue, 05 Aug 2025 13:28:14 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2025-08-05T13:28:14Z</dc:date>
    <item>
      <title>high values of MLE</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/high-values-of-MLE/m-p/971644#M6524</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/183"&gt;@Rick&lt;/a&gt;_SAS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I am working on a very simple problem that I have addressed several times before, and I always receive good estimates. For some reason, this time I am failing miserably; the maximum likelihood estimates (MLE) are so HUGE. I’m not sure where I went wrong. I need help, please.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;Proc iml;
seed=0;   	theta= 1.5 ; 	beta= 1;   		 m=50;     			      
print theta beta m ;&lt;BR /&gt;
**** MLE ***;
 start MLE_func(y) global (m,X);
	 func=0;
	 theta=y[1];
	 beta=y[2];		 
	 Log_X=log(1+x#beta);
	 func=func + m*log(theta*beta) - (theta+1) * Log_X[+] ;
         Return(func);
 finish;&lt;BR /&gt;
call randseed(seed);                         
call randgen(U, "Uniform"); 
Call sort(U);
X =(  (1-U)##(-1/theta) - 1  )/ beta;

************* Constrain MLE ***********************;
con={.001 .001, . .  };
x0={1,1};
opt={2 0};
tc={10000 16000};
Call  nlpqn(rc, MLE_ret, "MLE_func", x0, opt, con,tc);

Theta_hat = MLE_ret[1];
Beta_hat  = MLE_ret[2];
print Theta_hat  Beta_hat;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 19:06:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/high-values-of-MLE/m-p/971644#M6524</guid>
      <dc:creator>Salah</dc:creator>
      <dc:date>2025-07-29T19:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: high values of MLE</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/high-values-of-MLE/m-p/971654#M6525</link>
      <description>&lt;P&gt;When posting an example, please use a seed value that is nonzero so that we can reproduce your results. In the following, I use&lt;BR /&gt;seed=10;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can't perform a MLE on a single datum. You need a sample size greater than 1.&amp;nbsp; I suspect you know this and just forgot to allocate an array for U.&amp;nbsp; This should address your immediate problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc iml;
seed=10;   	theta= 1.5 ; 	beta= 1;   		 m=50;     			      
print theta beta m ;

**** MLE ***;
start MLE_func(y) global (m,X);
 theta=y[1];
 beta=y[2];
 Log_X=log(1+x#beta);
 func = m*log(theta*beta) - (theta+1) * Log_X[+] ;
 Return(func);
finish;

call randseed(seed);    
N = 100;
U = j(N, 1); 
call randgen(U, "Uniform"); 
Call sort(U);
X =(  (1-U)##(-1/theta) - 1  )/ beta;

************* Constrain MLE ***********************;
x0={1,1};
con={.001 .001, . .  };
opt={2 0};
tc={10000 16000};
Call  nlpqn(rc, MLE_ret, "MLE_func", x0, opt, con,tc);

Theta_hat = MLE_ret[1];
Beta_hat  = MLE_ret[2];
print Theta_hat  Beta_hat;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 19:05:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/high-values-of-MLE/m-p/971654#M6525</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2025-07-29T19:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: high values of MLE</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/high-values-of-MLE/m-p/971690#M6526</link>
      <description>&lt;P&gt;Thank you so much!!!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2025 12:39:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/high-values-of-MLE/m-p/971690#M6526</guid>
      <dc:creator>Salah</dc:creator>
      <dc:date>2025-07-30T12:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: high values of MLE</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/high-values-of-MLE/m-p/972112#M6527</link>
      <description>Do you need any further help? If not, you can close this thread.</description>
      <pubDate>Tue, 05 Aug 2025 13:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/high-values-of-MLE/m-p/972112#M6527</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2025-08-05T13:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: high values of MLE</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/high-values-of-MLE/m-p/972115#M6528</link>
      <description>&lt;P&gt;I am sorry, I thought that I closed it by just hitting the thumb up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Aug 2025 13:33:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/high-values-of-MLE/m-p/972115#M6528</guid>
      <dc:creator>Salah</dc:creator>
      <dc:date>2025-08-05T13:33:53Z</dc:date>
    </item>
  </channel>
</rss>

