The accurate quantitative calculation of mineral components is very important and basic work in formation evaluation. Using well-log data to estimate mineralogy and porosity is a mainstream method with core measurements often used. However, in shale reservoirs, there are many mineral components, such as organic matter and pyrite. In addition, 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 more complex and thus the estimation of the mineral components more difficult. To address this problem, we have adopted 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-squares method, we construct the objective function, and we use the improved krill herd algorithm to solve the problem. Finally, we estimate the mineral component volume. The calculated results indicate that the method can accurately determine the clay, quartz + feldspar, carbonate contents, and porosity by conventional logging data. Compared to the traditional mineral inversion method, the average relative error is reduced by 11.1%. The method has high applicability to shale reservoirs and can supply the basic parameters for formation evaluation.