Help in numerical verification of Chen's identity in rough path theory.

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite
2












Would anyone please help me to verify Chen's identity as claimed in https://en.wikipedia.org/wiki/Rough_path#Signature for a simple two dimensional path? Consider a path between $a$ to $d$ and the paths goes through the points say $a(1,4)$, $b(2,9)$, $c(3,3)$, $d(4,7)$. Further, consider that the path between the points are linear. Now one can calculate the signature using iterated integrals of the whole path from $a$ to $d$ and also using Chen's identity, considering the whole path as concatenation of three individual path, $a$ to $b$ then $b$ to $c$ and $c$ to $d$. The components of signature of each individual path can be expressed as $frac1k!prod_1^k(y_2-y_1)$ where $k$ is the level of signature and $y_2$ and $y_1$ represents the $y$ coordinate of ending and starting point respectively for each path. I am interested only up-to level 3. I am having very hard time to calculate the third iterated integrals of each path. I know the second iterated integral corresponds to area and I can calculate it using Trapezoid Rule, but could not get the concepts of iterated integrals, therefore failed to evaluate the triple iterated integrals. In addition I am not sure how to use the Chen's identity. Any help would be highly appreciated.







share|cite|improve this question

























    up vote
    0
    down vote

    favorite
    2












    Would anyone please help me to verify Chen's identity as claimed in https://en.wikipedia.org/wiki/Rough_path#Signature for a simple two dimensional path? Consider a path between $a$ to $d$ and the paths goes through the points say $a(1,4)$, $b(2,9)$, $c(3,3)$, $d(4,7)$. Further, consider that the path between the points are linear. Now one can calculate the signature using iterated integrals of the whole path from $a$ to $d$ and also using Chen's identity, considering the whole path as concatenation of three individual path, $a$ to $b$ then $b$ to $c$ and $c$ to $d$. The components of signature of each individual path can be expressed as $frac1k!prod_1^k(y_2-y_1)$ where $k$ is the level of signature and $y_2$ and $y_1$ represents the $y$ coordinate of ending and starting point respectively for each path. I am interested only up-to level 3. I am having very hard time to calculate the third iterated integrals of each path. I know the second iterated integral corresponds to area and I can calculate it using Trapezoid Rule, but could not get the concepts of iterated integrals, therefore failed to evaluate the triple iterated integrals. In addition I am not sure how to use the Chen's identity. Any help would be highly appreciated.







    share|cite|improve this question























      up vote
      0
      down vote

      favorite
      2









      up vote
      0
      down vote

      favorite
      2






      2





      Would anyone please help me to verify Chen's identity as claimed in https://en.wikipedia.org/wiki/Rough_path#Signature for a simple two dimensional path? Consider a path between $a$ to $d$ and the paths goes through the points say $a(1,4)$, $b(2,9)$, $c(3,3)$, $d(4,7)$. Further, consider that the path between the points are linear. Now one can calculate the signature using iterated integrals of the whole path from $a$ to $d$ and also using Chen's identity, considering the whole path as concatenation of three individual path, $a$ to $b$ then $b$ to $c$ and $c$ to $d$. The components of signature of each individual path can be expressed as $frac1k!prod_1^k(y_2-y_1)$ where $k$ is the level of signature and $y_2$ and $y_1$ represents the $y$ coordinate of ending and starting point respectively for each path. I am interested only up-to level 3. I am having very hard time to calculate the third iterated integrals of each path. I know the second iterated integral corresponds to area and I can calculate it using Trapezoid Rule, but could not get the concepts of iterated integrals, therefore failed to evaluate the triple iterated integrals. In addition I am not sure how to use the Chen's identity. Any help would be highly appreciated.







      share|cite|improve this question













      Would anyone please help me to verify Chen's identity as claimed in https://en.wikipedia.org/wiki/Rough_path#Signature for a simple two dimensional path? Consider a path between $a$ to $d$ and the paths goes through the points say $a(1,4)$, $b(2,9)$, $c(3,3)$, $d(4,7)$. Further, consider that the path between the points are linear. Now one can calculate the signature using iterated integrals of the whole path from $a$ to $d$ and also using Chen's identity, considering the whole path as concatenation of three individual path, $a$ to $b$ then $b$ to $c$ and $c$ to $d$. The components of signature of each individual path can be expressed as $frac1k!prod_1^k(y_2-y_1)$ where $k$ is the level of signature and $y_2$ and $y_1$ represents the $y$ coordinate of ending and starting point respectively for each path. I am interested only up-to level 3. I am having very hard time to calculate the third iterated integrals of each path. I know the second iterated integral corresponds to area and I can calculate it using Trapezoid Rule, but could not get the concepts of iterated integrals, therefore failed to evaluate the triple iterated integrals. In addition I am not sure how to use the Chen's identity. Any help would be highly appreciated.









      share|cite|improve this question












      share|cite|improve this question




      share|cite|improve this question








      edited Aug 7 at 1:37
























      asked Aug 6 at 23:48









      Creator

      1,0971826




      1,0971826




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          I think you are asking for an explicit calculation of the third level of the signature of a three-segment path - not using Chen's formula but just doing the integration according to the definition of the signature. This would be a comparatively simple but very long calculation. Here I will do the explicit calculation for only a single element of level two of the signature of a two-segment two-dimensional path with all the integrals in detail. I hope this will illustrate the general pattern usefully. I will not mention anything specific to level two, and I will not use the trapezium rule. I am also not going to use the points you have picked, which have one of their coordinates being in arithmetic progression, in order to avoid lucky simplifications being evident.



          Consider calculating element 12 of the signature of the path linearly interpolating the points (1,4), (2,9) and (4,3). It lives on the second level.
          First we need to define a formula for the path, a parametrisation. (It turns out that we will get the same answer whatever parametrisation we choose). We will use the parametrisation of the curve given on $0<t<2$ by

          $$
          x_1(t)=begincasest+1&tle1\2t&t>1endcases
          $$
          and
          $$
          x_2(t)=begincases5t+4&tle1\15-6t&t>1endcases.
          $$



          The definition of the signature element 12 of our curve on $[0,2]$ is
          $$
          X_0,2^x(12)=int_0^2int_0^t dx_1(s),dx_2(t)=int_0^2left[int_0^t dx_1(s)right],dx_2(t).
          $$
          These integrals are Riemann-Stieltjes integrals. [Note: If we were calculating the signature of a smooth curve given by a simple formula, we would typically use integration by substitution to get them into a normal-looking Riemann integral - this element would look like
          $int_0^2int_0^t x_1'(s),ds,x_2'(t),dt$. We cannot do that here because $x_1$ and $x_2$ are not differentiable at 1. The curve, indeed any curve which is piecewise linear but not a straight line, turns a corner and so no parametrisation will have derivatives at the turning point.]



          Let's proceed with the calculation of the integral. The innermost integral is always elementary, as it is given by a difference in the endpoints. Our signature element is therefore
          $$
          X_0,2^x(12)=int_0^2 [x_1(t)-x_1(0)] , dx_2(t)
          $$
          All integrals except the innermost will need to be split separately into parts according to the piecewise definition of the curve. We then get something we can evaluate explicitly, using integration by substitution.
          beginalign
          X_0,2^x(12)&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + int_1^2 [x_1(t)-x_1(0)] , dx_2(t)
          \&=int_0^1 [(t+1)-1] , dx_2(t) + int_1^2 [(2t)-1] , dx_2(t)
          \&=int_0^1 [(t+1)-1] , fracdx_2(t)dt,dt + int_1^2 [(2t)-1] , fracdx_2(t)dt,dt
          \&=int_0^1 [(t+1)-1] , 5,dt + int_1^2 [(2t)-1] , (-6),dt
          \&=frac52-12=frac-192
          endalign
          This concludes the explicit calculation of the element.



          But there's an even more verbose way to split up the definition
          beginalign
          X_0,2^x(12)&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + int_1^2 [x_1(t)-x_1(0)] , dx_2(t)
          \&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + int_1^2 [x_1(1)-x_1(0)] , dx_2(t)+ int_1^2 [x_1(t)-x_1(1)] , dx_2(t)
          \&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + [x_1(1)-x_1(0)] int_1^2 , dx_2(t)+ int_1^2 [x_1(t)-x_1(1)] , dx_2(t)
          endalign
          We recognise each part of this as a signature of parts of the path, explicitly:
          beginalign
          X_0,2^x(12)&=X_0,1^x(12)+X_0,1^x(1)X_1,2^x(2)+X_1,2^x(12)
          endalign
          This is exactly what Chen's formula for a signature element of a concatenation of two paths would tell us. In this case the two paths are straight so we can use the formula you mention (explicitly that element $i_1dots i_k$ of the signature of the straight path from $a$ to $b$ is $frac1k!prod_j=1^k(b_i_j-a_i_j)$) to evaluate them, giving
          beginalign
          X_0,2^x(12)&=X_0,1^x(12)+X_0,1^x(1)X_1,2^x(2)+X_1,2^x(12)
          \&=[tfrac12(2-1)(9-4)]+[(2-1)][(3-9)]+[tfrac12(4-2)(3-9)]
          \&=tfrac52-6-6=frac-192.
          endalign
          In this case we see that explicit calculation and the use of Chen's formula agree.






          share|cite|improve this answer





















          • Thanks a lot. Just to let know, why I could not do. I never did the use the parameter 't', so never formed an equation. BIG thanks.
            – Creator
            Aug 15 at 0:00










          • It seems I need to implement only two equations to get the signatures for linear path between points. One is Chen's formula and the is $frac1k!prod_j=1^k(b_i_j-a_i_j)$. I am only interested in speech like signals where one dimension is arithmetic progression (constant sampling period). Is there a shot cut formula for such case?
            – Creator
            Aug 17 at 2:59











          • Implementing those two formulae can be very little code, little hassle and can often run pretty fast - it's linear in the length of the input. In particular cases (e.g. low dimension like you have, low level, very long signals, a language like python or matlab where you want to avoid loops) you may be able to be clever and come up with something which runs faster. By "short cut" do you mean saving coding/testing time or saving run time? What platform/programming language?
            – JeremyFR
            Aug 17 at 11:05










          • By short cut, I mean saving run time and I use MATLAB. My background is signal processing.
            – Creator
            2 days ago










          • I am not very familiar with matlab. I had a go at writing a general signature calculation function for matlab based on these formulae. It is at github.com/bottler/iisignature/blob/master/examples/matlab/… . I suspect it has plenty of room for optimization. It runs instantaneously in the simple examples I tried. For heavy use, I would expect calling out to a compiled library - like the way iisignature works in Python - to be the fastest.
            – JeremyFR
            22 hours ago











          Your Answer




          StackExchange.ifUsing("editor", function ()
          return StackExchange.using("mathjaxEditing", function ()
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          );
          );
          , "mathjax-editing");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "69"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2874431%2fhelp-in-numerical-verification-of-chens-identity-in-rough-path-theory%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          I think you are asking for an explicit calculation of the third level of the signature of a three-segment path - not using Chen's formula but just doing the integration according to the definition of the signature. This would be a comparatively simple but very long calculation. Here I will do the explicit calculation for only a single element of level two of the signature of a two-segment two-dimensional path with all the integrals in detail. I hope this will illustrate the general pattern usefully. I will not mention anything specific to level two, and I will not use the trapezium rule. I am also not going to use the points you have picked, which have one of their coordinates being in arithmetic progression, in order to avoid lucky simplifications being evident.



          Consider calculating element 12 of the signature of the path linearly interpolating the points (1,4), (2,9) and (4,3). It lives on the second level.
          First we need to define a formula for the path, a parametrisation. (It turns out that we will get the same answer whatever parametrisation we choose). We will use the parametrisation of the curve given on $0<t<2$ by

          $$
          x_1(t)=begincasest+1&tle1\2t&t>1endcases
          $$
          and
          $$
          x_2(t)=begincases5t+4&tle1\15-6t&t>1endcases.
          $$



          The definition of the signature element 12 of our curve on $[0,2]$ is
          $$
          X_0,2^x(12)=int_0^2int_0^t dx_1(s),dx_2(t)=int_0^2left[int_0^t dx_1(s)right],dx_2(t).
          $$
          These integrals are Riemann-Stieltjes integrals. [Note: If we were calculating the signature of a smooth curve given by a simple formula, we would typically use integration by substitution to get them into a normal-looking Riemann integral - this element would look like
          $int_0^2int_0^t x_1'(s),ds,x_2'(t),dt$. We cannot do that here because $x_1$ and $x_2$ are not differentiable at 1. The curve, indeed any curve which is piecewise linear but not a straight line, turns a corner and so no parametrisation will have derivatives at the turning point.]



          Let's proceed with the calculation of the integral. The innermost integral is always elementary, as it is given by a difference in the endpoints. Our signature element is therefore
          $$
          X_0,2^x(12)=int_0^2 [x_1(t)-x_1(0)] , dx_2(t)
          $$
          All integrals except the innermost will need to be split separately into parts according to the piecewise definition of the curve. We then get something we can evaluate explicitly, using integration by substitution.
          beginalign
          X_0,2^x(12)&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + int_1^2 [x_1(t)-x_1(0)] , dx_2(t)
          \&=int_0^1 [(t+1)-1] , dx_2(t) + int_1^2 [(2t)-1] , dx_2(t)
          \&=int_0^1 [(t+1)-1] , fracdx_2(t)dt,dt + int_1^2 [(2t)-1] , fracdx_2(t)dt,dt
          \&=int_0^1 [(t+1)-1] , 5,dt + int_1^2 [(2t)-1] , (-6),dt
          \&=frac52-12=frac-192
          endalign
          This concludes the explicit calculation of the element.



          But there's an even more verbose way to split up the definition
          beginalign
          X_0,2^x(12)&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + int_1^2 [x_1(t)-x_1(0)] , dx_2(t)
          \&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + int_1^2 [x_1(1)-x_1(0)] , dx_2(t)+ int_1^2 [x_1(t)-x_1(1)] , dx_2(t)
          \&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + [x_1(1)-x_1(0)] int_1^2 , dx_2(t)+ int_1^2 [x_1(t)-x_1(1)] , dx_2(t)
          endalign
          We recognise each part of this as a signature of parts of the path, explicitly:
          beginalign
          X_0,2^x(12)&=X_0,1^x(12)+X_0,1^x(1)X_1,2^x(2)+X_1,2^x(12)
          endalign
          This is exactly what Chen's formula for a signature element of a concatenation of two paths would tell us. In this case the two paths are straight so we can use the formula you mention (explicitly that element $i_1dots i_k$ of the signature of the straight path from $a$ to $b$ is $frac1k!prod_j=1^k(b_i_j-a_i_j)$) to evaluate them, giving
          beginalign
          X_0,2^x(12)&=X_0,1^x(12)+X_0,1^x(1)X_1,2^x(2)+X_1,2^x(12)
          \&=[tfrac12(2-1)(9-4)]+[(2-1)][(3-9)]+[tfrac12(4-2)(3-9)]
          \&=tfrac52-6-6=frac-192.
          endalign
          In this case we see that explicit calculation and the use of Chen's formula agree.






          share|cite|improve this answer





















          • Thanks a lot. Just to let know, why I could not do. I never did the use the parameter 't', so never formed an equation. BIG thanks.
            – Creator
            Aug 15 at 0:00










          • It seems I need to implement only two equations to get the signatures for linear path between points. One is Chen's formula and the is $frac1k!prod_j=1^k(b_i_j-a_i_j)$. I am only interested in speech like signals where one dimension is arithmetic progression (constant sampling period). Is there a shot cut formula for such case?
            – Creator
            Aug 17 at 2:59











          • Implementing those two formulae can be very little code, little hassle and can often run pretty fast - it's linear in the length of the input. In particular cases (e.g. low dimension like you have, low level, very long signals, a language like python or matlab where you want to avoid loops) you may be able to be clever and come up with something which runs faster. By "short cut" do you mean saving coding/testing time or saving run time? What platform/programming language?
            – JeremyFR
            Aug 17 at 11:05










          • By short cut, I mean saving run time and I use MATLAB. My background is signal processing.
            – Creator
            2 days ago










          • I am not very familiar with matlab. I had a go at writing a general signature calculation function for matlab based on these formulae. It is at github.com/bottler/iisignature/blob/master/examples/matlab/… . I suspect it has plenty of room for optimization. It runs instantaneously in the simple examples I tried. For heavy use, I would expect calling out to a compiled library - like the way iisignature works in Python - to be the fastest.
            – JeremyFR
            22 hours ago















          up vote
          1
          down vote



          accepted










          I think you are asking for an explicit calculation of the third level of the signature of a three-segment path - not using Chen's formula but just doing the integration according to the definition of the signature. This would be a comparatively simple but very long calculation. Here I will do the explicit calculation for only a single element of level two of the signature of a two-segment two-dimensional path with all the integrals in detail. I hope this will illustrate the general pattern usefully. I will not mention anything specific to level two, and I will not use the trapezium rule. I am also not going to use the points you have picked, which have one of their coordinates being in arithmetic progression, in order to avoid lucky simplifications being evident.



          Consider calculating element 12 of the signature of the path linearly interpolating the points (1,4), (2,9) and (4,3). It lives on the second level.
          First we need to define a formula for the path, a parametrisation. (It turns out that we will get the same answer whatever parametrisation we choose). We will use the parametrisation of the curve given on $0<t<2$ by

          $$
          x_1(t)=begincasest+1&tle1\2t&t>1endcases
          $$
          and
          $$
          x_2(t)=begincases5t+4&tle1\15-6t&t>1endcases.
          $$



          The definition of the signature element 12 of our curve on $[0,2]$ is
          $$
          X_0,2^x(12)=int_0^2int_0^t dx_1(s),dx_2(t)=int_0^2left[int_0^t dx_1(s)right],dx_2(t).
          $$
          These integrals are Riemann-Stieltjes integrals. [Note: If we were calculating the signature of a smooth curve given by a simple formula, we would typically use integration by substitution to get them into a normal-looking Riemann integral - this element would look like
          $int_0^2int_0^t x_1'(s),ds,x_2'(t),dt$. We cannot do that here because $x_1$ and $x_2$ are not differentiable at 1. The curve, indeed any curve which is piecewise linear but not a straight line, turns a corner and so no parametrisation will have derivatives at the turning point.]



          Let's proceed with the calculation of the integral. The innermost integral is always elementary, as it is given by a difference in the endpoints. Our signature element is therefore
          $$
          X_0,2^x(12)=int_0^2 [x_1(t)-x_1(0)] , dx_2(t)
          $$
          All integrals except the innermost will need to be split separately into parts according to the piecewise definition of the curve. We then get something we can evaluate explicitly, using integration by substitution.
          beginalign
          X_0,2^x(12)&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + int_1^2 [x_1(t)-x_1(0)] , dx_2(t)
          \&=int_0^1 [(t+1)-1] , dx_2(t) + int_1^2 [(2t)-1] , dx_2(t)
          \&=int_0^1 [(t+1)-1] , fracdx_2(t)dt,dt + int_1^2 [(2t)-1] , fracdx_2(t)dt,dt
          \&=int_0^1 [(t+1)-1] , 5,dt + int_1^2 [(2t)-1] , (-6),dt
          \&=frac52-12=frac-192
          endalign
          This concludes the explicit calculation of the element.



          But there's an even more verbose way to split up the definition
          beginalign
          X_0,2^x(12)&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + int_1^2 [x_1(t)-x_1(0)] , dx_2(t)
          \&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + int_1^2 [x_1(1)-x_1(0)] , dx_2(t)+ int_1^2 [x_1(t)-x_1(1)] , dx_2(t)
          \&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + [x_1(1)-x_1(0)] int_1^2 , dx_2(t)+ int_1^2 [x_1(t)-x_1(1)] , dx_2(t)
          endalign
          We recognise each part of this as a signature of parts of the path, explicitly:
          beginalign
          X_0,2^x(12)&=X_0,1^x(12)+X_0,1^x(1)X_1,2^x(2)+X_1,2^x(12)
          endalign
          This is exactly what Chen's formula for a signature element of a concatenation of two paths would tell us. In this case the two paths are straight so we can use the formula you mention (explicitly that element $i_1dots i_k$ of the signature of the straight path from $a$ to $b$ is $frac1k!prod_j=1^k(b_i_j-a_i_j)$) to evaluate them, giving
          beginalign
          X_0,2^x(12)&=X_0,1^x(12)+X_0,1^x(1)X_1,2^x(2)+X_1,2^x(12)
          \&=[tfrac12(2-1)(9-4)]+[(2-1)][(3-9)]+[tfrac12(4-2)(3-9)]
          \&=tfrac52-6-6=frac-192.
          endalign
          In this case we see that explicit calculation and the use of Chen's formula agree.






          share|cite|improve this answer





















          • Thanks a lot. Just to let know, why I could not do. I never did the use the parameter 't', so never formed an equation. BIG thanks.
            – Creator
            Aug 15 at 0:00










          • It seems I need to implement only two equations to get the signatures for linear path between points. One is Chen's formula and the is $frac1k!prod_j=1^k(b_i_j-a_i_j)$. I am only interested in speech like signals where one dimension is arithmetic progression (constant sampling period). Is there a shot cut formula for such case?
            – Creator
            Aug 17 at 2:59











          • Implementing those two formulae can be very little code, little hassle and can often run pretty fast - it's linear in the length of the input. In particular cases (e.g. low dimension like you have, low level, very long signals, a language like python or matlab where you want to avoid loops) you may be able to be clever and come up with something which runs faster. By "short cut" do you mean saving coding/testing time or saving run time? What platform/programming language?
            – JeremyFR
            Aug 17 at 11:05










          • By short cut, I mean saving run time and I use MATLAB. My background is signal processing.
            – Creator
            2 days ago










          • I am not very familiar with matlab. I had a go at writing a general signature calculation function for matlab based on these formulae. It is at github.com/bottler/iisignature/blob/master/examples/matlab/… . I suspect it has plenty of room for optimization. It runs instantaneously in the simple examples I tried. For heavy use, I would expect calling out to a compiled library - like the way iisignature works in Python - to be the fastest.
            – JeremyFR
            22 hours ago













          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          I think you are asking for an explicit calculation of the third level of the signature of a three-segment path - not using Chen's formula but just doing the integration according to the definition of the signature. This would be a comparatively simple but very long calculation. Here I will do the explicit calculation for only a single element of level two of the signature of a two-segment two-dimensional path with all the integrals in detail. I hope this will illustrate the general pattern usefully. I will not mention anything specific to level two, and I will not use the trapezium rule. I am also not going to use the points you have picked, which have one of their coordinates being in arithmetic progression, in order to avoid lucky simplifications being evident.



          Consider calculating element 12 of the signature of the path linearly interpolating the points (1,4), (2,9) and (4,3). It lives on the second level.
          First we need to define a formula for the path, a parametrisation. (It turns out that we will get the same answer whatever parametrisation we choose). We will use the parametrisation of the curve given on $0<t<2$ by

          $$
          x_1(t)=begincasest+1&tle1\2t&t>1endcases
          $$
          and
          $$
          x_2(t)=begincases5t+4&tle1\15-6t&t>1endcases.
          $$



          The definition of the signature element 12 of our curve on $[0,2]$ is
          $$
          X_0,2^x(12)=int_0^2int_0^t dx_1(s),dx_2(t)=int_0^2left[int_0^t dx_1(s)right],dx_2(t).
          $$
          These integrals are Riemann-Stieltjes integrals. [Note: If we were calculating the signature of a smooth curve given by a simple formula, we would typically use integration by substitution to get them into a normal-looking Riemann integral - this element would look like
          $int_0^2int_0^t x_1'(s),ds,x_2'(t),dt$. We cannot do that here because $x_1$ and $x_2$ are not differentiable at 1. The curve, indeed any curve which is piecewise linear but not a straight line, turns a corner and so no parametrisation will have derivatives at the turning point.]



          Let's proceed with the calculation of the integral. The innermost integral is always elementary, as it is given by a difference in the endpoints. Our signature element is therefore
          $$
          X_0,2^x(12)=int_0^2 [x_1(t)-x_1(0)] , dx_2(t)
          $$
          All integrals except the innermost will need to be split separately into parts according to the piecewise definition of the curve. We then get something we can evaluate explicitly, using integration by substitution.
          beginalign
          X_0,2^x(12)&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + int_1^2 [x_1(t)-x_1(0)] , dx_2(t)
          \&=int_0^1 [(t+1)-1] , dx_2(t) + int_1^2 [(2t)-1] , dx_2(t)
          \&=int_0^1 [(t+1)-1] , fracdx_2(t)dt,dt + int_1^2 [(2t)-1] , fracdx_2(t)dt,dt
          \&=int_0^1 [(t+1)-1] , 5,dt + int_1^2 [(2t)-1] , (-6),dt
          \&=frac52-12=frac-192
          endalign
          This concludes the explicit calculation of the element.



          But there's an even more verbose way to split up the definition
          beginalign
          X_0,2^x(12)&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + int_1^2 [x_1(t)-x_1(0)] , dx_2(t)
          \&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + int_1^2 [x_1(1)-x_1(0)] , dx_2(t)+ int_1^2 [x_1(t)-x_1(1)] , dx_2(t)
          \&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + [x_1(1)-x_1(0)] int_1^2 , dx_2(t)+ int_1^2 [x_1(t)-x_1(1)] , dx_2(t)
          endalign
          We recognise each part of this as a signature of parts of the path, explicitly:
          beginalign
          X_0,2^x(12)&=X_0,1^x(12)+X_0,1^x(1)X_1,2^x(2)+X_1,2^x(12)
          endalign
          This is exactly what Chen's formula for a signature element of a concatenation of two paths would tell us. In this case the two paths are straight so we can use the formula you mention (explicitly that element $i_1dots i_k$ of the signature of the straight path from $a$ to $b$ is $frac1k!prod_j=1^k(b_i_j-a_i_j)$) to evaluate them, giving
          beginalign
          X_0,2^x(12)&=X_0,1^x(12)+X_0,1^x(1)X_1,2^x(2)+X_1,2^x(12)
          \&=[tfrac12(2-1)(9-4)]+[(2-1)][(3-9)]+[tfrac12(4-2)(3-9)]
          \&=tfrac52-6-6=frac-192.
          endalign
          In this case we see that explicit calculation and the use of Chen's formula agree.






          share|cite|improve this answer













          I think you are asking for an explicit calculation of the third level of the signature of a three-segment path - not using Chen's formula but just doing the integration according to the definition of the signature. This would be a comparatively simple but very long calculation. Here I will do the explicit calculation for only a single element of level two of the signature of a two-segment two-dimensional path with all the integrals in detail. I hope this will illustrate the general pattern usefully. I will not mention anything specific to level two, and I will not use the trapezium rule. I am also not going to use the points you have picked, which have one of their coordinates being in arithmetic progression, in order to avoid lucky simplifications being evident.



          Consider calculating element 12 of the signature of the path linearly interpolating the points (1,4), (2,9) and (4,3). It lives on the second level.
          First we need to define a formula for the path, a parametrisation. (It turns out that we will get the same answer whatever parametrisation we choose). We will use the parametrisation of the curve given on $0<t<2$ by

          $$
          x_1(t)=begincasest+1&tle1\2t&t>1endcases
          $$
          and
          $$
          x_2(t)=begincases5t+4&tle1\15-6t&t>1endcases.
          $$



          The definition of the signature element 12 of our curve on $[0,2]$ is
          $$
          X_0,2^x(12)=int_0^2int_0^t dx_1(s),dx_2(t)=int_0^2left[int_0^t dx_1(s)right],dx_2(t).
          $$
          These integrals are Riemann-Stieltjes integrals. [Note: If we were calculating the signature of a smooth curve given by a simple formula, we would typically use integration by substitution to get them into a normal-looking Riemann integral - this element would look like
          $int_0^2int_0^t x_1'(s),ds,x_2'(t),dt$. We cannot do that here because $x_1$ and $x_2$ are not differentiable at 1. The curve, indeed any curve which is piecewise linear but not a straight line, turns a corner and so no parametrisation will have derivatives at the turning point.]



          Let's proceed with the calculation of the integral. The innermost integral is always elementary, as it is given by a difference in the endpoints. Our signature element is therefore
          $$
          X_0,2^x(12)=int_0^2 [x_1(t)-x_1(0)] , dx_2(t)
          $$
          All integrals except the innermost will need to be split separately into parts according to the piecewise definition of the curve. We then get something we can evaluate explicitly, using integration by substitution.
          beginalign
          X_0,2^x(12)&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + int_1^2 [x_1(t)-x_1(0)] , dx_2(t)
          \&=int_0^1 [(t+1)-1] , dx_2(t) + int_1^2 [(2t)-1] , dx_2(t)
          \&=int_0^1 [(t+1)-1] , fracdx_2(t)dt,dt + int_1^2 [(2t)-1] , fracdx_2(t)dt,dt
          \&=int_0^1 [(t+1)-1] , 5,dt + int_1^2 [(2t)-1] , (-6),dt
          \&=frac52-12=frac-192
          endalign
          This concludes the explicit calculation of the element.



          But there's an even more verbose way to split up the definition
          beginalign
          X_0,2^x(12)&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + int_1^2 [x_1(t)-x_1(0)] , dx_2(t)
          \&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + int_1^2 [x_1(1)-x_1(0)] , dx_2(t)+ int_1^2 [x_1(t)-x_1(1)] , dx_2(t)
          \&=int_0^1 [x_1(t)-x_1(0)] , dx_2(t) + [x_1(1)-x_1(0)] int_1^2 , dx_2(t)+ int_1^2 [x_1(t)-x_1(1)] , dx_2(t)
          endalign
          We recognise each part of this as a signature of parts of the path, explicitly:
          beginalign
          X_0,2^x(12)&=X_0,1^x(12)+X_0,1^x(1)X_1,2^x(2)+X_1,2^x(12)
          endalign
          This is exactly what Chen's formula for a signature element of a concatenation of two paths would tell us. In this case the two paths are straight so we can use the formula you mention (explicitly that element $i_1dots i_k$ of the signature of the straight path from $a$ to $b$ is $frac1k!prod_j=1^k(b_i_j-a_i_j)$) to evaluate them, giving
          beginalign
          X_0,2^x(12)&=X_0,1^x(12)+X_0,1^x(1)X_1,2^x(2)+X_1,2^x(12)
          \&=[tfrac12(2-1)(9-4)]+[(2-1)][(3-9)]+[tfrac12(4-2)(3-9)]
          \&=tfrac52-6-6=frac-192.
          endalign
          In this case we see that explicit calculation and the use of Chen's formula agree.







          share|cite|improve this answer













          share|cite|improve this answer



          share|cite|improve this answer











          answered Aug 14 at 22:44









          JeremyFR

          20617




          20617











          • Thanks a lot. Just to let know, why I could not do. I never did the use the parameter 't', so never formed an equation. BIG thanks.
            – Creator
            Aug 15 at 0:00










          • It seems I need to implement only two equations to get the signatures for linear path between points. One is Chen's formula and the is $frac1k!prod_j=1^k(b_i_j-a_i_j)$. I am only interested in speech like signals where one dimension is arithmetic progression (constant sampling period). Is there a shot cut formula for such case?
            – Creator
            Aug 17 at 2:59











          • Implementing those two formulae can be very little code, little hassle and can often run pretty fast - it's linear in the length of the input. In particular cases (e.g. low dimension like you have, low level, very long signals, a language like python or matlab where you want to avoid loops) you may be able to be clever and come up with something which runs faster. By "short cut" do you mean saving coding/testing time or saving run time? What platform/programming language?
            – JeremyFR
            Aug 17 at 11:05










          • By short cut, I mean saving run time and I use MATLAB. My background is signal processing.
            – Creator
            2 days ago










          • I am not very familiar with matlab. I had a go at writing a general signature calculation function for matlab based on these formulae. It is at github.com/bottler/iisignature/blob/master/examples/matlab/… . I suspect it has plenty of room for optimization. It runs instantaneously in the simple examples I tried. For heavy use, I would expect calling out to a compiled library - like the way iisignature works in Python - to be the fastest.
            – JeremyFR
            22 hours ago

















          • Thanks a lot. Just to let know, why I could not do. I never did the use the parameter 't', so never formed an equation. BIG thanks.
            – Creator
            Aug 15 at 0:00










          • It seems I need to implement only two equations to get the signatures for linear path between points. One is Chen's formula and the is $frac1k!prod_j=1^k(b_i_j-a_i_j)$. I am only interested in speech like signals where one dimension is arithmetic progression (constant sampling period). Is there a shot cut formula for such case?
            – Creator
            Aug 17 at 2:59











          • Implementing those two formulae can be very little code, little hassle and can often run pretty fast - it's linear in the length of the input. In particular cases (e.g. low dimension like you have, low level, very long signals, a language like python or matlab where you want to avoid loops) you may be able to be clever and come up with something which runs faster. By "short cut" do you mean saving coding/testing time or saving run time? What platform/programming language?
            – JeremyFR
            Aug 17 at 11:05










          • By short cut, I mean saving run time and I use MATLAB. My background is signal processing.
            – Creator
            2 days ago










          • I am not very familiar with matlab. I had a go at writing a general signature calculation function for matlab based on these formulae. It is at github.com/bottler/iisignature/blob/master/examples/matlab/… . I suspect it has plenty of room for optimization. It runs instantaneously in the simple examples I tried. For heavy use, I would expect calling out to a compiled library - like the way iisignature works in Python - to be the fastest.
            – JeremyFR
            22 hours ago
















          Thanks a lot. Just to let know, why I could not do. I never did the use the parameter 't', so never formed an equation. BIG thanks.
          – Creator
          Aug 15 at 0:00




          Thanks a lot. Just to let know, why I could not do. I never did the use the parameter 't', so never formed an equation. BIG thanks.
          – Creator
          Aug 15 at 0:00












          It seems I need to implement only two equations to get the signatures for linear path between points. One is Chen's formula and the is $frac1k!prod_j=1^k(b_i_j-a_i_j)$. I am only interested in speech like signals where one dimension is arithmetic progression (constant sampling period). Is there a shot cut formula for such case?
          – Creator
          Aug 17 at 2:59





          It seems I need to implement only two equations to get the signatures for linear path between points. One is Chen's formula and the is $frac1k!prod_j=1^k(b_i_j-a_i_j)$. I am only interested in speech like signals where one dimension is arithmetic progression (constant sampling period). Is there a shot cut formula for such case?
          – Creator
          Aug 17 at 2:59













          Implementing those two formulae can be very little code, little hassle and can often run pretty fast - it's linear in the length of the input. In particular cases (e.g. low dimension like you have, low level, very long signals, a language like python or matlab where you want to avoid loops) you may be able to be clever and come up with something which runs faster. By "short cut" do you mean saving coding/testing time or saving run time? What platform/programming language?
          – JeremyFR
          Aug 17 at 11:05




          Implementing those two formulae can be very little code, little hassle and can often run pretty fast - it's linear in the length of the input. In particular cases (e.g. low dimension like you have, low level, very long signals, a language like python or matlab where you want to avoid loops) you may be able to be clever and come up with something which runs faster. By "short cut" do you mean saving coding/testing time or saving run time? What platform/programming language?
          – JeremyFR
          Aug 17 at 11:05












          By short cut, I mean saving run time and I use MATLAB. My background is signal processing.
          – Creator
          2 days ago




          By short cut, I mean saving run time and I use MATLAB. My background is signal processing.
          – Creator
          2 days ago












          I am not very familiar with matlab. I had a go at writing a general signature calculation function for matlab based on these formulae. It is at github.com/bottler/iisignature/blob/master/examples/matlab/… . I suspect it has plenty of room for optimization. It runs instantaneously in the simple examples I tried. For heavy use, I would expect calling out to a compiled library - like the way iisignature works in Python - to be the fastest.
          – JeremyFR
          22 hours ago





          I am not very familiar with matlab. I had a go at writing a general signature calculation function for matlab based on these formulae. It is at github.com/bottler/iisignature/blob/master/examples/matlab/… . I suspect it has plenty of room for optimization. It runs instantaneously in the simple examples I tried. For heavy use, I would expect calling out to a compiled library - like the way iisignature works in Python - to be the fastest.
          – JeremyFR
          22 hours ago













           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2874431%2fhelp-in-numerical-verification-of-chens-identity-in-rough-path-theory%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What is the equation of a 3D cone with generalised tilt?

          Color the edges and diagonals of a regular polygon

          Relationship between determinant of matrix and determinant of adjoint?