Hi, talking about math/calculus, I'd like to propose something: The implementation of the fold family (F. &co) has shown that primitives can be implemented in a J addon (dev/fold). In view of the recent re-introduction of the modifier trains for backwards compatibility with reference texts, I think it would make sense to do the same with d. and D. and, when implemented, Taylor series (i.e. have them implemented in math/calculus, and use the primitives d. and D. as cover names).
Recently, I've been going through the math/calculus code, and I'm intending to try and implement the Taylor series and propose some improvements/extensions. So, for the moment I'd like to know: what's the recommended way to contribute to this addon? I found one small bug in that the derivative of -. is defined as _1:0, which should have been _1"0 (in primderiv). What concerns extensions, I had these ideas: 0) Extending to derivatives to non-differentiable functions I think we could implement many derivatives of discontinuous functions as "best efforts", e.g. m&>. (which has notable use as 0&>. as ReLU in machine learning), where we could ignore the non-derivability in a single point, by fixing a sensible value, in line with 0%0. There's others like | or <. or >. that could be treated similarly. What are your opinions on this: is this behaviour useful? Should the resulting function be modified to throw errors in non-differentiable points? Or perhaps a warning could be given about which points would be non-differentiable (likely more tricky, because it would require backtracking through the function to see which values would end up being not differentiable). 1) Another idea would be trying to simplify the verbs resulting from deriv. For instance, the 4th derivative of 1&o. should be 1&o. but is currently: d4 =: 1&o. deriv_jcalculus_ 4 d4 (-@(1&o.) * _1"0@(1&o.))+2&o. * 2&o. * 0"0@(1&o.) (1&o. -: d4) i: 10 1 However, implementing this generally (i.e. not only for 1&o., or the o. family) will take implementing half a computer algebra system, which is well beyond my skill and free time, but could be extremely useful, especially for applications in e.g. machine learning (see e.g. https://arxiv.org/abs/1502.05767). Most "competitors" of J also have one, e.g. Matlab's symbolic toolbox and Python's sympy. Given J's aptness for concisely expressing mathematical ideas on "arbitrarily" high dimensional arrays would make J a killer language for machine learning (and even more if it were easy to use parallel computing and/or GPU computing, but that's another story, I guess). Sorry I got into quite a ramble, however, what better to do on Christmas day. Merry Christmas to all (or whatever other winter tradition your cultures might have)! Jan-Pieter On Sat, Dec 25, 2021, 02:55 P Padilcdx <[email protected]> wrote: > Thank you for explaining the rationale. Makes sense. > > > On Dec 24, 2021, at 1:43 PM, Henry Rich <[email protected]> wrote: > > > > They were a dead end. We started a foray into symbolic mathematics and > then realized that J is a much better than C for implementing it in. So we > moved the calculus functions to a J addon, where interested users can make > improvments if they like. > > > > Henry Rich > > > > On 12/24/2021 4:37 PM, P Padilcdx wrote: > >> Can I ask why they were removed? (Sorry I try to search the forums but > couldn't come up with anything.) Seems like very useful primitives to me > and they are still listed in NuVoc. Hopefully I’m not re-starting a war… > >> Thanks. > >> > >>> On Dec 24, 2021, at 2:53 AM, Ian Clark <[email protected]> wrote: > >>> > >>> withdrawal of d. and D. > >> ---------------------------------------------------------------------- > >> For information about J forums see http://www.jsoftware.com/forums.htm > > > > > > -- > > This email has been checked for viruses by AVG. > > https://www.avg.com > > > > ---------------------------------------------------------------------- > > For information about J forums see http://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
