*4.1. Scenario Generation*

The management of electric vehicles in a market environment involves an increased level of uncertainty due to not only market prices that have some characteristics of volatility, but also to the uncertainty on the behavior of owners of the electric vehicles in what regards the usage of electricity. Thus, the uncertain parameters considered in this paper are the day-ahead market prices, the energy demand for electric vehicles for driving requirements, and the availability of electric vehicles. To incorporate the uncertainty into the stochastic model proposed in this paper, the uncertain parameters are modeled through a set of plausible realizations known to be the scenarios. Energy demand for electric vehicles and the availability of vehicles are modeled at coincident periods and scenarios. The following steps are applied to generate the scenarios: (1) the consideration of the kernel density estimation (KDE), which is a non-parametric method to estimate the probability density function (pdf) of a random variable; (2) from the estimation revealed by KDE, a total of 1000 scenarios are generated. The kernel density estimator is as follows [32]:

$$\hat{f}\_h(\mathbf{x}) = \frac{1}{nh} \sum\_{i=1}^n K\left(\frac{\mathbf{x} - \mathbf{x}\_i}{h}\right) \tag{14}$$

In (14) *n* is the sample size, *h* is the bandwidth, and *K*(.) is the kernel smoothing function.
