<?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 find initial guess for an optimization in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/find-initial-guess-for-an-optimization/m-p/755490#M5545</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am writing a code in order to find an initial value for my optimization. For some reason, SAS keeps on giving me the following error&amp;nbsp;&lt;/P&gt;&lt;P&gt;(&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;ERROR: (execution) Matrices do not conform to the operation.&lt;/FONT&gt;&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;I checked every single step, but can't find the error.&lt;/P&gt;&lt;P&gt;Please help!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jul 2021 22:05:49 GMT</pubDate>
    <dc:creator>Salah</dc:creator>
    <dc:date>2021-07-20T22:05:49Z</dc:date>
    <item>
      <title>find initial guess for an optimization</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/find-initial-guess-for-an-optimization/m-p/755490#M5545</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am writing a code in order to find an initial value for my optimization. For some reason, SAS keeps on giving me the following error&amp;nbsp;&lt;/P&gt;&lt;P&gt;(&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;ERROR: (execution) Matrices do not conform to the operation.&lt;/FONT&gt;&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;I checked every single step, but can't find the error.&lt;/P&gt;&lt;P&gt;Please help!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 22:05:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/find-initial-guess-for-an-optimization/m-p/755490#M5545</guid>
      <dc:creator>Salah</dc:creator>
      <dc:date>2021-07-20T22:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: find initial guess for an optimization</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/find-initial-guess-for-an-optimization/m-p/755494#M5546</link>
      <description>&lt;P&gt;It is always a good idea to post the log near the error, not just the error. In your case, the log says&lt;/P&gt;
&lt;PRE&gt;2318&lt;BR /&gt;&lt;STRONG&gt;2319 f= m*log(alpha*lambda)+(lambda-1)*Sum1 +&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;2319! (alpha-1)*Sum2 + alpha*Sum3 +&lt;/STRONG&gt;&lt;BR /&gt;2320 alpha *(n-m-Rq[+])*log(1-(X[m]**lambda));&lt;BR /&gt;2321&lt;BR /&gt;2322&lt;BR /&gt;2323&lt;BR /&gt;2324 return( -f );&lt;BR /&gt;2324! /* return -f so that extrema are maxima */&lt;BR /&gt;2325 finish;&lt;BR /&gt;2329  f = Camel(KK);
ERROR: (execution) Matrices do not conform to the operation.

 &lt;STRONG&gt;operation : * at line 2319 column 22&lt;/STRONG&gt;
 operands  : alpha, lambda
alpha  10000 rows      1 col     (numeric)
lambda  10000 rows      1 col     (numeric)

 statement : ASSIGN at line 2319 column 8
 traceback : module CAMEL at line 2319 column 8

NOTE: Paused in module CAMEL.
&lt;/PRE&gt;
&lt;P&gt;"do not conform" for the '*' operation means that you are trying to perform matrix multiplication, but the matrices are the wrong dimension. By looking at the line number, you can see that matrix multiplication is not defined between two Nx1 vectors. Fortunately, you showed in a comment that you copied code from&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2014/06/11/initial-guess-for-optimization.html," target="_blank"&gt;https://blogs.sas.com/content/iml/2014/06/11/initial-guess-for-optimization.html,&lt;/A&gt;&amp;nbsp;and you can check that blog post to see that the author used the '#' operator (not the '*' operator) to perform elementwise multiplication of two vectors.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know which of your symbols represent vectors vs scalars, but you can use # for multiplication when you define the function, like this:&lt;/P&gt;
&lt;PRE&gt;       f= m#log(alpha#lambda)+(lambda-1)#Sum1 + (alpha-1)#Sum2 + alpha#Sum3 + 
                                                           alpha#(n-m-Rq[+])#log(1-(X[m]**lambda));
&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Jul 2021 22:44:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/find-initial-guess-for-an-optimization/m-p/755494#M5546</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-07-20T22:44:06Z</dc:date>
    </item>
  </channel>
</rss>

