The accurate quantitative calculation of the volume fraction of mineral components is very important and basic work in formation evaluation. Using well log data to estimate the mineralogy, porosity, and total organic carbon (TOC) content is a mainstream method with core measurements often used. However, in shale reservoirs, there are many mineral components, such as organic matter and pyrite. Additionally, the pore structure is complex, and gas exists in the pores as free state, adsorbed state and dissolved state. These factors make the logging response characteristics of shale gas reservoirs more complex and thus the estimation of the mineral components more difficult. To address this problem, this paper proposes a mineral inversion method based on error analysis and response equation error. Based on the error analysis of the mineral inversion method, we first establish a technique to obtain interpretation parameters and the function of the response equation error combined with the core data. Then, based on the weighted total least square method (WTLS), we construct the objective function, and utilize the improved krill herd algorithm (OCKH) to solve the problem. Finally, we estimate the mineral component volume. The calculated results show that the method can accurately determine the clay, quartz + feldspar, carbonate contents, and porosity by using conventional logging data. Compared with the traditional mineral inversion method, the average relative error of the new method is reduced by 11.1%. In summary, the proposed method has high applicability to shale reservoirs and can supply the basic parameters for formation evaluation.