In this paper, the problem of optimal placement of virtual inertia is considered as a techno-economic problem from a frequency stability point of view. First, a data driven-based equivalent model of battery energy storage systems, as seen from the electrical system, is proposed. This experimentally validated model takes advantage of the energy storage system special attributes to contribute to inertial response enhancement, via the virtual inertia concept. Then, a new framework is proposed, which considers the battery storage system features, including annual costs, lifetime and state of charge, into the optimal placement formulation to enhance frequency response with a minimum storage capacity. Two well-known dynamical frequency criteria, the frequency nadir and the rate of change of frequency, are utilized in the optimization formulation to determine minimum energy storage systems. Moreover, a power angle-based stability index is also used to assess the effect of virtual inertia on transient stability. Sensitivity and uncertainty analyses are further conducted to assess the applicability of the method. The efficiency of the proposed framework is demonstrated on a linearized model of a three-area power system as well as two nonlinear systems. Simulation results suggest that the proposed method gives improved results in terms of stability measures and less ESS capacity, when compared with other methods proposed in the literature.