<?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 Different LogLikelihood with IML and NLMIXED, please help in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Different-LogLikelihood-with-IML-and-NLMIXED-please-help/m-p/176462#M1746</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I used Proc NLMIXED for a non linear model, and wanted to talk about how it 'finds' the parameter estimates with maximum likelihood.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So I thought I'd look at a simple example: finding the mean and variance of a normally distributed variable "r".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used Proc NLMIXED and found the variable is N(-0.6458, 0.4080^2), as I expected. The "NegLogLike" appears to be 62.6976.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then used Proc IML to find the same information, with the desire to make a plot of "what's happening" as in &lt;A href="http://blogs.sas.com/content/iml/2011/10/12/maximum-likelihood-estimation-in-sasiml/" title="http://blogs.sas.com/content/iml/2011/10/12/maximum-likelihood-estimation-in-sasiml/"&gt;http://blogs.sas.com/content/iml/2011/10/12/maximum-likelihood-estimation-in-sasiml/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did all this successfully (or so I thought) and made a pretty plot, then compared the output and realised I found my variable&amp;nbsp; r ~ N(-0.6458, 0.4080^2) as desired, but "Value of Objective Function = 47.575023947" which I expected to be 62.6... as above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used the same optimisation technique each time - Dual Quasi-Newton - so I don't see what I'm doing wrong or where the differences can be attributed to?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone please help me? (That's you Ricky &amp;lt;333 hahah)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Katie xx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Apr 2014 21:31:46 GMT</pubDate>
    <dc:creator>katiexyz</dc:creator>
    <dc:date>2014-04-10T21:31:46Z</dc:date>
    <item>
      <title>Different LogLikelihood with IML and NLMIXED, please help</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Different-LogLikelihood-with-IML-and-NLMIXED-please-help/m-p/176462#M1746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I used Proc NLMIXED for a non linear model, and wanted to talk about how it 'finds' the parameter estimates with maximum likelihood.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So I thought I'd look at a simple example: finding the mean and variance of a normally distributed variable "r".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used Proc NLMIXED and found the variable is N(-0.6458, 0.4080^2), as I expected. The "NegLogLike" appears to be 62.6976.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then used Proc IML to find the same information, with the desire to make a plot of "what's happening" as in &lt;A href="http://blogs.sas.com/content/iml/2011/10/12/maximum-likelihood-estimation-in-sasiml/" title="http://blogs.sas.com/content/iml/2011/10/12/maximum-likelihood-estimation-in-sasiml/"&gt;http://blogs.sas.com/content/iml/2011/10/12/maximum-likelihood-estimation-in-sasiml/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did all this successfully (or so I thought) and made a pretty plot, then compared the output and realised I found my variable&amp;nbsp; r ~ N(-0.6458, 0.4080^2) as desired, but "Value of Objective Function = 47.575023947" which I expected to be 62.6... as above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used the same optimisation technique each time - Dual Quasi-Newton - so I don't see what I'm doing wrong or where the differences can be attributed to?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone please help me? (That's you Ricky &amp;lt;333 hahah)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Katie xx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Apr 2014 21:31:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Different-LogLikelihood-with-IML-and-NLMIXED-please-help/m-p/176462#M1746</guid>
      <dc:creator>katiexyz</dc:creator>
      <dc:date>2014-04-10T21:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Different LogLikelihood with IML and NLMIXED, please help</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Different-LogLikelihood-with-IML-and-NLMIXED-please-help/m-p/176463#M1747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the main problem is that you have missed out the factor of 2 pi in the log-likelihood function.&amp;nbsp; If I substitute:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; f = - n # log(2 # constant('pi') # sigma2) /2 - ssq(c) / (2 # sigma2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the LogLik module then I get an iteration history from NLPQN that very closely matches the NLMIXED output.&amp;nbsp; There are other issues, the code you posted generates errors in the log, but these are related to some lines of code following the 'close' statement that can be deleted from the program.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 07:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Different-LogLikelihood-with-IML-and-NLMIXED-please-help/m-p/176463#M1747</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2014-04-11T07:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Different LogLikelihood with IML and NLMIXED, please help</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Different-LogLikelihood-with-IML-and-NLMIXED-please-help/m-p/176464#M1748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Amazing, thanks, I didn't notice that! I will have a look after my breakfast &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&amp;nbsp; thanks so much&amp;nbsp; x&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update- just ran it- perfect! Really grateful, thank you &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update again.... results were slighly different... added&amp;nbsp; update=DBFGS ; to my NLMIXED statement and it's now identical. Two days wasted on this! So glad to see matching numbers!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 08:42:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Different-LogLikelihood-with-IML-and-NLMIXED-please-help/m-p/176464#M1748</guid>
      <dc:creator>katiexyz</dc:creator>
      <dc:date>2014-04-11T08:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Different LogLikelihood with IML and NLMIXED, please help</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Different-LogLikelihood-with-IML-and-NLMIXED-please-help/m-p/176465#M1749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a common problem. Different software programs sometimes uses different forms of the ML function (usually some variation of the log-likelihood) to optimize. You can drop constants and multiplicative factors without changing the solution. For example, if LL is the log-likelihood function, then -2*LL,&amp;nbsp; -LL, and -2*LL+const&amp;nbsp; all give the same solutions, but report different values for the "Value of the objective function."&lt;/P&gt;&lt;P&gt;For that matter, we use the log-likelihood because it gives the same solution as optimizing the liklihood function, but is more stable numerically.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 13:15:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Different-LogLikelihood-with-IML-and-NLMIXED-please-help/m-p/176465#M1749</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-04-11T13:15:14Z</dc:date>
    </item>
  </channel>
</rss>

