Numerical differentiation of stochastic function

In this paper we are presenting the derivation of the finite difference approximation of the first derivative of the discrete stochastic function. The set of data was represented with time depending stochastic function of center of gravity dislocation and velocity with constant step size. The stochastic function was obtained from real experimental measurement and was processed with Dynstab (Dynamic Stability) software. Applied forward, backward and central differences algorithms were written in Microsoft Visual C# 2010 programming language as a part of software named Dynstat (Dynamic Statistics). These algorithms were used to calculate the first derivative of the function and error of differentiation. We compared the results of known precise solutions with calculated results. We also confront the results calculated of known generated trigonometric function. With this manner we are evaluated the inaccuracy of the stochastic function numerical differentiation.


INTRODUCTION
Solutions of many technical problems are based on obtaining the differentials of technical functions.The searched differentials of function are often evaluated algebraically where the accuracy of results is guaranteed.If the values technical functions are measured continuously its differentials must be evaluated numerically.In this case the accuracy is not guaranteed.The high instability of differentiating process is the reason for the algebraic evaluation if it's possible.In the specific case the algebraic evaluation is not possible and we have to design an algorithm of numerical solution.Methods of numerical differentiation algorithms are known and published by many authors.(e.g.[1], [2], [4]).In this contribution we deal with the derivation and the application of the finite difference method.This method has three variants namely forward, backward and central differences and they has defined in [1], [12].Practical applications were published with [1], [3], [11].Mathematical solution accuracy depends first of all on the chosen step of differentiation and from the order of approximation polynomial.The next factors are the applied method as well as the chosen numerical data type.When the exact solution is available and is obtained from numerical integration how is defined in [8], feasible solution of the inaccuracy we can get from results comparison.

Finite difference method
The basic method of numerical differentiation (forward, backward, central) are defined in [4].Its derivation we can realize from the initial value problem of the ordinary differentials equations in accordance with [2].This method is the start point for derivation of numerical integration how is described in [6].Let us assume the differential equation in the next form: . ( The solution of this equation is the function y , and its satisfied at certain point values η , hence η . This initial value problem we call as a Cauchy initial value problem.To guarantee the existence of solution is necessary for the Cauchy uniqueness of solution in the area of function continuous substitute with Lipschitz continuous condition.The equation ( 1) rewriting to the form: , where ) , ( y x f is the real vector function and is defined and continuous on the set .If the Lipschitz condition must be satisfied, there have to exist a constant L, which is independent on such that: for all and all vectors .Foremost we have to define the origin of the solving of initial value problem with numerical integration.The goal of the solution is the points calculation, that are the approximations of exact solution points , in points , where step of integration method is or and must have to be satisfied that .If we talking about method with constant step.The numerical integration method is based on the application of the Taylor's series, where the exact solution is approximated with the Taylor's polynomial of the highest order in the form: (3) , as are published in [6], [8], [9].Modifying equation (3) and neglecting the highest degree members we get: The application of the basic equation for differentiating we get: where is the error of numerical differentiation.Substituting in the equation ( 5) with , we get forward-difference method in the form: Changing indexing like that , we get backward-difference method: If we change , where and are symmetrical about , we get , .
Inserting to (5) we got: what is the central-difference formula.If we apply the same manner as defined above and at the deriving process we change the values of for solution as defined in [6] and combining the four equations of Taylor series, we get formulations of highest degrees.There is the fourth degree form: Stochastic data set We obtained the technical functions from the real experimental measurement of which we chose translational acceleration, translational velocity and dislocations of center of gravity moving with respect to the y axis.The methodology of discrete data processing in Dynstab software is described in [8].Statistical processing of the stochastic technical functions is defined in [9].The applied random data set is stationary and ergodic with zero mean value defined in the next form: . The graphs of stochastic functions are depicted on the figure1.

Visual C# algorithm
The relevant parts of algorithm were written in Microsoft Visual C# 2010 and we presented them in the abbreviated form.Non-mathematical parts of the algorithms (controls, forms, etc.) are not included in the list.Declarations of applied variables in the source code are: To define the numeric variables we chose the type Double as defined in [5].

Evaluated results
Results of the numerical differentiation are depicted in figure 2. There is shown the exact solution as well as solution realized with variants of finite-difference method.We generated a sample function and its exact solution in interval for comparison.The step of numerical differentiating of goniometric function was adapted to stochastic data count .Solved step was .The error of numerical differentiating for individual variants we evaluated with the next formula: Results are depicted in figure 3. The percentage expression of the average error is evaluated by: .( 11)

CONCLUSIONS
In this paper we are dealing with the algorithm and the application of numerical differentiation.Applied methods were forward, backward a central a central 4 th degree.Algorithm was written in the Microsoft Visual C# 2010 Professional programing language.The input data set was obtained from experimental measurement and processed with the Dynstab simulation software.Technical function had the stochastic character and was processed with the Dynstab software.For numerical differentiating purpose, we chose the functions of trajectory of center of gravity moving with respect to the axis.The exact solution of differentiation we obtained from simulation program.According to the realized analysis we got the conclusion that the numerical differentiating of stochastic function is very unstable process.For the individual methods we evaluated the percentage average errors as follows.For forward we evaluated the error 19.19 %, for backward we evaluated the error 19.15 %, for central we evaluated the error 19.0 % and for central 4 th degree we evaluated the error 18.7 %.Listed errors include also the error of the method as well as rounding errors.For comparison with generated sample periodical function sin(x) and its numerical differentiation, where we know an exact solution, is the average error 0.675•10 -6 %, what is classified as very high accuracy.In accordance with terms mentioned above, we can conclude that the stochastic characters of technical function have high degree of the participation on the instability and inaccuracy of the numerical differentiation.