# Estimation of Litho-Fluid Facies Distribution from Zero-Offset Acoustic and Shear Impedances
## 4 Methodology
### Estimation of Facies Distribution  
After obtaining the zero-offset P- and S-impedances, they were transformed into elastic properties in order to forecast the lithology and fluid probabilities separately by two logistic regression models. The lithology and fluid models were merged together to estimate the distribution of gas sand, wet sand, and shale by using the decision tree algorithm. \(Z_{P}\) and \(Z_{S}\) were firstly transformed into the lithology predictors: near and far elastic impedances [116]. Next, the fluid predictors, Mu-Rho, Lambda-Mu-Rho, and Poisson's ratios, were calculated based on the LMR theory [117]. The idea of the facies model is based on the combination of the logistic regression [52] and decision tree algorithms. Logistic regression is one of the linear regression models that deal with binary response variables. The idea of logistic regression is to provide model estimates which lie between zero and one [118]. These estimates can be considered the probabilities of occurrence of both zero and one. Therefore, the likelihood of a logistic regression model follows a Bernoulli distribution which takes on the value 1 with a probability \(\phi\) and 0 with a probability \((1-\phi)\), as shown in the following equation:  
\[Y_{i}|\phi_{i}\sim Bernoulli(\phi_{i}) \tag{60}\]  
where \(Y_{i}\) is a binary event at an observation \((i)\), while \(\phi_  
from the fluid predictors. Given the observations of the elastic attributes and the facies log, the model's coefficients can be obtained based on [PERSON]'s theorem [119]. The lithology model aims at predicting the sand probability from the near-EI and far-EI attributes. On the other hand, the fluid model aims at estimating the gas probability from the Mu-Rho, Lambda-Rho/Mu-Rho, and Poisson's ratios. The posterior means of the coefficients of the two models were obtained by MCMC simulation. The facies and fluid models were merged together by using the sand and gas probabilities, along with depth values, as inputs to a decision tree, which turned the probabilities into facies estimates. A decision tree is a classification method that generates questions over training samples and answers them using a set of statistical criteria for data classification [42]. There are two types of decision trees, which are regression and classification trees. As the response variable in this study was categorical, a decision tree was considered. A decision tree begins with a root node where the samples are classified into two branches such that if the answer to the question is \"Yes\", the sample goes under the \"Yes\" branch, while if the answer is \"NO\", the sample goes under the \"No\" branch. A distinct series of questions and branches are set in the internal nodes until satisfying the stopping rule in the last terminal of the tree, which is called the leaf node. According to the classification rule [120], each leaf in a tree represents a class (A or B). A popular method used to construct decision trees is called classification and regression trees (CART) [121]. The CART method splits observations into two parts by minimizing the relative sum of squared errors [122] between the two partitions, according to the principle of binary recursive partitioning (BRP) [123]. The advantages of this method are that it is nonparametric, free of significance tests, and has low sensitivity to outliers [124]. The process of tree shortening is called pruning. Avoiding the large size of a tree is crucial to eschew over-fitting. The size of a decision tree is controlled by many factors, such as the minimum number of samples that should be left in a node to achieve splitting [125]. A pruned tree mostly leads to results which are close to those of the original tree. However, the pruned tree may be more accurate than the initial one in some cases [126]. This study used the \"prart\" package in R to model the three-class facies variable based on the CART method.