Learn R Programming

DeCAFS (version 3.2.3)

oilWell: Rock structure data from an oil well

Description

This data comes from lowering a probe into a bore-hole, and taking measurements of the rock structure as the probe is lowered. As the probe moves from one rock strata to another we expect to see an abrupt change in the signal from the measurements.

Usage

oilWell

Arguments

Format

A numeric vector of 4050 obervations

Examples

Run this code
# NOT RUN {
 
 # removing outliers
 n = length(oilWell)
 h = 32
 med = rep(NA, n)
 for (i in 1:n) {
   index = max(1, i - h):min(n, i + h)
   med[i] = median(oilWell[index])
 }
 residual = (oilWell - med)
 
 y = oilWell[abs(residual) < 8000]
 sigma = sqrt(var(residual[abs(residual) < 8000]))
 
 # running DeCAFS
 res <- DeCAFS(y/sigma)
 plot(res, xlab = "time", ylab = "y", type = "l")
 abline(v = res$changepoints, col = 4, lty = 3)
# }

Run the code above in your browser using DataLab