how to convert analytic integral into sum

76 Views Asked by At

I have a composition of functions defined in an integral. For one of the functions, I do not have a functional representation, but have the historical data. Thus, I'd like to use the numerical convolution.

Suppose my outer integral function is defined as follows for a given time horizon $X$ and initial time $x_0$:

$ \int_{x_0}^{x_0 + X} f(x) g(x_0 + X-x) \,dx $

where $f(x) = ln (m(x))$ and $m(x_1) = m(x_0) + \int_{x_0}^{x_1} h(x) k(x_1 - x) \,dx$.

I have the definition of function $k$, but only have the historical data for function $h$ for each discrete time period. I intend to perform convolution for $h$ and $k$.

$ \int_{x_0}^{x_1} h(x) k(x_1 - x) \,dx \approx \sum_{i=0}^{n} h(i) k(i)$.

I am pretty rusty with my calc skills and am trying to figure out a) whether what I do is correct, and b) how to adjust the indices in the approximate sum presented above. Any help is highly appreciated.

1

There are 1 best solutions below

0
On BEST ANSWER

Assuming the data is of the form $$(t_0, h_0), \dots, (t_n, h_n)$$ with $t_0 = x_0, t_n = x_1$, and $h_i = h(t_i)$ for all $i$, and the $t_i$ are in increasing order, then the trapezoidal rule can be used to estimate the integral. The trapezoidal rule estimates that the average height of the function being integrated on each subinterval $[t_{i-1}, t_i]$ will be the average of the height at the two endpoints. So the integral is estimated as $$\int_{x_0}^{x_1}h(x)k(x_1 - x)\,dx \approx \sum_{i=1}^n \dfrac{h_{i-1}k(x_1 - t_{i-1}) + h_ik(x_1 - t_i)}2 (t_i - t_{i-1})$$

If $x_1$ is not one of the known $t_i$, you can interpolate the value of $h(x_1)$ from the surrounding known values: if $t_{k-1} < x_1 < t_k$, then set $t_k^* = x_1$ and $$h_k^* = h(t_k^*) \approx h_{k-1} + \dfrac{x_1 - t_{k-1}}{t_k - t_{k-1}}(h_k - h_{k-1})$$ And use $n = k$ with $(t_k^*, h_k^*)$ replacing $(t_k, h_k)$ in the trapezoidal summation. Similarly for when $x_0$ is not one of the $t_i$.