Hey Aaron,
The step function is designed to generate a vector of values with a constant step size between two given limits. In your code, you are using it to generate a vector of expected return targets for your portfolios.
However, as you noted, this will only generate a small number of return targets, rather than the 1000 targets you were expecting. This is because the step size is quite large relative to the range of expected returns. For example, if the minimum and maximum expected returns are -0.05 and 0.10 respectively, a step size of 0.001 will generate only 161 return targets.
To generate a larger number of return targets, you could try reducing the step size to something smaller, such as 0.0001. Alternatively, you could use a different method to generate your return targets. One such method is to use the mean-variance efficient frontier, which is a curve that represents the set of portfolios that achieve the highest expected return for a given level of risk (variance). This curve can be generated by solving a quadratic optimization problem, such as the Markowitz portfolio optimization problem. By varying the level of risk, you can generate a set of return targets that span the entire efficient frontier.