<?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 Is there Harmonic Number in SAS-IML? in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Is-there-Harmonic-Number-in-SAS-IML/m-p/758594#M5563</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does SAS have&amp;nbsp;HarmonicNumber? When I looked this up,&amp;nbsp; I only found "Harmean" function, but this calculates the mean of vector of size n.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to take n=1,&amp;nbsp; unfortunately, this didn't work.&lt;/P&gt;&lt;P&gt;In my problem,&amp;nbsp;I derived the log-likelihood function using Mathematica and then I used the output in my code (see pic below).&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="1.JPG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62169iC712CD0CF355E53E/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.JPG" alt="1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 31 Jul 2021 13:25:32 GMT</pubDate>
    <dc:creator>Salah</dc:creator>
    <dc:date>2021-07-31T13:25:32Z</dc:date>
    <item>
      <title>Is there Harmonic Number in SAS-IML?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Is-there-Harmonic-Number-in-SAS-IML/m-p/758594#M5563</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does SAS have&amp;nbsp;HarmonicNumber? When I looked this up,&amp;nbsp; I only found "Harmean" function, but this calculates the mean of vector of size n.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to take n=1,&amp;nbsp; unfortunately, this didn't work.&lt;/P&gt;&lt;P&gt;In my problem,&amp;nbsp;I derived the log-likelihood function using Mathematica and then I used the output in my code (see pic below).&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="1.JPG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62169iC712CD0CF355E53E/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.JPG" alt="1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Jul 2021 13:25:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Is-there-Harmonic-Number-in-SAS-IML/m-p/758594#M5563</guid>
      <dc:creator>Salah</dc:creator>
      <dc:date>2021-07-31T13:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Is there Harmonic Number in SAS-IML?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Is-there-Harmonic-Number-in-SAS-IML/m-p/758595#M5564</link>
      <description>&lt;P&gt;I hesitate to correct Mathematica, but I thought Harmonic Numbers were only defined for integers. The arguments do not look like integers to me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think SAS has a built-in function for harmonic numbers. However, the harmonic numbers are just the sum of the reciprocals of integers, so you can define the following function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
start HarmonicNumber(n);
   return sum(1/(1:n));
finish;

/* test it: The 10th harmonic number is 7382/2520 */
H = HarmonicNumber(10);
print H[format=FRACT.];
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 31 Jul 2021 13:41:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Is-there-Harmonic-Number-in-SAS-IML/m-p/758595#M5564</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-07-31T13:41:56Z</dc:date>
    </item>
  </channel>
</rss>

