You are on page 1of 6

16/7/2009

Stochastic Hydrology
by Jose D. Salas
Colorado State University
For any time series yt , t 1,..., N the mean, variance, and skewness coefficient are
respectively given by:
1 N
(1)
y yt
N t 1

s 2y

1 N
( yt y ) 2

N 1 t 1

(2)

and
N

gy

N ( yt y ) 3
t 1

(3)

( N 1)( N 2) s 3y

The lag-1 autocorrelation coefficient r1 may be determined as


c
r1 1
c0

ck

1
N

N k

( yt k y )( yt y ) ,

(4a)

k 0,1

(4b)

t 1

where N=sample size and k=time lag.


Example 1. Consider the time series of annual streamflows for the Poudre River at Mouth of the
Canyon for the period 1971-1990 (as shown in Table 1, column 2). We would like to calculate
the main stochastic characteristics of the annual flow data.
Table 1 Statistical analysis of the annual streamflows of the Poudre River
1

xt

yt log( xt )

( yt y )

1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981

367,000
238,000
377,000
329,000
278,000
206,000
129,000
330,000
372,000
471,000
193,000

5.56467
5.37658
5.57634
5.51720
5.44404
5.31387
5.11059
5.51851
5.57054
5.67302
5.28556

0.0100
0.0078
0.0125
0.0028
0.0004
0.0228
0.1254
0.0029
0.0112
0.0434
0.0321

yt y

yt 1

yt 1 y

-0.0882
0.1116
0.0525
-0.0207
-0.1509
-0.3541
0.0538
0.1058
0.2083
-0.1792

5.56467
5.37658
5.57634
5.51720
5.44404
5.31387
5.11059
5.51851
5.57054
5.67302

0.09994
-0.08815
0.11161
0.05247
-0.02069
-0.15086
-0.35414
0.05378
0.10581
0.20829

(5)x(7)

-0.00881
-0.00984
0.00586
-0.00109
0.00312
0.05343
-0.01905
0.00569
0.02204
-0.03732

1982
1983
1984
1985
1986
1987
1988
1989
1990

298,000
702,000
440,000
261,000
368,000
169,000
287,000
192,000
268,000

Mean 313,750
Var
S. dev.
Skew

5.47422
5.84634
5.64345
5.41664
5.56585
5.22789
5.45788
5.28330
5.42813
y =5.46473

0.0001
0.1456
0.0319
0.0023
0.0102
0.0561
0.0000
0.0329
0.0013

s 2y =0.02904

c0 =0.0276

128,560

s y =0.1704

1.384

g y =0.018

0.0095
0.3816
0.1787
-0.0481
0.1011
-0.2368
-0.0068
-0.1814
-0.0366

5.28556
5.47422
5.84634
5.64345
5.41664
5.56585
5.22789
5.45788
5.28330

-0.17917
0.00949
0.38161
0.17872
-0.04809
0.10112
-0.23684
-0.00685
-0.18143

-0.00170
0.00362
0.06820
-0.00859
-0.00486
-0.02395
0.00162
0.00124
0.00664

c1 =0.00296

r1 = 0.107

We will use the lag-1 autoregressive or AR(1) model, which is given by


yt y ( yt 1 y ) t

(5)

where t is a random noise term normally distributed with mean zero and variance 2 . This
model assumes that yt 1 is uncorrelated with t . In addition it may be shown that because t is
normally distributed also yt is normal with mean y and variance y2 2 /(1 2 ) . The
parameters of the model may be estimated by using the method of moments. They are:

y y

(6)

r1

(7)

2 (1 r12 ) s 2y

(8)

Substituting the parameters estimates of (6), (7), and (8) into (5) we have

yt y r1 ( yt 1 y ) 1 r12 s y t

(9a)

yt (1 r1 ) y r1 yt 1 1 r12 s y t

(9b)

or

where in this case t is a normal random variable with mean zero and variance one. Thus, to
generate the variable yt one needs to generate the normal random number t . The standard
normal random number t can be found from tables or from numerical algorithms available to
generate standard normal random numbers (e.g. Salas, 1993). Table A2 in the Appendix is an
example, it gives 100 standard normal random numbers. However, one may observe from Eq.
2

(9) that it is also necessary to know the previous value of y, i.e. yt 1 . For example, to generate
the first value y1 Eq.(9b) gives

y1 (1 r1 ) y r1 y0 1 r12 s y 1
which says that in addition to 1 we need to know the initial value y 0 . The initial value y 0
may be taken to be equal to the mean y but in order to remove the effect of such arbitrary initial
condition one should delete the first few generated values (e.g. delete the first 50 generated
values) and use the rest. For example, if we want to generate a sample of 100 values of yt , one
must generate 150 values, drop the first 50 and use the remaining 100 values. We will illustrate
the approach by generating a few values of yt as shown in Example 2 below.
Example 2. We use the data of the annual flows of the Poudre River shown in Table 1 to
illustrate the use of the AR(1) model (13) to generate synthetic annual flows for the Poudre. We
will generate 2 samples of the same length as the length of the historical data.
Firstly, we will build a model in the logarithmic domain because the data analysis in Example 1
showed that the original data were skewed and that the logarithmic transformation was able to
bring the skewness down to nearly zero. Recall from Example 1 that the basic statistics of the
log-transformed flows are: y 5.46473 , s y 0.1704 , and r1 0.107 . To start the generation
we must generate the initial value y 0 . For this purpose we obtain the standard normal random
number 0.662 so that
y0 y s y 0 5.46473 0.1704 0.662 5.57753

For t 1 we will use Eq.(9b) as:

yt (1 0.107) 5.46473 0.107 yt 1 1 0.107 2 0.1704 t


4.88 0.107 yt 1 0.169422 t

(10)

Then values of yt are obtained by successively applying (14). For example, we get
1 0.6306 and 2 0.0213 from Table A2 (column 1) in the Appendix and (10) gives:

y1 4.88 0.107 y0 0.1694221 4.88 0.107 5.57753 0.169422 (0.6306)


5.369957
y2 4.88 0.107 y1 0.169422 2 4.88 0.107 5.369957 0.169422 (0.0213)
5.450975
and so on. Furthermore, since the original flow data xt has been transformed into a normal
variable yt by using the logarithmic transformation, we need to invert the data generated (in the
3

normal domain) back to the original flow domain. Taking the antilog can do this, i.e. xt 10 yt .
Thus, inverting the generated values y1 5.369957 and y2 5.450975 we get:

x1 105.369957 234,399.7 acre-ft and x2 105.450975 282,471.7 acre-ft. The rest of the
example can be seen in Table 2 below where two samples of synthetic streamflows each 20-yr.
long have been generated. Also Fig.1 shows a comparison of the historical and generated time
series of streamflows.
Table 2. Historical and generated annual streamflows based on the AR(1) model
Historical
x(t)
367000
238000
377000
329000
278000
206000
129000
330000
372000
471000
193000
298000
702000
440000
261000
368000
169000
287000
192000
268000
313750.0
128560.4
1.384

Time t
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

noise
0.6620
-0.6306
-0.0213
1.6452
0.0506
-1.4674
0.4670
-1.1579
0.3199
-1.3776
0.6151
0.2303
-0.6650
-0.4935
1.0903
1.4638
-0.5620
-0.5943
0.5204
-1.4251
-1.1603
Mean
S. Dev.
Skew.

Sample 1
y(t)
5.577535
5.369957
5.450975
5.741989
5.502974
5.220201
5.517686
5.274218
5.498542
5.234942
5.544349
5.512265
5.357154
5.369605
5.639265
5.731394
5.398037
5.356901
5.541361
5.231490
5.243193

234399.9
282471.5
552063.0
318400.7
166035.6
329371.4
188026.0
315167.8
171768.1
350226.2
325286.1
227590.5
234210.0
435777.8
538757.8
250056.0
227457.7
347825.0
170408.0
175062.6

5.436825
0.159108
0.375

292018.1
113752.6
1.065

x(t)

Time t
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

noise
-0.0898
-0.4987
1.2471
-0.1379
-1.7221
1.2136
-0.3732
1.1782
1.6405
0.5522
-0.9957
-0.6678
-0.1122
-1.2380
-0.1466
-0.6966
-1.9807
-1.3383
-1.5112
-0.7917
0.3599
Mean
S. Dev.
Skew.

Sample 2
y(t)
5.449428
5.378600
5.666799
5.462981
5.172783
5.639090
5.420160
5.659566
5.763506
5.590251
5.309467
5.334977
5.431837
5.251458
5.417063
5.341607
5.115983
5.200677
5.180444
5.300182
5.508103

239111.3
464300.7
290389.3
148861.8
435602.4
263123.8
456632.0
580104.1
389270.1
203923.4
216260.2
270294.2
178425.9
261253.9
219587.3
130611.9
158736.6
151510.9
199610.0
322182.9

5.407277
0.1848051
0.313

278989.6
124954.2
0.983

x(t)

Streamflows (acre-ft)

900000.0
800000.0
700000.0
600000.0
500000.0
400000.0
300000.0
200000.0
100000.0
0.0

Series1

11

Series2

13

15

Historical

17

19

Time (years)

Fig. 1 Comparison of the historical and generated streamflows of the Poudre River

References
Fernandez, B. and Salas, J.D. 1990, "Gamma-Autoregressive Models for Streamflow
Simulation," ASCE J. Hydr. Eng., 116(11): 1403-1414.
Fiering, M. B. and Jackson, B. B., 1971. "Synthetic Streamflows," Water Resources Monograph
1, American Geophysical Union, Washington DC, 98 p.
Press, W. H., Flannery, B. P., Teukolsky, S. A. and Vetterling, W. V., 1986. "Numerical
Recipes: The Art of Scientific Computing," Cambridge University Press, New York, New York.
Salas, J. D., Delleur, J. W., Yevjevich, V. and Lane, W. L., 1980, Applied Modeling of
Hydrologic Time Series, Water Resources Publications, Littleton, Colorado, 484 p. (2nd Printing
1985, 3rd Printing, 1988)
Salas, J.D., 1993. Analysis and Modeling of Hydrologic Time Series, Chapter 19 in the
McGraw Hill Handbook of Hydrology, D. Maidment, Editor.
Salas, J.D. and Abdelmohsen, M., 1993, "Initialization for Generating Single Site and Multisite
Low Order PARMA Processes," Water Resour. Res., 29(6): 1771-1776.

Appendix
Table A1. 100 uniform (0,1) random numbers generated from Excel using the function
RAND( )
1
0.5776
0.9980
0.6196
0.0269
0.5886
0.9271
0.2776
0.1947
0.0031
0.3875

2
0.9620
0.9699
0.7931
0.7175
0.6413
0.7220
0.1245
0.0496
0.6307
0.5574

3
0.8690
0.0756
0.3485
0.8244
0.2194
0.7573
0.4389
0.6507
0.8268
0.6479

4
0.1441
0.9611
0.7812
0.3873
0.5902
0.6332
0.6791
0.7956
0.1690
0.7214

5
0.9112
0.6317
0.8398
0.1139
0.0805
0.3153
0.6636
0.6245
0.5250
0.7247

6
0.8608
0.2970
0.3035
0.2889
0.5869
0.9320
0.6669
0.7587
0.1223
0.9329

7
0.6723
0.4904
0.1718
0.1597
0.7626
0.3885
0.0511
0.1002
0.5503
0.7930

8
0.4267
0.0689
0.2222
0.5720
0.4104
0.5948
0.3795
0.8611
0.1213
0.3063

9
0.6861
0.3972
0.0249
0.2081
0.4074
0.5899
0.5598
0.9482
0.5425
0.6388

10
0.0313
0.4121
0.6332
0.3985
0.8379
0.6832
0.6085
0.4691
0.4486
0.9909

Table A2. 100 normal (0,1) random numbers generated from Excel using the function
NORMINV(xx,0,1)
1
2
3
4
5
6
7
8
9
10
-0.6306
0.2303 -0.4987 -0.6678
0.5302
0.7389
0.3814
1.8520 -0.8780 -2.4812
-0.0213 -0.6650
1.2471 -0.1122
0.0657
0.3264
0.3520
1.0016
1.3727
0.0309
1.6452 -0.4935 -0.1379 -1.2380
1.8163 -0.4483
0.6907
0.9693 -0.9040
0.3181
0.0506
1.0903 -1.7221 -0.1466
0.8131 -0.1895 -0.3053
1.1474 -0.3690 -0.0140
-1.4674
1.4638
1.2136 -0.6966
0.3363
0.0100 -1.8218
0.3829 -2.4453
0.6115
0.4670 -0.5620 -0.3732 -1.9807
0.0184 -1.0098 -2.3602
0.0931 -1.7642
0.3554
-1.1579 -0.5943
1.1782 -1.3383
1.0491 -0.5665
1.3269
2.2977
0.7552
0.0657
0.3199
0.5204
1.6405 -1.5112
1.6143 -0.2662 -2.0381 -0.7128
1.7282
1.8396
-1.3776 -1.4251
0.5522 -0.7917 -0.1669
1.0685 -0.8598
0.1387
2.1266
1.5235
0.6151 -1.1603 -0.9957
0.3599
0.5682 -0.3109
0.9475 -0.0451
1.7224 -0.0898
Note: the symbol xx in the function NORMINV refers to the location coordinate in the spreadsheet (e.g. A1)

You might also like