The Kernal Support Vector Machine (KSVM) is a nonlinear supervised statistical learning algorithm that recognizes the discrete classes for the given data based on maximizing the margin around the separating hyperplane and the decision function is fully specified by a subset of the supporting vectors. The posterior distribution was validated using the true and predicted facies counts matrix that estimated by KSVM.

In this work, KSVM was adopted her to estimate the continuous predicted probability Distribution of Lithofacies in Karpur Dataset.

Install the packages required to implement KSVM algorithm with their functions.

#First, install the required packages.
require(kernlab)
## Loading required package: kernlab
require(e1071)
## Loading required package: e1071
require(ggplot2)
## Loading required package: ggplot2
## 
## Attaching package: 'ggplot2'
## 
## The following object is masked _by_ '.GlobalEnv':
## 
##     mpg
require(MASS)
## Loading required package: MASS
require(lattice)
## Loading required package: lattice
library(kernlab)
library(e1071)
library(ggplot2)
library(MASS)
library(lattice)

Call the dataset and show the dataset head: -

##    depth caliper ind.deep ind.med  gamma phi.N R.deep  R.med      SP
## 1 5667.0   8.685  618.005 569.781 98.823 0.410  1.618  1.755 -56.587
## 2 5667.5   8.686  497.547 419.494 90.640 0.307  2.010  2.384 -61.916
## 3 5668.0   8.686  384.935 300.155 78.087 0.203  2.598  3.332 -55.861
## 4 5668.5   8.686  278.324 205.224 66.232 0.119  3.593  4.873 -41.860
## 5 5669.0   8.686  183.743 131.155 59.807 0.069  5.442  7.625 -34.934
## 6 5669.5   8.686  109.512  75.633 57.109 0.048  9.131 13.222 -39.769
##   density.corr density phi.core   k.core Facies
## 1       -0.033   2.205  33.9000 2442.590     F1
## 2       -0.067   2.040  33.4131 3006.989     F1
## 3       -0.064   1.888  33.1000 3370.000     F1
## 4       -0.053   1.794  34.9000 2270.000     F1
## 5       -0.054   1.758  35.0644 2530.758     F1
## 6       -0.058   1.759  35.3152 2928.314     F1

Summary of the dataset.

##      depth         caliper         ind.deep          ind.med       
##  Min.   :5667   Min.   :8.487   Min.   :  6.532   Min.   :  9.386  
##  1st Qu.:5769   1st Qu.:8.556   1st Qu.: 28.799   1st Qu.: 27.892  
##  Median :5872   Median :8.588   Median :217.849   Median :254.383  
##  Mean   :5873   Mean   :8.622   Mean   :275.357   Mean   :273.357  
##  3rd Qu.:5977   3rd Qu.:8.686   3rd Qu.:566.793   3rd Qu.:544.232  
##  Max.   :6083   Max.   :8.886   Max.   :769.484   Max.   :746.028  
##                                                                    
##      gamma            phi.N            R.deep            R.med        
##  Min.   : 16.74   Min.   :0.0150   Min.   :  1.300   Min.   :  1.340  
##  1st Qu.: 40.89   1st Qu.:0.2030   1st Qu.:  1.764   1st Qu.:  1.837  
##  Median : 51.37   Median :0.2450   Median :  4.590   Median :  3.931  
##  Mean   : 53.42   Mean   :0.2213   Mean   : 24.501   Mean   : 21.196  
##  3rd Qu.: 62.37   3rd Qu.:0.2640   3rd Qu.: 34.724   3rd Qu.: 35.853  
##  Max.   :112.40   Max.   :0.4100   Max.   :153.085   Max.   :106.542  
##                                                                       
##        SP          density.corr          density         phi.core    
##  Min.   :-73.95   Min.   :-0.067000   Min.   :1.758   Min.   :15.70  
##  1st Qu.:-42.01   1st Qu.:-0.016000   1st Qu.:2.023   1st Qu.:23.90  
##  Median :-32.25   Median :-0.007000   Median :2.099   Median :27.60  
##  Mean   :-30.98   Mean   :-0.008883   Mean   :2.102   Mean   :26.93  
##  3rd Qu.:-19.48   3rd Qu.: 0.002000   3rd Qu.:2.181   3rd Qu.:30.70  
##  Max.   : 25.13   Max.   : 0.089000   Max.   :2.387   Max.   :36.30  
##                                                                      
##      k.core             Facies   
##  Min.   :    0.42   F8     :184  
##  1st Qu.:  657.33   F9     :172  
##  Median : 1591.22   F10    :171  
##  Mean   : 2251.91   F1     :111  
##  3rd Qu.: 3046.82   F5     :109  
##  Max.   :15600.00   F3     : 55  
##                     (Other): 17

Visualize the dataset:

Modeling the Facies given well logs and core data through KSVM model:

## Support Vector Machine object of class "ksvm" 
## 
## SV type: C-bsvc  (classification) 
##  parameter : cost C = 10 
## 
## Gaussian Radial Basis kernel function. 
##  Hyperparameter : sigma =  0.1 
## 
## Number of Support Vectors : 270 
## 
## Objective Function Value : -29.5751 -5.7183 -12.6285 -9.7755 -3.1325 -5.1116 -3.2175 -31.3784 -466.329 -80.5273 -33.3939 -35.5583 -6.013 -16.441 -4.2832 -2.1841 -2.6184 -2.0174 -32.6271 -7.1898 -8.1195 -4.2553 -13.3536 -66.2724 -69.0838 -27.5201 -2.9589 -64.0039 
## Training error : 0.023199 
## Probability model included.
## Length  Class   Mode 
##      1   ksvm     S4

Head & Sumary of predicted discrtet and posterior distributions of Facies by KSVM:

##             F1        F10          F2          F3          F5          F7
## [1,] 0.9420069 0.02415062 0.003600989 0.005542730 0.004820740 0.003950962
## [2,] 0.9443455 0.02085043 0.003723612 0.005667284 0.005295246 0.004194428
## [3,] 0.9449228 0.02166083 0.003521716 0.006261963 0.005010991 0.004124452
## [4,] 0.9558534 0.01745893 0.003095547 0.005042009 0.003129275 0.003651956
## [5,] 0.9450055 0.02139177 0.003595512 0.005447882 0.005113368 0.004249314
## [6,] 0.9440478 0.02071560 0.003708630 0.005822525 0.005868332 0.004373920
##              F8          F9
## [1,] 0.01203424 0.003892810
## [2,] 0.01229356 0.003629921
## [3,] 0.01112826 0.003368938
## [4,] 0.00897607 0.002792779
## [5,] 0.01184974 0.003346937
## [6,] 0.01202087 0.003442304
##        F1                F10                  F2           
##  Min.   :-0.01150   Min.   :0.0004239   Min.   :-0.007770  
##  1st Qu.: 0.04911   1st Qu.:0.1223078   1st Qu.: 0.005372  
##  Median : 0.07354   Median :0.1495795   Median : 0.051580  
##  Mean   : 0.19482   Mean   :0.2949670   Mean   : 0.049397  
##  3rd Qu.: 0.12857   3rd Qu.:0.3071582   3rd Qu.: 0.061017  
##  Max.   : 0.99326   Max.   :0.9937074   Max.   : 0.841170  
##        F3                  F5                  F7           
##  Min.   :0.0002971   Min.   :-0.015050   Min.   :-0.017741  
##  1st Qu.:0.0413950   1st Qu.: 0.005415   1st Qu.: 0.002282  
##  Median :0.0973518   Median : 0.083129   Median : 0.078393  
##  Mean   :0.0866778   Mean   : 0.062161   Mean   : 0.057837  
##  3rd Qu.:0.1075710   3rd Qu.: 0.094976   3rd Qu.: 0.096656  
##  Max.   :0.7819388   Max.   : 0.186582   Max.   : 0.129606  
##        F8                  F9           
##  Min.   :-0.016184   Min.   :-0.015594  
##  1st Qu.: 0.004653   1st Qu.: 0.003252  
##  Median : 0.161129   Median : 0.056299  
##  Mean   : 0.171845   Mean   : 0.082296  
##  3rd Qu.: 0.278095   3rd Qu.: 0.137680  
##  Max.   : 0.900641   Max.   : 0.294194
## [1] F1 F1 F1 F1 F1 F1
## Levels: F1 F10 F2 F3 F5 F7 F8 F9
##  F1 F10  F2  F3  F5  F7  F8  F9 
## 111 178   8  47 109   9 183 174

Means of the Well logs and core data given each Facies:

KSVM Modeling Validation by computing the total correct percent.

##      qq
##        F1 F10  F2  F3  F5  F7  F8  F9
##   F1  111   0   0   0   0   0   0   0
##   F10   0 166   0   4   1   0   0   0
##   F2    0   0   8   0   0   0   0   0
##   F3    0  12   0  43   0   0   0   0
##   F5    0   0   0   0 108   0   0   1
##   F7    0   0   0   0   0   9   0   0
##   F8    0   0   0   0   0   0 183   1
##   F9    0   0   0   0   0   0   0 172
##        F1       F10        F2        F3        F5        F7        F8 
## 1.0000000 0.9325843 1.0000000 0.9148936 0.9908257 1.0000000 1.0000000 
##        F9 
## 0.9885057

Total percent correct that reflects the KSVM accuracy of classification:

## [1] 0.976801

Scatteratrix plot of Lithofacies Classification by KSVM:

Visualizing the predicted posterior distribution of the Eight Facies.

Combining the posterior distribution of the eight Lithofacies in one plot.

## Warning in bxp(structure(list(stats = structure(c(5667, 5680.75, 5694.5, :
## some notches went outside hinges ('box'): maybe set notch=FALSE
## Warning in bxp(structure(list(stats = structure(c(5667, 5680.75, 5694.5, :
## some notches went outside hinges ('box'): maybe set notch=FALSE

References

  1. Cristianini, N., and Shawe-Taylor, J. (2000). An introduction to support vector machines and other kernel-based learning methods. Cambridge university press.

  2. Al-Mudhafar, W. J. (2015). Integrating Component Analysis & Classification Techniques for Comparative Prediction of Continuous & Discrete Lithofacies Distributions. Offshore Technology Conference. doi:10.4043/25806-MS.

  3. Karpur, L., L. Lake, and K. Sepehrnoori. (2000). Probability Logs for Facies Classification. In Situ 24(1): 57.

  4. Al-Mudhafer, W. J. (2014). Multinomial Logistic Regression for Bayesian Estimation of Vertical Facies Modeling in Heterogeneous Sandstone Reservoirs. Offshore Technology Conference. doi:10.4043/24732-MS.

  5. Al-Mudhafar, W. J. (2015). Applied Geostatistics in R: 1. Naive Bayes Classifier for Lithofacies Modeling in a Sandstone Formation. RPubs.

  6. Al-Mudhafar, W. J. (2015). Applied Geostatistics in R: 2. Applied Geostatistics in R: 2. Logistic Boosting Regression (LogitBoost) for Multinomial Lithofacies Classification in a Sandstone Formation. RPubs.

  7. Al-Mudhafar, W. J. (2015). Applied Geostatistics in R: 3. Linear Discriminant Analysis (LDA) for Multinomial Lithofacies Classification in a Sandstone Formation. RPubs.

  8. Al-Mudhafar, W. J. (2015). Applied Geostatistics in R: 4. Applied Geostatistics in R: 4. Multinomial Logistic Regression (MLR) for Posterior Lithofacies Probability Prediction in a Sandstone Formation. RPubs.

  9. Al-Mudhafar, W. J. (2015). Applied Geostatistics in R: 5. Improved Reservoir Characterization through Facies Tree-Based Classification Models. RPubs.