Learn R Programming

aRpsDCA (version 1.0.0)

bestfit: Best-fitting of Arps decline curves

Description

Perform best-fits of Arps decline curves to rate or cumulative data.

Usage

best.exponential(q, t)
best.hyperbolic(q, t)
best.hyp2exp(q, t)
best.fit(q, t)
best.exponential.from.Np(Np, t)
best.hyperbolic.from.Np(Np, t)
best.hyp2exp.from.Np(Np, t)
best.fit.from.Np(Np, t)
best.exponential.curtailed(q, t)
best.hyperbolic.curtailed(q, t)
best.hyp2exp.curtailed(q, t)
best.curtailed.fit(q, t)
best.exponential.curtailed.from.Np(Np, t)
best.hyperbolic.curtailed.from.Np(Np, t)
best.hyp2exp.curtailed.from.Np(Np, t)
best.curtailed.fit.from.Np(Np, t)

Arguments

q
vector of rate data.
Np
vector of cumulative production data.
t
vector of times at which q or Np is measured.

Value

  • best.exponential, best.hyperbolic, and best.hyp2exp return objects of the appropriate class (as from arps.decline) representing best fits of the appropriate type against q and t, in the same units as q and t.

    best.fit returns the best overall fit, considering results from each function above.

    best.exponential.from.Np, best.hyperbolic.from.Np, and best.hyp2exp.from.Np return objects of the appropriate class (as from arps.decline) representing best fits of the appropriate type against Np and t, in the same units as Np and t.

    best.fit.from.Np returns the best overall fit, considering results from each function above.

    best.exponential.curtailed, best.hyperbolic.curtailed, best.hyp2exp.curtailed, best.curtailed.fit, best.exponential.curtailed.from.Np, best.hyperbolic.curtailed.from.Np, best.hyp2exp.curtailed.from.Np, and best.curtailed.fit.from.Np work as the corresponding functions above, but may return curtailed declines (as from curtail).

Details

Best-fitting is carried out by minimizing the sum of squared error in the rate or cumulative forecast, using nlminb as the optimizer.

Appropriate bounds are applied to decline-curve parameters.

See Also

arps, curtailed, nlminb

Examples

Run this code
fitme.hyp2exp.t <- seq(0, 5, 1 / 12) # 5 years
fitme.hyp2exp.q <- hyp2exp.q(
    1000, # Bbl/d
    as.nominal(0.70), # / year
    1.9,
    as.nominal(0.15), # / year
    fitme.hyp2exp.t
) * rnorm(n=length(fitme.hyp2exp.t), mean=1, sd=0.1) # perturb

hyp2exp.fit <- best.hyp2exp(fitme.hyp2exp.q, fitme.hyp2exp.t)
cat(paste("SSE:", hyp2exp.fit$sse))
dev.new()
plot(fitme.hyp2exp.q ~ fitme.hyp2exp.t, main="Hyperbolic-to-Exponential Fit",
     col="blue", log="y", xlab="Time", ylab="Rate")
lines(arps.q(hyp2exp.fit$decline, fitme.hyp2exp.t) ~ fitme.hyp2exp.t,
      col="red")
legend("topright", pch=c(1, NA), lty=c(NA, 1), col=c("blue", "red"), legend=c("Actual", "Fit"))

Run the code above in your browser using DataLab