making rating curves - the bayesian approach

25
Making rating curves - the Bayesian approach

Upload: cole

Post on 30-Jan-2016

27 views

Category:

Documents


0 download

DESCRIPTION

Making rating curves - the Bayesian approach. 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. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Making rating curves  -  the Bayesian approach

Making rating curves - the Bayesian approach

Page 2: Making rating curves  -  the Bayesian approach

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-h0)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.

Page 3: Making rating curves  -  the Bayesian approach

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-h0) 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).

Page 4: Making rating curves  -  the Bayesian approach

The old approach – handling c=-h0

The problem is that the effective bottom level, h0=-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: qi=a+b log(hi+c)+i or Qi=C (hi-h0)b Ei where i ~ N(0,2) is iid noise and Ei= e

i

. This model makes hydraulic and statistical

sense!

Page 5: Making rating curves  -  the Bayesian approach

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!

Page 6: Making rating curves  -  the Bayesian approach

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.

Page 7: Making rating curves  -  the Bayesian approach

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 h0=-c, but we know it will not be far below the stage measurements.

Page 8: Making rating curves  -  the Bayesian approach

Prior knowledge of a and b from the database

Histogram of generated a’sfrom the database. Normal approximation seems ok.

Histogram of generated b’sfrom the database. Normal approximation seems less fine, but is used for practical reasons.

Page 9: Making rating curves  -  the Bayesian approach

Bayesian regression

Data given parameters is the same here; qi=a+b log(hi+c)+i . D={hi, qi}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; qi=a+b xi+i for xi=log(hi+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.

Page 10: Making rating curves  -  the Bayesian approach

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.

Page 11: Making rating curves  -  the Bayesian approach

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.)

Page 12: Making rating curves  -  the Bayesian approach

A new Bayesian regression approach

Using a semi conjugate prior, (a,b)~N2, 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.

Page 13: Making rating curves  -  the Bayesian approach

A graphical overview of the new model

a Va a Vb

a b 2

qi For i in {1,…,number of measurements}

Hyper-parameters:

Parameters:

Measurements: hi

Page 14: Making rating curves  -  the Bayesian approach

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-12

ci

ai,bi i2

Iteration: i-1 i

Page 15: Making rating curves  -  the Bayesian approach

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.

Page 16: Making rating curves  -  the Bayesian approach

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.

Page 17: Making rating curves  -  the Bayesian approach

Example – rating curve with uncertainty:

Page 18: Making rating curves  -  the Bayesian approach

Example – prior to posterior

Prior of b. Posterior of b.

Page 19: Making rating curves  -  the Bayesian approach

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.

Page 20: Making rating curves  -  the Bayesian approach

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?)

Page 21: Making rating curves  -  the Bayesian approach

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.

Page 22: Making rating curves  -  the Bayesian approach

A graphical view of the model and a tool for a hierarchical approach

a Va b Vb

aj bj j2

hj,i qj,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:

parameters:

measurements:

hyper-

Page 23: Making rating curves  -  the Bayesian approach

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=(qi, hi), 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).

iq~

ih~

Page 24: Making rating curves  -  the Bayesian approach

Structural model – a graphical view

q q2

iq~

ih~

a b c

hiqi

2 h

2parameters:

latent variables:

measurements:

q q0 0parameters: b Va b Vb

distribution with or without hyper-parameters

hyper-

Page 25: Making rating curves  -  the Bayesian approach

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.