This does the trick in J904 - perhaps there's a better way of emulating D.(i.3) ...

   load'plot'
   load'~addons/math/calculus/calculus.ijs'

   u =. ^@-@-:@*:"0
   u1=. (u deriv_jcalculus_ 1)
   u2=. (u1 deriv_jcalculus_ 1)
   $>(u;u1;u2)10%~50-~i.101
3 101
   plot >(u;u1;u2)10%~50-~i.101

Mike

On 24/11/2022 18:54, 'Michael Day' via Programming wrote:
Well, I've discovered that this works ok in J807:

    plot|:^@-@-:@*:"0 D.(i.3)10%~50-~i.101     NB. replace ^&2 by *:   (!)

I wasn't sure that you needed "0 so tried

    plot|:^@-@-:@*: D.(i.3)10%~50-~i.101


but that suffers the same problem with the 2nd derivative!


We're supposed to use deriv for d. and pderiv for D. in J90x, x > 0 .

Others will know how to do the equivalent of (u D.(i.3)) - I couldn't see how just now,

but you're presumably a version or two behind these.


Mike



On 24/11/2022 18:01, 'Bo Jacoby' via Programming wrote:
    plot|:^@-@-:@^&2"0 D.(i.3)10%~50-~i.101


NB. The blue curve is the bell curve. Mean value = 50. Standard deviation = 10NB. The read curve is the derivative of the blue curve. It crosses Y=0 at X=50NB. The green curve is the derivative of the red curve. It crosses Y=0 at X=50-10 and X=50+10
NB. But why is the green curve so ugly around X=50?
Thank you!
Bo.


----------------------------------------------------------------------
For information about J forums seehttp://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to