Theory

Decline Curve Statistics

Decline curve statistics quantify how well a forecast model matches observed production data. These objective functions are essential for:

  • Comparing multiple decline models to select the best fit
  • Validating curve-fitting results
  • Identifying periods where model assumptions break down

Sum of Squared Errors (SSE)

Theory

The Sum of Squared Errors measures the total squared deviation between observed and predicted values:

SSE=i=1n(qpredicted,iqobserved,i)2SSE = \sum_{i=1}^{n} (q_{predicted,i} - q_{observed,i})^2
PropertyValue
Range0 to ∞
Best value0 (perfect fit)
Units(rate units)²

Interpretation

SSEInterpretation
0Perfect fit (rare with real data)
LowGood model match
HighPoor fit or wrong model type

!!! warning "Scale Sensitivity" SSE is sensitive to the scale of the data. A well producing 10,000 bbl/day will have much larger SSE than one producing 100 bbl/day, even for the same relative fit quality.

Function

ComputeSse — Sum of squared errors

Parameters:

ParameterDescriptionType
observedValuesActual production ratesRange or array
predictedValuesModel-predicted ratesRange or array

Returns: SSE value (scalar)


Log-Space SSE

Theory

Log-space SSE applies the SSE calculation to the logarithms of the values:

SSElog=i=1n(ln(qpredicted,i+ε)ln(qobserved,i+ε))2SSE_{log} = \sum_{i=1}^{n} \left(\ln(q_{predicted,i} + \varepsilon) - \ln(q_{observed,i} + \varepsilon)\right)^2

Where ε=109\varepsilon = 10^{-9} is a small constant to prevent ln(0)\ln(0).

Why Log-Space?

Log-space error offers several advantages for decline curve analysis:

BenefitExplanation
Scale invarianceTreats 10% error the same at 10,000 or 100 bbl/day
Handles wide dynamic rangeDecline data spans orders of magnitude
Emphasizes late-time fitLow-rate tails contribute more relatively
Matches visual assessmentLog-log plots weight errors more evenly

Function

ComputeLogSse — Log-space sum of squared errors

Parameters:

ParameterDescriptionType
observedValuesActual production ratesRange or array
predictedValuesModel-predicted ratesRange or array

Returns: Log-space SSE value (scalar)


Weighted SSE

Theory

Weighted SSE allows assigning different importance to each data point:

SSEweighted=i=1nwi(qpredicted,iqobserved,i)2SSE_{weighted} = \sum_{i=1}^{n} w_i \cdot (q_{predicted,i} - q_{observed,i})^2

Where wi0w_i \geq 0 is the weight for sample ii.

Weight Applications

Weighting StrategyUse Case
Time-basedwi=tiw_i = t_i emphasizes recent data
Inverse variancewi=1/σi2w_i = 1/\sigma_i^2 for heteroscedastic data
Quality flagswi=0w_i = 0 to exclude bad data points
Uniformwi=1w_i = 1 (equivalent to standard SSE)

Function

ComputeWeightedSse — Weighted sum of squared errors

Parameters:

ParameterDescriptionType
observedValuesActual production ratesRange or array
predictedValuesModel-predicted ratesRange or array
weightsValuesPer-sample weights (must be ≥ 0)Range or array

Returns: Weighted SSE value (scalar)


Weighted Log-Space SSE

Theory

Combines the benefits of log-space error with sample weighting:

SSEweighted,log=i=1nwi(ln(qpredicted,i+ε)ln(qobserved,i+ε))2SSE_{weighted,log} = \sum_{i=1}^{n} w_i \cdot \left(\ln(q_{predicted,i} + \varepsilon) - \ln(q_{observed,i} + \varepsilon)\right)^2

This is the default objective function used by Petroleum Office's curve fitting algorithms.

Function

ComputeWeightedLogSse — Weighted log-space SSE

Parameters:

ParameterDescriptionType
observedValuesActual production ratesRange or array
predictedValuesModel-predicted ratesRange or array
weightsValuesPer-sample weights (must be ≥ 0)Range or array

Returns: Weighted log-space SSE value (scalar)


Model Selection Guidelines

When to Use Each Metric

MetricBest For
SSEQuick comparisons, same well/scale
Log SSEWide dynamic range, visual log-log match
Weighted SSEData quality issues, emphasis control
Weighted Log SSEProduction forecasting (default for fitting)

Converting SSE to Other Metrics

To derive commonly-used metrics from SSE:

Mean Squared Error (MSE):

MSE=SSEnMSE = \frac{SSE}{n}

Root Mean Squared Error (RMSE):

RMSE=SSEnRMSE = \sqrt{\frac{SSE}{n}}

Normalized RMSE:

NRMSE=RMSEqˉobservedNRMSE = \frac{RMSE}{\bar{q}_{observed}}

Troubleshooting

Large SSE Values

SymptomLikely CauseSolution
SSE >> 10⁶Wrong model typeTry different decline model
SSE increases late-timeInterference/restimulationFit subset of data
SSE high earlyTransient flow periodExclude early points

Array Length Mismatch

All input arrays must have the same length. If you get an error:

  • Check for blank cells in your data
  • Ensure observed and predicted ranges match exactly
  • Verify weight array (if used) has the same length

See Also

Decline Models
declinestatisticscurve fittingSSEmodel selection
Can't find what you're looking for?Request Documentation
This website uses cookies to enhance your experience and analyze site usage. By clicking "Accept", you consent to the use of cookies for analytics purposes. Read our privacy policy