> I realize it's now a diagonal mass matrix instead
> of varying step sizes (I'll have to change the manual
> to reflect that).
Yes, when switching to a proper metric instead of the "varying step sizes" the step-size and metric elements became identifiable and so the adaptation had to be factored. Basically the variance (or covariance for dense) is estimated using the Welford algorithm while the step-size is estimated using dual-averaging.
> But did the estimation strategy change so the dual
> averaging params are no longer relevant? If so, it
> doesn't make sense to leave them in place.
No, they're used but take default values from internal constructors. It was just odd that we exposed two of the dual-averaging parameters but not the others, so I ignored the option to set them by hand when refactoring. I'd rather we make them all available, which the subcommands would make easy. For now I'll de-neuter the two existing options on master.
>
> And it won't really be "stan" from the command line,
> but "my_model sample".
>
> The executable is just "my_model", as now, but the first
> thing it'll do is look at what the next argument is,
> which would be required to be one of the subcommands.
> That is, it should work like subcommands in git or svn.
>
> It'd also be nice to have it check options, so that
> unrecognized options are rejected.
Yup, exactly what I was thinking. But how exactly do we implement it? Right now stan::io::cmd_line is agnostic to the commands, it just accumulates them and allows the user to query but any subcommand functionality would either require listing all of the possible command/subcommand relationships in stan::io::cmd_line or changing the syntax of the arguments. For example,
1) Denote subcommands with a prefix, such as s_
my_model sample hmc s_hmc_arg1 s_hmc_arg2 da s_da_arg1
This way, as stan::io::cmd_line reads the arguments it can associate commands (unprefixed) with subcommands (everything with the prefix immediately following the unprefixed command). But it's really ugly.
2) Denote subcommands with equals
my_model sample hmc:hmc_arg1,hmc_arg2 da:da_arg1
Again, easy to parse without knowing the command/subcommand relationships. Less ugly, but still pretty ugly.
3) Denote commands as flags
my_model sample -hmc hmc_arg1 hmc_arg2 -da da_arg1
4) Lookup table after parsing:
my_model sample hmc hmc_arg1 hmc_arg2 da da_arg1
gets parsed to a list
args=[hmc, hmc_arg1, hmc_arg2, da, da_arg1]
Then you just run over the list checking against a look-up table of commands and their subcommands.
5) Lookup table before parsing:
my_model sample hmc hmc_arg1 hmc_arg2 da da_arg1
While parsing you check against the big look-up table (which would have to be stored in stan::io::cmd_line now, unless we make a big giant class just to store the info). This way you can also restrict valid subcommands to those immediately following the command.
I'm just not sure what everyone's preference is. 3 seems to be the standard SVN approach although 5 wouldn't be that hard.