Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

A symbolic convolution of arbitrary functions

In this manual it is described how to get a symbolic result of "the convolution of any piecewise defined function with another". However, when I try this with functions like exponent, this does not work:

x = PolynomialRing(QQ, 'x').gen()
f = Piecewise([[(0,1),exp(x)]])
f.convolution(f)

I get an error "RuntimeError: Symbolic Ring still using old coercion framework"

If I use a 'RR' ring instead of 'QQ', Piecewise() returns another error "TypeError: cannot coerce arguments: __call__() takes exactly 1 positional argument (0 given)"

I have 2 questions:

  1. Is there a way to get a function, which represent convolution of a gaussian function and a decaying exponent (and, generally, any functions)? I want to fit my data with such a function.
  2. How to get a symbolical convolution of functions with parameters (they should be assumed to be constants during convolution computation)?
click to hide/show revision 2
No.2 Revision

A symbolic convolution of arbitrary functions

In this manual it is described how to get a symbolic result of "the convolution of any piecewise defined function with another". However, when I try this with functions like exponent, this does not work:

x = PolynomialRing(QQ, 'x').gen()
f = Piecewise([[(0,1),exp(x)]])
f.convolution(f)

I get an error "RuntimeError: Symbolic Ring still using old coercion framework"

If I use a 'RR' ring instead of 'QQ', Piecewise() returns another error "TypeError: cannot coerce arguments: __call__() takes exactly 1 positional argument (0 given)"

I have 2 questions:

  1. Is there a way to get a function, which represent convolution of a gaussian function and a decaying exponent (and, generally, any functions)? I want to fit my data with such a function.
  2. How to get a symbolical convolution of functions with parameters (they should be assumed to be constants during convolution computation)?