<?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: Getting derivatives of a kernel smoother function in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Getting-derivatives-of-a-kernel-smoother-function/m-p/941862#M109477</link>
    <description>&lt;P&gt;You can call this function from JSL that surfaces the feature from the Formula Editor:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="derivative function.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/99534i7816BCDF739CA604/image-size/large?v=v2&amp;amp;px=999" role="button" title="derivative function.png" alt="derivative function.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Apr 2026 15:52:24 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2026-04-14T15:52:24Z</dc:date>
    <item>
      <title>Getting derivatives of a kernel smoother function</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-derivatives-of-a-kernel-smoother-function/m-p/941850#M109476</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;
&lt;P&gt;I am using the kernel smoother to estimate some values and sane the prediction formula in a new column. It works very well for my purpose .&lt;/P&gt;
&lt;P&gt;&amp;lt;JSL&amp;gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;obj = dt_clean &amp;lt;&amp;lt; &lt;SPAN&gt;Bivariate&lt;/SPAN&gt;( &lt;SPAN&gt;Y&lt;/SPAN&gt;( :&lt;SPAN&gt;temperature&lt;/SPAN&gt; ), &lt;SPAN&gt;X&lt;/SPAN&gt;( :&lt;SPAN&gt;Z_res&lt;/SPAN&gt; ) ,&lt;SPAN&gt;by&lt;/SPAN&gt; (:&lt;SPAN&gt;date&lt;/SPAN&gt;),invisible);&lt;/P&gt;
&lt;P&gt;obj &amp;lt;&amp;lt; &lt;SPAN&gt;Kernel Smoother&lt;/SPAN&gt;( &lt;SPAN&gt;1&lt;/SPAN&gt;, &lt;SPAN&gt;1&lt;/SPAN&gt;, .&lt;SPAN&gt;2&lt;/SPAN&gt;, &lt;SPAN&gt;0 &lt;/SPAN&gt;);&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;obj &amp;lt;&amp;lt; (curve[&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;] &amp;lt;&amp;lt; &lt;/SPAN&gt;Save Prediction Formula&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Now I need the derivative of this function at each point of the X variable. I can do it easily within the data table using the derivative function inside the formula editor. However, I need to do this within some JSL code. I have tried all sorts of syntax but to no avail. Any suggestions on how to do this within the community?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Many thanks for any help you can provide, Yves&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2026 15:48:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-derivatives-of-a-kernel-smoother-function/m-p/941850#M109476</guid>
      <dc:creator>yvesprairie</dc:creator>
      <dc:date>2026-04-14T15:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Getting derivatives of a kernel smoother function</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-derivatives-of-a-kernel-smoother-function/m-p/941862#M109477</link>
      <description>&lt;P&gt;You can call this function from JSL that surfaces the feature from the Formula Editor:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="derivative function.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/99534i7816BCDF739CA604/image-size/large?v=v2&amp;amp;px=999" role="button" title="derivative function.png" alt="derivative function.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2026 15:52:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-derivatives-of-a-kernel-smoother-function/m-p/941862#M109477</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2026-04-14T15:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Getting derivatives of a kernel smoother function</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-derivatives-of-a-kernel-smoother-function/m-p/941969#M109482</link>
      <description>&lt;P&gt;Thank you Mark for your quick reply. I had played around with the above function but I finally managed to get it to work by first &amp;nbsp;getting the prediction formula into an expression and applying the derivative function to the name expression and then saving into a new column. For reference, here is the code. Thanks again!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;formula_exp = column(4) &amp;lt;&amp;lt; Get Formula;
der_expr=derivative( name expr(formula_exp), :Z_res) ;
dt_clean&amp;lt;&amp;lt; New Column( "Derivative", Formula(  Name expr(der_expr)));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Apr 2026 20:35:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-derivatives-of-a-kernel-smoother-function/m-p/941969#M109482</guid>
      <dc:creator>yvesprairie</dc:creator>
      <dc:date>2026-04-14T20:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Getting derivatives of a kernel smoother function</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-derivatives-of-a-kernel-smoother-function/m-p/942015#M109484</link>
      <description>&lt;P&gt;wow, really nice, thank!&amp;nbsp;&lt;BR /&gt;: - )&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1776230359059.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/99596i8036AF482D6A3C30/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1776230359059.png" alt="hogi_0-1776230359059.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class Families.jmp" );
gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 437, 413 ),
	Graph Spacing( 4 ),
	Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
	Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
);
	
gbb = Report(gb)[GraphBuilderBox(1)];
gbb &amp;lt;&amp;lt; updateElement(1, 1, 2, {Save Formula});

nc= n cols(dt);

myFormula = column (dt,nc) &amp;lt;&amp;lt; get formula;

Eval (Eval Expr(New Column( "derivative",
	Formula(
		f = As Constant(
			Derivative( Expr(Name Expr(myFormula)),:height	));
		f;
	),
)));


gb &amp;lt;&amp;lt; Add Variable( {:derivative, Role( "Y" )} )
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Apr 2026 05:19:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-derivatives-of-a-kernel-smoother-function/m-p/942015#M109484</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2026-04-15T05:19:40Z</dc:date>
    </item>
  </channel>
</rss>

