<?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 Using det in nlmixed in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Using-det-in-nlmixed/m-p/401642#M20940</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there is a procedure to calculate the determinant and I want to use it within the nlmixed procedure. To give an example I modified an nlmixed example from the doc. This doesn't make much sense but illustrates my point. The following works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc nlmixed data=theoph;
   parms beta1=-3.22 beta2=0.47 beta3=-2.45
         s2b1 =0.03  cb12 =0    s2b2 =0.4 s2=0.5;
   cl   = exp(beta1 + b1);
   ka   = exp(beta2 + b2);
   ke   = exp(beta3);
   pred = cl*beta1 - ka*ke;
   model conc ~ normal(pred,s2);
   random b1 b2 ~ normal([0,0],[s2b1,cb12,s2b2]) subject=subject;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But when I substitute "cl*beta1 - ka*ke" by a seemingly equivalent call to det I get an error.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc nlmixed data=theoph;
   parms beta1=-3.22 beta2=0.47 beta3=-2.45
         s2b1 =0.03  cb12 =0    s2b2 =0.4 s2=0.5;
   cl   = exp(beta1 + b1);
   ka   = exp(beta2 + b2);
   ke   = exp(beta3);
   array A [2,2];
   A[1,1] = cl;
   A[1,2] = ka;
   A[2,1] = ke;
   A[2,2] = beta1;
   call det(A, pred);
   model conc ~ normal(pred,s2);
   random b1 b2 ~ normal([0,0],[s2b1,cb12,s2b2]) subject=subject;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The error is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Array argument A is ignored for the derivative of the 'DET' function.
ERROR: Random effect b1 not found in the model.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is there a way to overcome this? Of course in my real code I want to calculate a larger determinant and also use other matrix operations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 06 Oct 2017 07:58:41 GMT</pubDate>
    <dc:creator>user_123221</dc:creator>
    <dc:date>2017-10-06T07:58:41Z</dc:date>
    <item>
      <title>Using det in nlmixed</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-det-in-nlmixed/m-p/401642#M20940</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there is a procedure to calculate the determinant and I want to use it within the nlmixed procedure. To give an example I modified an nlmixed example from the doc. This doesn't make much sense but illustrates my point. The following works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc nlmixed data=theoph;
   parms beta1=-3.22 beta2=0.47 beta3=-2.45
         s2b1 =0.03  cb12 =0    s2b2 =0.4 s2=0.5;
   cl   = exp(beta1 + b1);
   ka   = exp(beta2 + b2);
   ke   = exp(beta3);
   pred = cl*beta1 - ka*ke;
   model conc ~ normal(pred,s2);
   random b1 b2 ~ normal([0,0],[s2b1,cb12,s2b2]) subject=subject;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But when I substitute "cl*beta1 - ka*ke" by a seemingly equivalent call to det I get an error.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc nlmixed data=theoph;
   parms beta1=-3.22 beta2=0.47 beta3=-2.45
         s2b1 =0.03  cb12 =0    s2b2 =0.4 s2=0.5;
   cl   = exp(beta1 + b1);
   ka   = exp(beta2 + b2);
   ke   = exp(beta3);
   array A [2,2];
   A[1,1] = cl;
   A[1,2] = ka;
   A[2,1] = ke;
   A[2,2] = beta1;
   call det(A, pred);
   model conc ~ normal(pred,s2);
   random b1 b2 ~ normal([0,0],[s2b1,cb12,s2b2]) subject=subject;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The error is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Array argument A is ignored for the derivative of the 'DET' function.
ERROR: Random effect b1 not found in the model.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is there a way to overcome this? Of course in my real code I want to calculate a larger determinant and also use other matrix operations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 07:58:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-det-in-nlmixed/m-p/401642#M20940</guid>
      <dc:creator>user_123221</dc:creator>
      <dc:date>2017-10-06T07:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using det in nlmixed</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-det-in-nlmixed/m-p/401777#M20947</link>
      <description>&lt;P&gt;I've not used the matrix capabilities of PROC NLMIXED, but I think&amp;nbsp;the problem is that when you assign the elements of A by using A[1,1]=c1, etc.&amp;nbsp;&amp;nbsp;The program needs to know how to take the derivative of&amp;nbsp; DET(A), and to do that it must know the symbols for each element of A.&amp;nbsp;Try the following syntax, which associates the&amp;nbsp;elements of matrix A to symbols in row-major order:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;array A [2,2] cl ka ke beta1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 14:09:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-det-in-nlmixed/m-p/401777#M20947</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-10-06T14:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using det in nlmixed</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-det-in-nlmixed/m-p/402286#M20967</link>
      <description>&lt;P&gt;When I specify the array in the way you suggested the "NOTE" message disappears but I still get&lt;/P&gt;&lt;PRE&gt;ERROR: Random effect b1 not found in the model.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2017 06:56:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-det-in-nlmixed/m-p/402286#M20967</guid>
      <dc:creator>user_123221</dc:creator>
      <dc:date>2017-10-09T06:56:51Z</dc:date>
    </item>
  </channel>
</rss>

