# The plots of co-variance functions should start from 0-shift

The following was my question given by my teacher,

1. Generate a sequence of N = 1000 independent observations of random variable with distribution: (c) Exponential with parameter λ = 1 , by inversion method.
2. Present graphically obtained sequences(except for those generated in point e) i.e. e.g. (a) i. plot in the coordinates (no. obs., value of the obs) ii. plot in the coordinates (obs no n, obs. no n + i) for i = 1, 2, 3. iii. plot so called covariance function for some values. i.e. and averages:

I have written the following code,

(*****************************************************************)
(*****************************************************************)
n = 1000;

ListPlot[taskC, AxesLabel->{"No. obs", "value of the obs"}]

i = 1;
ListPlot[Table[
{k, 1, n-i,1}],
AxesLabel->{"obs.no.n", "obs.no.n+1"}]

i++;
ListPlot[Table[
{k, 1, n-i,1}],
AxesLabel-> {"obs.no.n", "obs.no.n+2"}]

i++;
ListPlot[Table[
{k,1,n-i,1}],
AxesLabel->{"obs.no.n", "obs.no.n+3"}]

Joined->True,
AxesLabel->"Covariance Function"]


He has commented,

The plots of co-variance functions should start from 0-shift. Note that for larger than 0 shifts you are estimating co-variance between independent observations which is zero, while for 0 shift you are estimating variance of observation which is large. Thus the contrast between these two cases is a clear indication that the observations are uncorrelated.

What did I do wrong?

How can I correct my code?

• What explanation did your teacher provide? – wolfies Nov 28 '16 at 14:51
• @wolfies, he just mailed me this small text. And told me that I got 3 out of 5 points. – user44664 Nov 28 '16 at 14:58
• Why not mail him back? Who better to answer the question? – wolfies Nov 28 '16 at 17:00