Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier specification of bounds for parameters #22

Open
dmi3kno opened this issue May 20, 2022 · 1 comment
Open

Easier specification of bounds for parameters #22

dmi3kno opened this issue May 20, 2022 · 1 comment

Comments

@dmi3kno
Copy link

dmi3kno commented May 20, 2022

I understand that model kernels have lb and ub arguments for specifying the parameter bounds.

I have a mix of bounded and unbounded parameters. Some parameters are on [0,1] others are [0,$\infty$]. I understand that for unbounded parameters I should provide .Machine$double.xmax, but that is somehow inconvenient to remember.

Ideally, I would love to specify the bounds per parameter in a named vector like this

kernel_ram( ..., lb=c(alpha=NA, beta=0,gamma=0), ub=c(alpha=NA, beta=1, gamma=NA))

This should be interpreted as: alpha is unbounded, beta is bounded on [0,1] and gamma is positive values only.

Alternatively, if you don't want to rewrite the lb, ub, I think including the bounds=list(alpha=NA, beta=c(0,1), gamma=c(0,NA)) into the main function fmcmc::MCMC might be an OK solution. Then you can only look up to this argument in the main function and if the bounds are defined, the kernel would inherit them.

Does this make any sense? I am trying to mimic the parameter specification in Stan where for each parameter I can specify the lower and upper bound right in the parameter declaration block.

@dmi3kno
Copy link
Author

dmi3kno commented May 20, 2022

Also, I noticed that even if I define some parameters to be bounded, the MCMC still proposes transitions to outside of the bounds (every now and then). Perhaps it depends on the value of eps. In my case it is critical that if the parameter is specified on [0,1] no proposal is generated outside of the bounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant