This paper discusses an optimal sizing strategy of wind, PV and battery-based systems for powering an islanded microgrid system. Waikato Environment for Knowledge Analysis (WEKA) software was employed for wind speed and solar radiation time series forecasting in order to obtain predicted values for wind and solar power output. An optimization problem is developed to minimize the microgrid capital and maintenance costs. In order to achieve an optimal system configuration, a loss of power supply probability (LPSP) was evaluated for ensuring power system reliability and the optimization problem was solved using Advanced Interactive Multidimensional Modeling System (AIMMS). The results obtained from simulation shows the importance of optimal sizing in the investment and operation of microgrid systems.