edsandorf / spdesign

Contemporary software commonly used to design stated preference experiments are expensive and the code is closed source. spdesignR is a free software package with an easy to use interface to make flexible stated preference experimental designs using state-of-the-art methods.
GNU General Public License v3.0
0 stars 1 forks source link

Bayesian MIXL with mixture of fixed and random parameters #10

Closed edsandorf closed 3 years ago

edsandorf commented 3 years ago

With the current syntax, the package can handle a MIXL with a combination of non-random and random parameters. I can also handle whether the mean and standard deviations have Bayesian priors, however, it cannot distinguish between a random parameter with fixed priors beta_1 | N(0, 1) and a non-random parameter with Bayesian priors beta_1 | N(0, 1).

It is critical to think about this because changing the syntax down the line may lead to backwards incompatibility and breaking changes.

edsandorf commented 3 years ago

Could potentially be solved using an argument in the function specifying the distributions that defaults to it being a prior unless otherwise stated. It should keep the syntax clean for most cases except when specifying random parameters in a MIXL.

For example: N(0, 1, "random") or N(0, 1, FALSE) or N(0, 1, "rpl")

This would require modification of the functions N(), LN(), TR() and U() such that they return an attribute indicating whether it is a prior or a parameter since this affects where the averaging happens in the optimization.

edsandorf commented 3 years ago

The syntax is Np() for priors and N() for random parameters. Consistent with the Dp notation for the error when priors are specified.

Closing this issue for now and consider it resolved.