Presentation is loading. Please wait.

Presentation is loading. Please wait.

Making rating curves - the Bayesian approach. Rating curves – what is wanted? A best estimate of the relationship between stage and discharge at a given.

Similar presentations


Presentation on theme: "Making rating curves - the Bayesian approach. Rating curves – what is wanted? A best estimate of the relationship between stage and discharge at a given."— Presentation transcript:

1 Making rating curves - the Bayesian approach

2 Rating curves – what is wanted? A best estimate of the relationship between stage and discharge at a given place in a river. The relationship should be on the form Q=C(h-h 0 ) b or a segmented version of that. Q=discharge, h=stage. It should be possible to deal with the uncertainty in such estimates. There should also be other statistical measures of the quality of such a curve. These measures should be easy to interpret by non-statisticians.

3 Making rating curves the old fashioned way For a known zero-stage, the rating curve can be written as q=a+bx, where q=log(Q), x=log(h-h 0 ) and a=log(C). For a set of measurements, one can then do linear regression with q as response, x as covariate and a and b as unknown linear parameters. Minimize SS analytically (standard linear regression).

4 The old approach – handling c=-h 0 The problem is that the effective bottom level, h 0 =-c, is not known. Solution: Minimize SS by stepping through all possible values of c. The advantage: This is the same as maximizing the likelihood for the regression problem: q i =a+b log(h i +c)+  i or Q i =C (h i -h 0 ) b E i where  i ~ N(0,  2 ) is iid noise and E i = e  i. This model makes hydraulic and statistical sense!

5 Problems with the old approach We have prior information about curves that we would like to use in the estimation. Inference and statistical quality measures are difficult to interpret. Difficult to get a grip on the discharge estimate uncertainty. There is a chance that one gets infinite parameter estimates using this method!

6 Bayesian statistics Frequentistic: treats the parameters as fixed and finds estimators that will catch their values approximately. Bayesian: treats the parameters as having a stochastic distribution which is derived from the observations and to prior knowledge. Bayes’ theorem: f(  | D) = f( D |  )f(  )/f(D) where f stands for a distribution, D is the data set and  is the parameter set.

7 Prior knowledge Prior info about a and b can be obtained from already generated rating curves (using the frequentistic approach) or by hydraulic principles. Prior info about the noise can be obtained from knowledge about the measurements. Problem: Difficult to set the prior for the location parameter h 0 =-c, but we know it will not be far below the stage measurements.

8 Prior knowledge of a and b from the database Histogram of generated a’s from the database. Normal approximation seems ok. Histogram of generated b’s from the database. Normal approximation seems less fine, but is used for practical reasons.

9 Bayesian regression Data given parameters is the same here; q i =a+b log(h i +c)+  i. D={h i, q i } i=1…n Problem; even though we have prior info, this does not give us the form of the prior f(  ),  =(a,b,c,  2 ). If the priors are on a certain form, one can do Bayesian linear regression analytically; q i =a+b x i +  i for x i =log(h i +c) for a given c. Same thought as for the frequentistic approach, handle a,b and  2 using a linear model, and handle c using discretization.

10 Problems with Bayesian regression While this gives us the form of f(a,b,  2 ), it does not give us the form of f(c). We know that the stage levels are not too far above the zero-level. We’d like to code this prior info but we don’t want to use the stage measurement (using them both in the prior and the likelihood). Jeffrey’s priors containing the covariates is a general problem with the Bayesian regression approach! Ok, if you really are in a regression setting, but this is not the case here.

11 Problems with the first Bayesian approach The form that makes the linear regression analytical is rather strange. It requires the form of the prior for  2 which influences the priors for (a,b). However, prior info about these two would be better kept separate. Difficult to set the prior info for users. Expected discharge is infinite in this approach! (Median will be finite.)

12 A new Bayesian regression approach Using a semi conjugate prior, (a,b)~N 2, independent of  2 ~IG, we separate prior knowledge about a,b and  2. We can no longer handle (a,b,  2 ) analytically for known c. However, (a,b,c,  2 ) can be sampled using MCMC methods. The sampling method must be effective, since users do not want to wait to long for the results.

13 A graphical overview of the new model a Va  a Vb a Va  a Vb  a b 22   qiqi For i in {1,…,number of measurements} Hyper-parameters: Parameters: Measurements: hihi

14 Sampling methods and efficiency Naïve MCMC: The Metropolis algorithm. Problem: (a,b,c) are extremely mutually dependent. Metropolis or independence-sampler for c, Gibbs sampling for (a,b,  2 ). Dependency of (a,b,c) makes trouble here, too. Solution: Sample (a,b,c,  2 ) together and then do a Metropolis-Hastings accepting. Sample c using first adaptive Metropolis, then indep. sampler. Sample (a,b,  2 ) given c and previous  2 using Gibbs-like sampling. Then accept/reject all four.  i-1 2 cici a i,b i i2i2 Iteration: i-1 i

15 Estimation based on simulations We can estimate parameters using the sampled parameters by either taking the mean or the median. We can estimate the discharge for a given stage value, either by mean or median discharge from the sampled parameters or by discharge from the mean or median parameters. Simulations show that median is better than mean.

16 Inference based on simulations Uncertainty in the parameters can be established by looking at the variance of sampled parameters. Credibility intervals can be arrived at from the quantiles of the parameters. Discharge uncertainty and credibility intervals can be obtained by a similar approach to the discharge for the drawn parameters.

17 Example – rating curve with uncertainty:

18 Example – prior to posterior Prior of b.Posterior of b.

19 Example - diagnostic plots Scatter plot of simultaneous samples from a and b. Note the extreme correlation between the parameters. Residuals. Note the “trumpet” form. There is heteroscedasticy here, which the model does not catch.

20 What has been achieved Discharge estimates with lower RMSE than frequentistic estimates. Measures of estimation uncertainty that are easy to interpret. Hopefully, quality measures should be less difficult to understand. The distribution of parameters can be used for decision problems. (Should we do more measurements?)

21 What remains Multiple segmentation. Need to find good quality measures in addition to estimation uncertainty. Possibility: Calculate the posterior probability of more advanced models. Learning about the priors: A hierarchical approach. There is still some prior knowledge that has not found it’s way into the model; namely distance between zero- stage and stage measurements. Heteroscedasticy ought to be removed. Should have a prior on b that closer reflects both prior knowledge (positive b) and the database collection of estimates. For example: b~logN. But this introduces problems with efficiency.

22 A graphical view of the model and a tool for a hierarchical approach  a V a   b V b a j b j j2j2   h j,i q j,i For j in {1,…,number of stations} For i in {1,…,number of measurements for station j} distribution with or without hyper-parameters parameters: measurements: hyper-

23 Solution to the prior for h+c Possible to go from a regression situation to a model that has both stochastic discharge and stage values. Possibility: A structural model where real discharge,, has a distribution. The real stage,, is a deterministic function of the curve parameters, (a, b, c). Observations, D=(q i, h i ), are the real values plus noise. The model gives a more realistic description of what happens in the real world. It also codes the prior knowledge about the difference between stage measurements and zero-stage, through the distribution of q and the distribution of (a, b).

24 Structural model – a graphical view  q  q 2 a b c hihi qiqi 22 h2h2 parameters: latent variables: measurements:          q  q  0  0 parameters:  b V a   b V b distribution with or without hyper-parameters hyper-

25 Advantage and problems of a structural model Advantage: More realistic modelling of the measurements and the underlying structure. Codes prior knowledge about the relationship between stage measurements and the zero-stage. Can solve heteroscedasticy. Gives a more detailed picture of how measurement errors occur. Since b can not be sampled using Gibbs, we might as well use a form that insures positive exponent. Problem: Difficult to make an efficient algorithm. More complex. Thus even if it codes more prior knowledge, the estimates might be more uncertain. This has not been tested.


Download ppt "Making rating curves - the Bayesian approach. Rating curves – what is wanted? A best estimate of the relationship between stage and discharge at a given."

Similar presentations


Ads by Google