bayeslite
bayeslite copied to clipboard
SIMULATE * gives syntax error
q('''create temp table simulated as simulate * from satellites_cc limit 10000''') BQLParseError: Parse error: syntax error near *
I was expecting * to work for colnames, and other users might as well. Drawing a ton of samples from the model's full joint distribution and creating a table with this data, and then selecting and visualizing this simulated data might be a common desired entry point, even if it is inefficient compared to performing conditional simulations and storing only the variables of specific interest.
Shouldn't be too hard to fix this, I think: one grammar rule, one new and one tweaked parser rule, and a little code in compile_simulate in compiler.py.
One reason I might have thought this was not obviously the right thing is that we can simulate only modelled columns, not all columns of the table.
Presumably the semantics of * in this case would be "all modelled columns", equivalently "all columns of the generator".
Yes. I didn't say it was a good reason.