简体   繁体   English

设置参数估计的界限 - R package 盛况

[英]Setting bounds on parameter estimation - R package pomp

We are fitting a model in using the pomp package in R and want to place some bounds on the parameters we are estimating because they are exploring a space that is non-sensical and we want to keep it out of that parameter space.我们正在使用 R 中的pomp package 拟合 model,并希望对我们正在估计的参数设置一些界限,因为它们正在探索一个无意义的空间,我们希望将其排除在该参数空间之外。 Our current "best option" is to transform the parameter in the model code in C in a way that limits it between the upper and lower bound.我们目前的“最佳选择”是将C中的model代码中的参数以限制在上下界之间的方式进行改造。 So for example, if we want to limit parameter beta between 0 and 0.05, we could logit transform the estimated parameter so it is between 0 and 1 and multiply this by the upper bound.因此,例如,如果我们想将参数beta限制在 0 到 0.05 之间,我们可以对估计参数进行对数变换,使其介于 0 和 1 之间,然后将其乘以上限。 This is what the code would be in the sections in our code where we define the model in C snippets:这就是我们代码中我们在C片段中定义 model 的部分中的代码:

beta = ((exp(est_beta)/(1+exp(est_beta))*max_beta;

where est_beta is the parameter estimation in the space from -Inf to Inf and max_beta is the upper bound.其中est_beta是从 -Inf 到 Inf 的空间中的参数估计, max_beta是上限。

So my question is, is there a more elegant way to either 1) impose bounds on parameter estimation in a pomp model or 2) impose bounds or create a truncated variable in C ?所以我的问题是,是否有更优雅的方法来 1) 在C pomp施加界限或创建截断变量?

pomp does have an explicit facility for defining these transforms outside of the core model code: https://kingaa.r-universe.dev/manual/pomp.html#parameter_trans pomp确实有一个明确的工具来定义核心 model 代码之外的这些转换: https://kingaa.r-universe.dev/manual/pomp.html#parameter_trans

Note that estimation software frequently uses transforms such as logit at a low level to implement bounds, so I would not call this inelegant.请注意,估计软件经常在低级别使用 logit 等转换来实现边界,所以我不会说这不优雅。 (eg,: Stan: https://mc-stan.org/docs/2_22/reference-manual/variable-transforms-chapter.html ) (例如:斯坦: https://mc-stan.org/docs/2_22/reference-manual/variable-transforms-chapter.html

However, it may make more sense to use a strong prior to avoid sampling nonsensical space.但是,使用强先验来避免对无意义的空间进行采样可能更有意义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM