In Markowitz' s mean-variance portfolio model, the probability distribution of a future return is composed of recent historical prices, and the future return and future risk are estimated as the mean and standard deviation of the distribution, respectively. Namely, the future return is predicted by a simple moving average, and the risk is simply the historical fluctuation. In this study, to improve the prediction accuracy of the future return, we apply a nonlinear prediction method following local spatial dynamics, and to estimate the future risk, we produce a probability distribution by aggregating predicted values by the bagging algorithm. Then, each risk is reduced by making a portfolio, that is, we apply the portfolio effect. Namely, our method attempts to simultaneously improve the prediction accuracy and reduce the risk of its prediction error. To confirm the validity of our method, we performed investment simulations. As a result, we could realize higher profit and lower risk in investment than by the conventional method.