Sequence of varying increments with R?

r, sequence

Solution

How about something like this:

0.0001 * 6^(0:10)
#  [1]    0.0001    0.0006    0.0036    0.0216    0.1296    0.7776    4.6656
#  [8]   27.9936  167.9616 1007.7696 6046.6176

Problem

I'm optimizing some various models, one of which is radialSVM using the `caret` package. I'm creating a tuning grid in preparation to cycle through a loop to find the best parameters to use for the model. One thing that would be extremely helpful is some sort of varying increment sequence. For example, I'd like to start with small parameter values incremented in small steps. The larger I go, the bigger steps I can take. I've found that small parameters do change the model quite a bit, so I'd like to explore them more carefully. It would be fantastic to have the sequence increment by some multiplier of the current step, say `x <- x+5*x`. Is this possible with something that already exists, (like a creative use of `seq()`), or do I need to use a loop?

Original source