next up previous
Next: Curve Fitting (Regression) Up: Data Analysis Previous: Simple Statistical Functions -


More Statistical Functions - Difference

In this section I've shown the use of various difference functions in Matlab. A discussion follows the source code.

% Hint: use ; at end of line to prevent debug'ish output from being printed

load data_for_stat.dat

% Finite Differences
% Simple Difference
A = [9 -2 3 0 1 5 4];
diff(A)                   % Produces difference between successive elements

% Gradient
v = -2:0.2:2
[x,y] = meshgrid(v)
z = x .* exp(-x.^2 - y.^2)
[px,py] = gradient(z,.2,.2)
%contour(v,v,z), hold on, quiver(v,v,px,py), hold off

% Discrete Laplacian -- See discussion for more information
[x,y] = meshgrid(-4:4,-3:3)
U = x.*x+y.*y  
V = 4*del2(U)

First up I've shown the use of the diff() function to do a forward difference computation. If X is a vector, then diff(X) returns a vector, one element shorter than X, of differences between adjacent elements:

\begin{displaymath}Diff(X) = [X(2)-X(1) X(3)-X(2) ... X(n)-X(n-1)] \end{displaymath}


Some typical uses of the diff() function to check for conditions like monotonicity, etc.

Tests Description
diff(x)==0 Test for repeated elements
all(diff(x)>0) Test for monotonicity
all(diff(diff(x))==0) Test for equally spaced vector elements

The function gradient() gives the numerical partial derivatives a matrix which for F(x,y) (2 variables) is equal to:

\begin{displaymath}{\nabla F} = \frac{\partial F}{\partial x} i + \frac{\partial F}{\partial y} j \end{displaymath}

We can decide how many dimensions need to be taken into account when computing this. For example:
FX = gradient(F) where F is a vector: Returns the one-dimensional numerical gradient of F. FX corresponds to $\frac{\partial F}{\partial x}$, the differences in the x (column) direction whereas...

[FX,FY] = gradient(F) where F is a matrix: Returns the x and y components of the two-dimensional numerical gradient. FX corresponds to $\frac{\partial F}{\partial x}$ , the differences in the x (column) direction. FY corresponds to $\frac{\partial F}{\partial Y}$, the differences in the y (row) direction. The spacing between points in each direction is assumed to be one. And so on so forth... For more information refer [1] and [3]

The function del2() computes the discrete laplacian for a given data set. If the matrix U is regarded as a function u(x,y) evaluated at the point on a square grid, then 4 * del2(U) is a finite difference approximation of Laplace's differential operator applied to u, that is:


\begin{displaymath}l = \frac{\nabla^2 u}{4} \end{displaymath}


\begin{displaymath}l = \frac{1}{4} \left(\frac{d^2u}{dx^2} + \frac{d^2u}{dy^2}\right) \end{displaymath}

where in the interior:

\begin{displaymath}l_{ij} = \frac{1}{4}\left(u_{i+1,j} + u_{i-1,j} + u_{i,j+1} + u_{i,j-1}\right) - u_i \end{displaymath}

For functions of more variables than `x' and `y', and more information about the Laplacian operator in different coordinate systems refer [1] and [4].

This is the output you can expect to see when you run the above shown .m file.

>> more_complex_stat

ans =

   -11     5    -3     1     4    -1

v =

  Columns 1 through 7 

   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000

  Columns 8 through 14 

   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000

  Columns 15 through 21 

    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000

x =

  Columns 1 through 7 

   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000
   -2.0000   -1.8000   -1.6000   -1.4000   -1.2000   -1.0000   -0.8000

  Columns 8 through 14 

   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000
   -0.6000   -0.4000   -0.2000         0    0.2000    0.4000    0.6000

  Columns 15 through 21 

    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000
    0.8000    1.0000    1.2000    1.4000    1.6000    1.8000    2.0000

y =

  Columns 1 through 7 

   -2.0000   -2.0000   -2.0000   -2.0000   -2.0000   -2.0000   -2.0000
   -1.8000   -1.8000   -1.8000   -1.8000   -1.8000   -1.8000   -1.8000
   -1.6000   -1.6000   -1.6000   -1.6000   -1.6000   -1.6000   -1.6000
   -1.4000   -1.4000   -1.4000   -1.4000   -1.4000   -1.4000   -1.4000
   -1.2000   -1.2000   -1.2000   -1.2000   -1.2000   -1.2000   -1.2000
   -1.0000   -1.0000   -1.0000   -1.0000   -1.0000   -1.0000   -1.0000
   -0.8000   -0.8000   -0.8000   -0.8000   -0.8000   -0.8000   -0.8000
   -0.6000   -0.6000   -0.6000   -0.6000   -0.6000   -0.6000   -0.6000
   -0.4000   -0.4000   -0.4000   -0.4000   -0.4000   -0.4000   -0.4000
   -0.2000   -0.2000   -0.2000   -0.2000   -0.2000   -0.2000   -0.2000
         0         0         0         0         0         0         0
    0.2000    0.2000    0.2000    0.2000    0.2000    0.2000    0.2000
    0.4000    0.4000    0.4000    0.4000    0.4000    0.4000    0.4000
    0.6000    0.6000    0.6000    0.6000    0.6000    0.6000    0.6000
    0.8000    0.8000    0.8000    0.8000    0.8000    0.8000    0.8000
    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000
    1.2000    1.2000    1.2000    1.2000    1.2000    1.2000    1.2000
    1.4000    1.4000    1.4000    1.4000    1.4000    1.4000    1.4000
    1.6000    1.6000    1.6000    1.6000    1.6000    1.6000    1.6000
    1.8000    1.8000    1.8000    1.8000    1.8000    1.8000    1.8000
    2.0000    2.0000    2.0000    2.0000    2.0000    2.0000    2.0000

  Columns 8 through 14 

   -2.0000   -2.0000   -2.0000   -2.0000   -2.0000   -2.0000   -2.0000
   -1.8000   -1.8000   -1.8000   -1.8000   -1.8000   -1.8000   -1.8000
   -1.6000   -1.6000   -1.6000   -1.6000   -1.6000   -1.6000   -1.6000
   -1.4000   -1.4000   -1.4000   -1.4000   -1.4000   -1.4000   -1.4000
   -1.2000   -1.2000   -1.2000   -1.2000   -1.2000   -1.2000   -1.2000
   -1.0000   -1.0000   -1.0000   -1.0000   -1.0000   -1.0000   -1.0000
   -0.8000   -0.8000   -0.8000   -0.8000   -0.8000   -0.8000   -0.8000
   -0.6000   -0.6000   -0.6000   -0.6000   -0.6000   -0.6000   -0.6000
   -0.4000   -0.4000   -0.4000   -0.4000   -0.4000   -0.4000   -0.4000
   -0.2000   -0.2000   -0.2000   -0.2000   -0.2000   -0.2000   -0.2000
         0         0         0         0         0         0         0
    0.2000    0.2000    0.2000    0.2000    0.2000    0.2000    0.2000
    0.4000    0.4000    0.4000    0.4000    0.4000    0.4000    0.4000
    0.6000    0.6000    0.6000    0.6000    0.6000    0.6000    0.6000
    0.8000    0.8000    0.8000    0.8000    0.8000    0.8000    0.8000
    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000
    1.2000    1.2000    1.2000    1.2000    1.2000    1.2000    1.2000
    1.4000    1.4000    1.4000    1.4000    1.4000    1.4000    1.4000
    1.6000    1.6000    1.6000    1.6000    1.6000    1.6000    1.6000
    1.8000    1.8000    1.8000    1.8000    1.8000    1.8000    1.8000
    2.0000    2.0000    2.0000    2.0000    2.0000    2.0000    2.0000

  Columns 15 through 21 

   -2.0000   -2.0000   -2.0000   -2.0000   -2.0000   -2.0000   -2.0000
   -1.8000   -1.8000   -1.8000   -1.8000   -1.8000   -1.8000   -1.8000
   -1.6000   -1.6000   -1.6000   -1.6000   -1.6000   -1.6000   -1.6000
   -1.4000   -1.4000   -1.4000   -1.4000   -1.4000   -1.4000   -1.4000
   -1.2000   -1.2000   -1.2000   -1.2000   -1.2000   -1.2000   -1.2000
   -1.0000   -1.0000   -1.0000   -1.0000   -1.0000   -1.0000   -1.0000
   -0.8000   -0.8000   -0.8000   -0.8000   -0.8000   -0.8000   -0.8000
   -0.6000   -0.6000   -0.6000   -0.6000   -0.6000   -0.6000   -0.6000
   -0.4000   -0.4000   -0.4000   -0.4000   -0.4000   -0.4000   -0.4000
   -0.2000   -0.2000   -0.2000   -0.2000   -0.2000   -0.2000   -0.2000
         0         0         0         0         0         0         0
    0.2000    0.2000    0.2000    0.2000    0.2000    0.2000    0.2000
    0.4000    0.4000    0.4000    0.4000    0.4000    0.4000    0.4000
    0.6000    0.6000    0.6000    0.6000    0.6000    0.6000    0.6000
    0.8000    0.8000    0.8000    0.8000    0.8000    0.8000    0.8000
    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000
    1.2000    1.2000    1.2000    1.2000    1.2000    1.2000    1.2000
    1.4000    1.4000    1.4000    1.4000    1.4000    1.4000    1.4000
    1.6000    1.6000    1.6000    1.6000    1.6000    1.6000    1.6000
    1.8000    1.8000    1.8000    1.8000    1.8000    1.8000    1.8000
    2.0000    2.0000    2.0000    2.0000    2.0000    2.0000    2.0000

z =

  Columns 1 through 7 

   -0.0007   -0.0013   -0.0023   -0.0036   -0.0052   -0.0067   -0.0077
   -0.0014   -0.0028   -0.0048   -0.0077   -0.0111   -0.0144   -0.0165
   -0.0028   -0.0054   -0.0096   -0.0152   -0.0220   -0.0284   -0.0326
   -0.0052   -0.0099   -0.0174   -0.0278   -0.0400   -0.0518   -0.0594
   -0.0087   -0.0167   -0.0293   -0.0467   -0.0674   -0.0872   -0.0999
   -0.0135   -0.0259   -0.0455   -0.0725   -0.1046   -0.1353   -0.1552
   -0.0193   -0.0372   -0.0652   -0.1040   -0.1499   -0.1940   -0.2224
   -0.0256   -0.0492   -0.0863   -0.1376   -0.1984   -0.2567   -0.2943
   -0.0312   -0.0601   -0.1054   -0.1680   -0.2423   -0.3135   -0.3595
   -0.0352   -0.0677   -0.1188   -0.1895   -0.2732   -0.3535   -0.4053
   -0.0366   -0.0705   -0.1237   -0.1972   -0.2843   -0.3679   -0.4218
   -0.0352   -0.0677   -0.1188   -0.1895   -0.2732   -0.3535   -0.4053
   -0.0312   -0.0601   -0.1054   -0.1680   -0.2423   -0.3135   -0.3595
   -0.0256   -0.0492   -0.0863   -0.1376   -0.1984   -0.2567   -0.2943
   -0.0193   -0.0372   -0.0652   -0.1040   -0.1499   -0.1940   -0.2224
   -0.0135   -0.0259   -0.0455   -0.0725   -0.1046   -0.1353   -0.1552
   -0.0087   -0.0167   -0.0293   -0.0467   -0.0674   -0.0872   -0.0999
   -0.0052   -0.0099   -0.0174   -0.0278   -0.0400   -0.0518   -0.0594
   -0.0028   -0.0054   -0.0096   -0.0152   -0.0220   -0.0284   -0.0326
   -0.0014   -0.0028   -0.0048   -0.0077   -0.0111   -0.0144   -0.0165
   -0.0007   -0.0013   -0.0023   -0.0036   -0.0052   -0.0067   -0.0077

  Columns 8 through 14 

   -0.0077   -0.0062   -0.0035         0    0.0035    0.0062    0.0077
   -0.0164   -0.0133   -0.0075         0    0.0075    0.0133    0.0164
   -0.0324   -0.0263   -0.0149         0    0.0149    0.0263    0.0324
   -0.0590   -0.0480   -0.0271         0    0.0271    0.0480    0.0590
   -0.0992   -0.0808   -0.0455         0    0.0455    0.0808    0.0992
   -0.1540   -0.1254   -0.0707         0    0.0707    0.1254    0.1540
   -0.2207   -0.1797   -0.1013         0    0.1013    0.1797    0.2207
   -0.2921   -0.2378   -0.1341         0    0.1341    0.2378    0.2921
   -0.3567   -0.2905   -0.1637         0    0.1637    0.2905    0.3567
   -0.4022   -0.3275   -0.1846         0    0.1846    0.3275    0.4022
   -0.4186   -0.3409   -0.1922         0    0.1922    0.3409    0.4186
   -0.4022   -0.3275   -0.1846         0    0.1846    0.3275    0.4022
   -0.3567   -0.2905   -0.1637         0    0.1637    0.2905    0.3567
   -0.2921   -0.2378   -0.1341         0    0.1341    0.2378    0.2921
   -0.2207   -0.1797   -0.1013         0    0.1013    0.1797    0.2207
   -0.1540   -0.1254   -0.0707         0    0.0707    0.1254    0.1540
   -0.0992   -0.0808   -0.0455         0    0.0455    0.0808    0.0992
   -0.0590   -0.0480   -0.0271         0    0.0271    0.0480    0.0590
   -0.0324   -0.0263   -0.0149         0    0.0149    0.0263    0.0324
   -0.0164   -0.0133   -0.0075         0    0.0075    0.0133    0.0164
   -0.0077   -0.0062   -0.0035         0    0.0035    0.0062    0.0077

  Columns 15 through 21 

    0.0077    0.0067    0.0052    0.0036    0.0023    0.0013    0.0007
    0.0165    0.0144    0.0111    0.0077    0.0048    0.0028    0.0014
    0.0326    0.0284    0.0220    0.0152    0.0096    0.0054    0.0028
    0.0594    0.0518    0.0400    0.0278    0.0174    0.0099    0.0052
    0.0999    0.0872    0.0674    0.0467    0.0293    0.0167    0.0087
    0.1552    0.1353    0.1046    0.0725    0.0455    0.0259    0.0135
    0.2224    0.1940    0.1499    0.1040    0.0652    0.0372    0.0193
    0.2943    0.2567    0.1984    0.1376    0.0863    0.0492    0.0256
    0.3595    0.3135    0.2423    0.1680    0.1054    0.0601    0.0312
    0.4053    0.3535    0.2732    0.1895    0.1188    0.0677    0.0352
    0.4218    0.3679    0.2843    0.1972    0.1237    0.0705    0.0366
    0.4053    0.3535    0.2732    0.1895    0.1188    0.0677    0.0352
    0.3595    0.3135    0.2423    0.1680    0.1054    0.0601    0.0312
    0.2943    0.2567    0.1984    0.1376    0.0863    0.0492    0.0256
    0.2224    0.1940    0.1499    0.1040    0.0652    0.0372    0.0193
    0.1552    0.1353    0.1046    0.0725    0.0455    0.0259    0.0135
    0.0999    0.0872    0.0674    0.0467    0.0293    0.0167    0.0087
    0.0594    0.0518    0.0400    0.0278    0.0174    0.0099    0.0052
    0.0326    0.0284    0.0220    0.0152    0.0096    0.0054    0.0028
    0.0165    0.0144    0.0111    0.0077    0.0048    0.0028    0.0014
    0.0077    0.0067    0.0052    0.0036    0.0023    0.0013    0.0007

px =

  Columns 1 through 7 

   -0.0031   -0.0040   -0.0058   -0.0074   -0.0078   -0.0063   -0.0023
   -0.0066   -0.0085   -0.0124   -0.0157   -0.0167   -0.0135   -0.0050
   -0.0131   -0.0168   -0.0245   -0.0310   -0.0330   -0.0266   -0.0098
   -0.0238   -0.0307   -0.0446   -0.0566   -0.0601   -0.0484   -0.0179
   -0.0401   -0.0516   -0.0751   -0.0951   -0.1011   -0.0815   -0.0300
   -0.0623   -0.0801   -0.1165   -0.1477   -0.1570   -0.1265   -0.0467
   -0.0893   -0.1148   -0.1670   -0.2117   -0.2250   -0.1813   -0.0669
   -0.1181   -0.1518   -0.2210   -0.2802   -0.2977   -0.2399   -0.0885
   -0.1443   -0.1855   -0.2699   -0.3422   -0.3636   -0.2930   -0.1081
   -0.1627   -0.2091   -0.3043   -0.3858   -0.4100   -0.3303   -0.1218
   -0.1693   -0.2176   -0.3168   -0.4016   -0.4267   -0.3438   -0.1268
   -0.1627   -0.2091   -0.3043   -0.3858   -0.4100   -0.3303   -0.1218
   -0.1443   -0.1855   -0.2699   -0.3422   -0.3636   -0.2930   -0.1081
   -0.1181   -0.1518   -0.2210   -0.2802   -0.2977   -0.2399   -0.0885
   -0.0893   -0.1148   -0.1670   -0.2117   -0.2250   -0.1813   -0.0669
   -0.0623   -0.0801   -0.1165   -0.1477   -0.1570   -0.1265   -0.0467
   -0.0401   -0.0516   -0.0751   -0.0951   -0.1011   -0.0815   -0.0300
   -0.0238   -0.0307   -0.0446   -0.0566   -0.0601   -0.0484   -0.0179
   -0.0131   -0.0168   -0.0245   -0.0310   -0.0330   -0.0266   -0.0098
   -0.0066   -0.0085   -0.0124   -0.0157   -0.0167   -0.0135   -0.0050
   -0.0031   -0.0040   -0.0058   -0.0074   -0.0078   -0.0063   -0.0023

  Columns 8 through 14 

    0.0037    0.0104    0.0156    0.0176    0.0156    0.0104    0.0037
    0.0079    0.0222    0.0334    0.0376    0.0334    0.0222    0.0079
    0.0156    0.0438    0.0659    0.0743    0.0659    0.0438    0.0156
    0.0285    0.0797    0.1200    0.1353    0.1200    0.0797    0.0285
    0.0480    0.1341    0.2019    0.2276    0.2019    0.1341    0.0480
    0.0745    0.2083    0.3135    0.3535    0.3135    0.2083    0.0745
    0.1067    0.2985    0.4493    0.5066    0.4493    0.2985    0.1067
    0.1412    0.3950    0.5945    0.6703    0.5945    0.3950    0.1412
    0.1725    0.4824    0.7261    0.8187    0.7261    0.4824    0.1725
    0.1945    0.5439    0.8187    0.9231    0.8187    0.5439    0.1945
    0.2024    0.5661    0.8521    0.9608    0.8521    0.5661    0.2024
    0.1945    0.5439    0.8187    0.9231    0.8187    0.5439    0.1945
    0.1725    0.4824    0.7261    0.8187    0.7261    0.4824    0.1725
    0.1412    0.3950    0.5945    0.6703    0.5945    0.3950    0.1412
    0.1067    0.2985    0.4493    0.5066    0.4493    0.2985    0.1067
    0.0745    0.2083    0.3135    0.3535    0.3135    0.2083    0.0745
    0.0480    0.1341    0.2019    0.2276    0.2019    0.1341    0.0480
    0.0285    0.0797    0.1200    0.1353    0.1200    0.0797    0.0285
    0.0156    0.0438    0.0659    0.0743    0.0659    0.0438    0.0156
    0.0079    0.0222    0.0334    0.0376    0.0334    0.0222    0.0079
    0.0037    0.0104    0.0156    0.0176    0.0156    0.0104    0.0037

  Columns 15 through 21 

   -0.0023   -0.0063   -0.0078   -0.0074   -0.0058   -0.0040   -0.0031
   -0.0050   -0.0135   -0.0167   -0.0157   -0.0124   -0.0085   -0.0066
   -0.0098   -0.0266   -0.0330   -0.0310   -0.0245   -0.0168   -0.0131
   -0.0179   -0.0484   -0.0601   -0.0566   -0.0446   -0.0307   -0.0238
   -0.0300   -0.0815   -0.1011   -0.0951   -0.0751   -0.0516   -0.0401
   -0.0467   -0.1265   -0.1570   -0.1477   -0.1165   -0.0801   -0.0623
   -0.0669   -0.1813   -0.2250   -0.2117   -0.1670   -0.1148   -0.0893
   -0.0885   -0.2399   -0.2977   -0.2802   -0.2210   -0.1518   -0.1181
   -0.1081   -0.2930   -0.3636   -0.3422   -0.2699   -0.1855   -0.1443
   -0.1218   -0.3303   -0.4100   -0.3858   -0.3043   -0.2091   -0.1627
   -0.1268   -0.3438   -0.4267   -0.4016   -0.3168   -0.2176   -0.1693
   -0.1218   -0.3303   -0.4100   -0.3858   -0.3043   -0.2091   -0.1627
   -0.1081   -0.2930   -0.3636   -0.3422   -0.2699   -0.1855   -0.1443
   -0.0885   -0.2399   -0.2977   -0.2802   -0.2210   -0.1518   -0.1181
   -0.0669   -0.1813   -0.2250   -0.2117   -0.1670   -0.1148   -0.0893
   -0.0467   -0.1265   -0.1570   -0.1477   -0.1165   -0.0801   -0.0623
   -0.0300   -0.0815   -0.1011   -0.0951   -0.0751   -0.0516   -0.0401
   -0.0179   -0.0484   -0.0601   -0.0566   -0.0446   -0.0307   -0.0238
   -0.0098   -0.0266   -0.0330   -0.0310   -0.0245   -0.0168   -0.0131
   -0.0050   -0.0135   -0.0167   -0.0157   -0.0124   -0.0085   -0.0066
   -0.0023   -0.0063   -0.0078   -0.0074   -0.0058   -0.0040   -0.0031

py =

  Columns 1 through 7 

   -0.0038   -0.0073   -0.0129   -0.0206   -0.0296   -0.0383   -0.0440
   -0.0054   -0.0104   -0.0182   -0.0291   -0.0419   -0.0543   -0.0622
   -0.0093   -0.0179   -0.0314   -0.0501   -0.0723   -0.0935   -0.1072
   -0.0146   -0.0281   -0.0494   -0.0787   -0.1135   -0.1468   -0.1683
   -0.0208   -0.0400   -0.0702   -0.1119   -0.1614   -0.2088   -0.2394
   -0.0266   -0.0512   -0.0898   -0.1432   -0.2064   -0.2670   -0.3062
   -0.0302   -0.0581   -0.1020   -0.1626   -0.2344   -0.3033   -0.3478
   -0.0297   -0.0573   -0.1005   -0.1602   -0.2309   -0.2988   -0.3426
   -0.0241   -0.0464   -0.0814   -0.1297   -0.1870   -0.2420   -0.2775
   -0.0135   -0.0261   -0.0457   -0.0729   -0.1051   -0.1360   -0.1559
         0         0         0         0         0         0         0
    0.0135    0.0261    0.0457    0.0729    0.1051    0.1360    0.1559
    0.0241    0.0464    0.0814    0.1297    0.1870    0.2420    0.2775
    0.0297    0.0573    0.1005    0.1602    0.2309    0.2988    0.3426
    0.0302    0.0581    0.1020    0.1626    0.2344    0.3033    0.3478
    0.0266    0.0512    0.0898    0.1432    0.2064    0.2670    0.3062
    0.0208    0.0400    0.0702    0.1119    0.1614    0.2088    0.2394
    0.0146    0.0281    0.0494    0.0787    0.1135    0.1468    0.1683
    0.0093    0.0179    0.0314    0.0501    0.0723    0.0935    0.1072
    0.0054    0.0104    0.0182    0.0291    0.0419    0.0543    0.0622
    0.0038    0.0073    0.0129    0.0206    0.0296    0.0383    0.0440

  Columns 8 through 14 

   -0.0436   -0.0355   -0.0200         0    0.0200    0.0355    0.0436
   -0.0617   -0.0503   -0.0283         0    0.0283    0.0503    0.0617
   -0.1064   -0.0867   -0.0489         0    0.0489    0.0867    0.1064
   -0.1670   -0.1360   -0.0767         0    0.0767    0.1360    0.1670
   -0.2376   -0.1935   -0.1091         0    0.1091    0.1935    0.2376
   -0.3039   -0.2474   -0.1395         0    0.1395    0.2474    0.3039
   -0.3451   -0.2810   -0.1584         0    0.1584    0.2810    0.3451
   -0.3400   -0.2768   -0.1561         0    0.1561    0.2768    0.3400
   -0.2754   -0.2242   -0.1264         0    0.1264    0.2242    0.2754
   -0.1547   -0.1260   -0.0710         0    0.0710    0.1260    0.1547
         0         0         0         0         0         0         0
    0.1547    0.1260    0.0710         0   -0.0710   -0.1260   -0.1547
    0.2754    0.2242    0.1264         0   -0.1264   -0.2242   -0.2754
    0.3400    0.2768    0.1561         0   -0.1561   -0.2768   -0.3400
    0.3451    0.2810    0.1584         0   -0.1584   -0.2810   -0.3451
    0.3039    0.2474    0.1395         0   -0.1395   -0.2474   -0.3039
    0.2376    0.1935    0.1091         0   -0.1091   -0.1935   -0.2376
    0.1670    0.1360    0.0767         0   -0.0767   -0.1360   -0.1670
    0.1064    0.0867    0.0489         0   -0.0489   -0.0867   -0.1064
    0.0617    0.0503    0.0283         0   -0.0283   -0.0503   -0.0617
    0.0436    0.0355    0.0200         0   -0.0200   -0.0355   -0.0436

  Columns 15 through 21 

    0.0440    0.0383    0.0296    0.0206    0.0129    0.0073    0.0038
    0.0622    0.0543    0.0419    0.0291    0.0182    0.0104    0.0054
    0.1072    0.0935    0.0723    0.0501    0.0314    0.0179    0.0093
    0.1683    0.1468    0.1135    0.0787    0.0494    0.0281    0.0146
    0.2394    0.2088    0.1614    0.1119    0.0702    0.0400    0.0208
    0.3062    0.2670    0.2064    0.1432    0.0898    0.0512    0.0266
    0.3478    0.3033    0.2344    0.1626    0.1020    0.0581    0.0302
    0.3426    0.2988    0.2309    0.1602    0.1005    0.0573    0.0297
    0.2775    0.2420    0.1870    0.1297    0.0814    0.0464    0.0241
    0.1559    0.1360    0.1051    0.0729    0.0457    0.0261    0.0135
         0         0         0         0         0         0         0
   -0.1559   -0.1360   -0.1051   -0.0729   -0.0457   -0.0261   -0.0135
   -0.2775   -0.2420   -0.1870   -0.1297   -0.0814   -0.0464   -0.0241
   -0.3426   -0.2988   -0.2309   -0.1602   -0.1005   -0.0573   -0.0297
   -0.3478   -0.3033   -0.2344   -0.1626   -0.1020   -0.0581   -0.0302
   -0.3062   -0.2670   -0.2064   -0.1432   -0.0898   -0.0512   -0.0266
   -0.2394   -0.2088   -0.1614   -0.1119   -0.0702   -0.0400   -0.0208
   -0.1683   -0.1468   -0.1135   -0.0787   -0.0494   -0.0281   -0.0146
   -0.1072   -0.0935   -0.0723   -0.0501   -0.0314   -0.0179   -0.0093
   -0.0622   -0.0543   -0.0419   -0.0291   -0.0182   -0.0104   -0.0054
   -0.0440   -0.0383   -0.0296   -0.0206   -0.0129   -0.0073   -0.0038

x =

    -4    -3    -2    -1     0     1     2     3     4
    -4    -3    -2    -1     0     1     2     3     4
    -4    -3    -2    -1     0     1     2     3     4
    -4    -3    -2    -1     0     1     2     3     4
    -4    -3    -2    -1     0     1     2     3     4
    -4    -3    -2    -1     0     1     2     3     4
    -4    -3    -2    -1     0     1     2     3     4

y =

    -3    -3    -3    -3    -3    -3    -3    -3    -3
    -2    -2    -2    -2    -2    -2    -2    -2    -2
    -1    -1    -1    -1    -1    -1    -1    -1    -1
     0     0     0     0     0     0     0     0     0
     1     1     1     1     1     1     1     1     1
     2     2     2     2     2     2     2     2     2
     3     3     3     3     3     3     3     3     3

U =

    25    18    13    10     9    10    13    18    25
    20    13     8     5     4     5     8    13    20
    17    10     5     2     1     2     5    10    17
    16     9     4     1     0     1     4     9    16
    17    10     5     2     1     2     5    10    17
    20    13     8     5     4     5     8    13    20
    25    18    13    10     9    10    13    18    25

V =

     4     4     4     4     4     4     4     4     4
     4     4     4     4     4     4     4     4     4
     4     4     4     4     4     4     4     4     4
     4     4     4     4     4     4     4     4     4
     4     4     4     4     4     4     4     4     4
     4     4     4     4     4     4     4     4     4
     4     4     4     4     4     4     4     4     4


next up previous
Next: Curve Fitting (Regression) Up: Data Analysis Previous: Simple Statistical Functions -
Arvind Gopu 2006-03-24