#2581 definite integral fails with messy integrand, indefinite succeeds

None
open
nobody
5
2014-09-30
2013-05-28
No

Maxima version: "5.28.0"
Maxima build date: "2013-04-30 22:52:43"
Host type: "i386-apple-darwin12.3.0"
Lisp implementation type: "SBCL"
Lisp implementation version: "1.1.7"

Hi. First post to maxima (though user for many years) so filter accordingly. I am using maxima so solve a set of equations subject to integral constraints. I have a number of files using similar kernel (weight) functions that run flawlessly. But the attached hangs with a lisp error. Neither myself nor co-author on an R package that uses this input can detect the issue hence the post. The file tgauss_convolution.m crashes while a similar function epanechnikov_convolution.m runs smoothly but we don't see any substantive difference between the two (the first computes a `truncated gaussian convolution of a kernel with the data, the other an epanechnikov convolution of a kernel with the data' for what that is worth).

File attached, advice/guidance/suggestions most appreciated, and thanks in advance for your wonderful contributions to the community!

1 Attachments

Related

Bugs: #2581

Discussion

  • Jeffrey Racine

    Jeffrey Racine - 2013-05-28

    First, let me apologize for submitting the wrong file! And the error is incorrect as well. Perhaps it is best to close this and start a new one?

    Regardless, thanks for your patience. I attach the file that is causing issues (and it is not the Lisp error above).

    Here is the minimal example that reproduces the problem.

    If you set :

    ker:gaussian$
    b:inf$

    the program works fine. the same goes for epanechnikov and sqrt(5).

    if you do:
    ker:utgaussian$
    b:3$

    The integral on line 52 never terminates:
    kerfourth_k:integrate(kerfourth(Z)^2, Z, -b, b)$

    Thanks again for your patience and suggestions....

     
  • Jeffrey Racine

    Jeffrey Racine - 2013-05-28

    And I guess I would help myself by attaching the error!

    Maxima encountered a Lisp error:

    Too large to be represented as a DOUBLE-FLOAT:
    152915732322976479918832002685040028630353131589337854665523688586554651989804484145284429606176260483012089810714857635393426910242585929625193162766631662533887571671482315278160628668446747723740057372495802285423395747186399634885489237057355215343517221347440959048674634893632288002476228124735680924446837968827712498353003646825426335990543880324738344073091376081333874850824650605170585413121705002840082407484507078448274262962645064540911722272204750285437923011389853734700785306342333106184700999656914651131100627516710137181175

    Automatically continuing.
    To enable the Lisp debugger set debugger-hook to nil.
    2
    (%i40) kerfourth_k2 : integrate(Z kerfourth(Z), Z, - b, b)
    (%i41) kerfourth_k2_n : ev(kerfourth_k2, numer)
    2
    (%i42) kerfourth_k22 : integrate((Z kerfourth(Z)) , Z, - b, b)
    (%i43) kerfourth_k22_n : ev(kerfourth_k22, numer)
    Maxima encountered a Lisp error:

    Too large to be represented as a DOUBLE-FLOAT:
    283343791638905712426520319024732910283251797203367360290704070187204421938093708430393581267771791750121714702067335806187139874586293490181113744874368628761095325396608069208109253491742557048991061906906117489436664716063069829668589052415877927248709203306051364950731196799875432751141193805149182645623352590232562420509761289684976301066729444390080238244297190284564740760974250022901589584907291899687400776876140185772281803326437068079183405546405585756034265978946156759230072468403844466616799437037338730581673281396078498607631423447522266678290054326519649167901438677315368816357148583759162159875

    Automatically continuing.
    To enable the Lisp debugger set debugger-hook to nil.
    1 1
    (%i44) kerfourth_km : integrate(kerfourth(- + Z) kerfourth(Z - -), Z, bml, bmh)
    2 2
    (%i45) kerfourth_km_n : ev(kerfourth_km, numer)
    (%i46) define(kerfourthder(Z), diff(kerfourth(Z), Z))
    (%i47) define(kerfourthcdf(x), integrate(kerfourth(Z), Z, - b, x))
    (%i48) define(kerfourthconvol_neg(v), integrate(kerfourth(u) kerfourth(u - v),
    u, - b, bvh))
    Is v + 6 positive, negative, or zero?

     
  • Robert Dodier

    Robert Dodier - 2013-06-17
    • labels: --> Lisp Core - Integration
     
  • Robert Dodier

    Robert Dodier - 2013-07-03
    • status: open --> pending
     
  • Robert Dodier

    Robert Dodier - 2013-07-03

    To the person who reported the bug: can you please attach a script which reproduces the bug that you see. I don't see any error in the attached script, except that it is malformed (it ends in an unterminated comment).

    I've marked this report as pending -- it should be closed if no further information is forthcoming; there simply isn't anything useful we can do with it as it stands.

     
  • Jeffrey Racine

    Jeffrey Racine - 2013-07-03

    Dear Robert,

    Apologies and script attached... you will notice that for the kernels epanechnikov and gaussian with supports sqrt(5) and inf the script runs perfectly, but with the truncated gaussian there is no progress...

    Thank you ever so much for your contributions to the community!

    -- Jeff

     
  • Robert Dodier

    Robert Dodier - 2013-07-26

    OK, I see now that kernel_error.max is attached to a comment instead of the original report. I've tried that script and I see the reported behavior (that integrate(kerfourth(Z)^2, Z, -b, b) seems to take forever).

    It seems to be a problem in the definite integral code -- if I change the definite integral to (integrate(<stuff>, Z), ev(%%, Z=b) - ev(%%, Z=-b)) then it quickly produces a result. In fact I changed all the integrals in that way and they all produce results that way. So that's a way for you to get to a result, if it still matters.

    The integrands in question are messy expressions containing a lot of exponential terms -- my guess is that these are being simplified or expanded in ways that cause them to get larger (more terms) instead of smaller. Not sure if it's a bug in the simplification code or in the definite integral code.

     
  • Robert Dodier

    Robert Dodier - 2013-07-26
    • labels: Lisp Core - Integration --> Lisp Core - Integration, Lisp Core - Simplification
    • summary: Maxima encountered a Lisp error: --> definite integral fails with messy integrand, indefinite succeeds
    • status: pending --> open
     
  • Jeffrey Racine

    Jeffrey Racine - 2013-07-26

    Dear Professor Dodier,

    Many thanks for this. I will give your suggestion a go, and thanks again for your contributions to the community.

    -- Jeff

    On 2013-07-26, at 2:15 AM, Robert Dodier robert_dodier@users.sf.net wrote:

    OK, I see now that kernel_error.max is attached to a comment instead of the original report. I've tried that script and I see the reported behavior (that integrate(kerfourth(Z)^2, Z, -b, b) seems to take forever).

    It seems to be a problem in the definite integral code -- if I change the definite integral to (integrate(<stuff>, Z), ev(%%, Z=b) - ev(%%, Z=-b)) then it quickly produces a result. In fact I changed all the integrals in that way and they all produce results that way. So that's a way for you to get to a result, if it still matters.

    The integrands in question are messy expressions containing a lot of exponential terms -- my guess is that these are being simplified or expanded in ways that cause them to get larger (more terms) instead of smaller. Not sure if it's a bug in the simplification code or in the definite integral code.

    [bugs:#2581] Maxima encountered a Lisp error:

    Status: pending
    Labels: Lisp Core - Integration
    Created: Tue May 28, 2013 01:25 PM UTC by Jeffrey Racine
    Last Updated: Wed Jul 03, 2013 06:32 AM UTC
    Owner: nobody

    Maxima version: "5.28.0"
    Maxima build date: "2013-04-30 22:52:43"
    Host type: "i386-apple-darwin12.3.0"
    Lisp implementation type: "SBCL"
    Lisp implementation version: "1.1.7"

    Hi. First post to maxima (though user for many years) so filter accordingly. I am using maxima so solve a set of equations subject to integral constraints. I have a number of files using similar kernel (weight) functions that run flawlessly. But the attached hangs with a lisp error. Neither myself nor co-author on an R package that uses this input can detect the issue hence the post. The file tgauss_convolution.m crashes while a similar function epanechnikov_convolution.m runs smoothly but we don't see any substantive difference between the two (the first computes a `truncated gaussian convolution of a kernel with the data, the other an epanechnikov convolution of a kernel with the data' for what that is worth).

    File attached, advice/guidance/suggestions most appreciated, and thanks in advance for your wonderful contributions to the community!

    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/maxima/bugs/2581/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

    Professor J. S. Racine Phone: (905) 525 9140 x 23825
    Department of Economics FAX: (905) 521-8232
    McMaster University e-mail: racinej@mcmaster.ca
    1280 Main St. W.,Hamilton, URL: www.economics.mcmaster.ca/racine
    Ontario, Canada. L8S 4M4

    `The generation of random numbers is too important to be left to chance'

     

    Related

    Bugs: #2581


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks