<?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: NLPNRA log message: Lack of convergence/ Product of Integrals maximization in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183924#M1868</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another update on plotting the likelihood funciton:&lt;/P&gt;&lt;P&gt;When I tried plotting for value of rho given by parms=do(0.01,0.99,0.10), I got these results for prod(which is really a sum log-likelihoods):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;EM&gt; prod&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;COL1 COL2 COL3 COL4 COL5 COL6 COL7 COL8 COL9 COL10&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ROW1 -23512.66 -14097.6 -9725.996 -6646.378 -4298.161 -2525.934 -1314.742 -716.5376 -623.4793 -629.5294&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; But when i tried a finer grid for rho using parms=do(0.01,0.99,0.05), I got the following error message about the lack of convergence again.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Convergence could not be attained over the subinterval&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(0.01 , 0.99 )&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The function might have one of the following:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1) A slowly convergent or a divergent integral.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;2) Strong oscillations.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;3) A small scale in the integrand: in this case&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;you can change the independent variable&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;in the integrand, or,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;provide the optional vector describing roughly&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;the mean and the standard deviation of the&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;integrand&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;4) Points of discontinuities in the interior&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;in this case, you can provide a vector containing&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;the points of discontinuity and try again.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only thing I can conclude is that as rho increases towards 0.99, the likelihood increases (the log-likelihood become less negative). But when the optimizing algorithm tries to call QUAD over certain "problematic" points, there is no convegence. So it may be tha tthe function is actually discontinuous somewhere or the problem is (3) in the LOG message. If it was (3), I would have to do another change of variable: I already changed the independent variable of integration from NormCDF(y) to y. So I would have to search for another change of variable on top of that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 20 Jul 2014 14:46:26 GMT</pubDate>
    <dc:creator>nstdt</dc:creator>
    <dc:date>2014-07-20T14:46:26Z</dc:date>
    <item>
      <title>NLPNRA log message: Lack of convergence/ Product of Integrals maximization</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183917#M1861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had posted earlier about maximizing a product of integrals.&lt;/P&gt;&lt;P&gt;I ran the code and though it runs, the log says that Optimization could not proceed, giving a message along the lines of:&lt;/P&gt;&lt;P&gt;Convergence not obtained on (0 1) due to one of the below reasons:&lt;/P&gt;&lt;P&gt;1. Convergence is slow&lt;/P&gt;&lt;P&gt;2. The integrand has a small scale and the independent variable needs to be changed&lt;/P&gt;&lt;P&gt;3. Oscillating integral values&lt;/P&gt;&lt;P&gt;4. Points of Discontinuities in the integrand&lt;/P&gt;&lt;P&gt;I am trying to&amp;nbsp; maximize a product of integrals over (0,1), where the integrand is a binomial density, with the probability "p" of the binomial depending in&lt;/P&gt;&lt;P&gt;a complicated way on the NormCDF. Actually I am maximizing the sum of the log likelihood in the code below.&lt;/P&gt;&lt;P&gt;I looked at the output and noticed that after about the first 40 iterations, only&amp;nbsp; missing values were bang returned by the calls to QUAD to compute the integrals.&lt;/P&gt;&lt;P&gt;The probabilities being computed in the Binomial are very small(by nature of the data, the probability -i.e the integrand, is small). I need to produce an MLE estimate for the parameter rho in the end.&lt;/P&gt;&lt;P&gt;Would using proc NLP be another approach to solving the problem of getting an MLE for rho? I have only seen optimization done in IML before but would like to know if there are other methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would appreciate any&amp;nbsp; insight about the results above.Thanks for any advice or help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is&amp;nbsp; the code(also in the post Product of integrals and maximization):&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;N = ... ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*** N is a constant array of 130 values of n_t.&amp;nbsp; ***/&lt;BR /&gt;D = ...;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*** D is a constant array of 130 values of d_t. ***/&lt;BR /&gt;ni=0;&lt;BR /&gt;di=0;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;result=0;&lt;BR /&gt;gamma = 0.3 ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*** gamma is a constant. ***/&lt;BR /&gt;val = j(130,1,1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /***column vector initialized to 1's to hold reslt of the integrations using QUAD ***/&lt;BR /&gt;iter = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*** Iteration counter initialized to 0&amp;nbsp;&amp;nbsp; ***/&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;start Func(y)&amp;nbsp; GLOBAL(gamma,rho,ni, di,N,D);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /***Note: if iter = i then ni = N&lt;I&gt;; di=D&lt;I&gt;***/&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; u = &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;quantile("Normal", y)&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v = &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;sqrt(rho)&lt;/SPAN&gt;* u;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p = CDF(&amp;nbsp; "Normal",(gamma - v ) / sqrt(1-rho)&amp;nbsp;&amp;nbsp;&amp;nbsp; );&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; / *** 0 &amp;lt;= p &amp;lt;= 1, since it is a probability from a CDF ***/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f = pdf("Binomial", di, p, ni);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*** p is the probability parameter for a binomial density with ni trials ***/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return( f );&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;finish;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;/* Step 2. */&lt;BR /&gt;/* Define a function that computes the product of the integrals.*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;start Prod_Of_Integral(parms) GLOBAL(rho, val,iter,ni,di,N,D); &lt;BR /&gt;/*the optimization parameter is:&amp;nbsp;&amp;nbsp; rho */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rho = parms[1];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yinterval = 0 || 1;&amp;nbsp; /* evaluate integral on [0, 1] */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = 1 to 130;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*** reset&amp;nbsp; iter&amp;nbsp;&amp;nbsp;&amp;nbsp; ***/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*** reset ni and di ***/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iter = i; ni = N&lt;I&gt;; di = D&lt;I&gt;;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call quad(result, "Func", yinterval); /* evaluate integral on [0, 1] */&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*** update result***/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val&lt;I&gt; =log(result);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/I&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return(sum(val));&lt;BR /&gt;finish;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;* Step 3. */&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;/*Maximize the product of the integrals to obtain MLE for rho using nlpnra */&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;/* Set up linear constraint 0 &amp;lt; rho &amp;lt; 1 */&lt;BR /&gt;con = {0.0001 ,0.9999}&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;/* initial guess for solution for rho */&lt;BR /&gt;rho_0 = {0.5};&lt;BR /&gt;/* find maximum of function */&lt;BR /&gt;opt = {1,2} ;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;call nlpnra(rc, result, "Prod_Of_Integral", rho_0, opt) blc=con ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 19:23:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183917#M1861</guid>
      <dc:creator>nstdt</dc:creator>
      <dc:date>2014-07-17T19:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: NLPNRA log message: Lack of convergence/ Product of Integrals maximization</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183918#M1862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume that d&lt;I&gt; &amp;lt; N&lt;I&gt; for all i, right?&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Why don't you visualize the result. It's a 1-D problem, so just evaluate the objective function (Prod_Of_Integral) for a sequence of evenly spaced values of rho, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parms = do(0.01, 0.99, 0.01);&amp;nbsp;&amp;nbsp; /* values of rho */&lt;/P&gt;&lt;P&gt;prod = parms;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* values of product */&lt;/P&gt;&lt;P&gt;do i = 1 to ncol(parms);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; prod&lt;I&gt; = Prod_Of_Integral(parms&lt;I&gt;);&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;call Series(parms, prod);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* SAS/IML 12.3 */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't have your values of N and D, but I made up some reasonable values and got a nice curve with a maximum, which is attached.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SGPlot1.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/6838_SGPlot1.png" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 19:50:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183918#M1862</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-07-17T19:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: NLPNRA log message: Lack of convergence/ Product of Integrals maximization</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183919#M1863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestion. I will look up the Series function and try plotting.(I'm assuming Series helps create plots).&lt;/P&gt;&lt;P&gt;In the IML output that I obtained earlier from my code(which works okay on smaller data of length 3), it seemed that after about i=44, QUAD was returning empty arrays- so the integrals were not being evaluated. Is this because of some numerical underflow?&lt;/P&gt;&lt;P&gt;But I do think that that the integrand is continuous, and don't think it oscillates. D's are much smaller than N's. A lot of the time I think D's are zero. I'll check again..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for the advice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 20:12:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183919#M1863</guid>
      <dc:creator>nstdt</dc:creator>
      <dc:date>2014-07-17T20:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: NLPNRA log message: Lack of convergence/ Product of Integrals maximization</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183920#M1864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When D is large and N is small, I suspect that the objective function does not reach a maximum on the interior of (0,1), but the maximum is at rho=1.&amp;nbsp; Your objective function is undefined for rho=1, which is probably the source of your convergence problem. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 14:21:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183920#M1864</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-07-18T14:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: NLPNRA log message: Lack of convergence/ Product of Integrals maximization</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183921#M1865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hmm... another update- I was just running the code to plot the function, but it doesn't run: specifically, it says that :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ERROR: (execution) Invalid argument to function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;operation : QUANTILE at line 1001 column 21&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it means the quantile doesn;t compute...is there anyr eason why this could be happening?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 14:34:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183921#M1865</guid>
      <dc:creator>nstdt</dc:creator>
      <dc:date>2014-07-18T14:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: NLPNRA log message: Lack of convergence/ Product of Integrals maximization</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183922#M1866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The quantile function is defined on the OPEN interval (0,1).&amp;nbsp; Your error is probably from trying to evaluate&lt;/P&gt;&lt;P&gt;an expression like&lt;/P&gt;&lt;P&gt;quantile("Normal",0);&amp;nbsp;&amp;nbsp; /* undefined b/c "negative infinity" */&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;quantile("Normal",1);&amp;nbsp;&amp;nbsp; /* undefined b/c "positive infinity" */&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 15:53:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183922#M1866</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-07-18T15:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: NLPNRA log message: Lack of convergence/ Product of Integrals maximization</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183923#M1867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your suggestion above. I modified the input to the quantile function by restricting it away from the endpoints 0 and 1. (Also now the integral of the binomial density itself only goes from 0.01 to 0.99 unlike (0,1) before.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering now if I can reformulate the entire&amp;nbsp; model as a Random effects model. Specifically, since the likelihood function is being integrated over all possible values of "y", I am wondering if&amp;nbsp; "y"&amp;nbsp; can be considered as a random effect. In the existing model,&lt;/P&gt;&lt;P&gt;the reason for integration in the likelihood function is that the binomial probability is a CONDITIONAL probability, conditional on values taken by y. (Also y really is unbounded- -infty to +infty, but through a change of variable using y = Normcdf(x), I restricted the integral to being over (0,1). Otherwise, the variable of integration would be x = normcdf, and dx = d(normcdf), which is difficult to write an integration formula for. ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway I tried using Proc NLmixed, with the code below, but got this error:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;NOTE: A finite difference approximation is used for the derivative of the 'PDF' function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: Quadrature accuracy of 0.000100 could not be achieved with 31 points. The achieved&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;accuracy was 0.503703.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the nlmixed code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc nlmixed data=bin1 gconv=1e-10 maxiter=200000;&lt;/P&gt;&lt;P&gt;parms rho=0.5; bounds rho &amp;gt;= 0.01, rho &amp;lt;= 0.99;&lt;/P&gt;&lt;P&gt;/** gamma= 0.3 =const **/&lt;/P&gt;&lt;P&gt;/** Id is the observation number **/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w= (gamma - sqrt(rho)*w) / (1-sqrt(rho) );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p = cdf("Normal",w);&lt;/P&gt;&lt;P&gt;/** Likelihood function **/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;L= pdf("Binomial",D,p, N);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;model d ~ general(L);&lt;/P&gt;&lt;P&gt;random y ~ Normal(0,1) subject=id;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for your all your guidance and help so far!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Jul 2014 14:21:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183923#M1867</guid>
      <dc:creator>nstdt</dc:creator>
      <dc:date>2014-07-20T14:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: NLPNRA log message: Lack of convergence/ Product of Integrals maximization</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183924#M1868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another update on plotting the likelihood funciton:&lt;/P&gt;&lt;P&gt;When I tried plotting for value of rho given by parms=do(0.01,0.99,0.10), I got these results for prod(which is really a sum log-likelihoods):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;EM&gt; prod&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;COL1 COL2 COL3 COL4 COL5 COL6 COL7 COL8 COL9 COL10&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ROW1 -23512.66 -14097.6 -9725.996 -6646.378 -4298.161 -2525.934 -1314.742 -716.5376 -623.4793 -629.5294&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; But when i tried a finer grid for rho using parms=do(0.01,0.99,0.05), I got the following error message about the lack of convergence again.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Convergence could not be attained over the subinterval&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(0.01 , 0.99 )&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The function might have one of the following:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1) A slowly convergent or a divergent integral.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;2) Strong oscillations.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;3) A small scale in the integrand: in this case&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;you can change the independent variable&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;in the integrand, or,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;provide the optional vector describing roughly&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;the mean and the standard deviation of the&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;integrand&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;4) Points of discontinuities in the interior&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;in this case, you can provide a vector containing&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;the points of discontinuity and try again.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only thing I can conclude is that as rho increases towards 0.99, the likelihood increases (the log-likelihood become less negative). But when the optimizing algorithm tries to call QUAD over certain "problematic" points, there is no convegence. So it may be tha tthe function is actually discontinuous somewhere or the problem is (3) in the LOG message. If it was (3), I would have to do another change of variable: I already changed the independent variable of integration from NormCDF(y) to y. So I would have to search for another change of variable on top of that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Jul 2014 14:46:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183924#M1868</guid>
      <dc:creator>nstdt</dc:creator>
      <dc:date>2014-07-20T14:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: NLPNRA log message: Lack of convergence/ Product of Integrals maximization</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183925#M1869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a blog post that might be useful for these kinds of problems: &lt;A href="http://blogs.sas.com/content/iml/2014/08/06/objective-function-that-evaluates-integral/" title="http://blogs.sas.com/content/iml/2014/08/06/objective-function-that-evaluates-integral/"&gt; Define an objective function that evaluates an integral in SAS - The DO Loop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 11:02:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/NLPNRA-log-message-Lack-of-convergence-Product-of-Integrals/m-p/183925#M1869</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-08-08T11:02:01Z</dc:date>
    </item>
  </channel>
</rss>

