You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parameterTransform handles multivariate user dists, with a warning (#1532)
* parameterTransform handles multivariate user dists, with a warning
* Fix boolean operator.
* Rework new messages with verbosity system.
* Fix missing commas in warnings.
---------
Co-authored-by: Christopher Paciorek <paciorek@stat.berkeley.edu>
Copy file name to clipboardExpand all lines: packages/nimble/R/options.R
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -215,7 +215,8 @@ nimOptimMethod("bobyqa",
215
215
MCMCwarnUnsampledStochasticNodes=TRUE,
216
216
MCMCRJcheckHyperparam=TRUE,
217
217
MCMCenableWAIC=FALSE,
218
-
MCMCuseBarkerAsDefaultMV=FALSE,
218
+
MCMCuseBarkerAsDefaultMV=FALSE,
219
+
parameterTransformWarnUserDists=TRUE,
219
220
useClearCompiledInADTesting=TRUE,
220
221
unsupportedDerivativeHandling='error', # default is error, other options are 'warn' and 'ignore'. Handled in updateADproxyModelMethods in cppDefs_nimbleFunction.R
if(length(all.vars(lowerBdExpr)) >0) stop('Node ', node, ' appears to have a non-constant lower bound, which cannot be used in parameterTransform.')
172
172
if(length(all.vars(upperBdExpr)) >0) stop('Node ', node, ' appears to have a non-constant upper bound, which cannot be used in parameterTransform.')
173
173
} else { ## some other distribution with finite support
174
-
message(' [Warning] `parameterTransform` system cannot process the ', dist, ' distribution of node ', node, '.\n The upper and lower bounds of the ', dist, ' distribution must be constant.\n If you\'re uncertain about this, please get in touch with the NIMBLE development team.')
174
+
messageIfVerbose(' [Warning] `parameterTransform` system cannot process the `', dist, '`\n',
175
+
' distribution for node `', node, '. The upper and lower bounds\n',
transformData[i,DATA2] <-bounds[2] -bounds[1] ## formerly range
179
181
next }
180
-
stop(paste0('`parameterTransform` system doesn\'t have a transformation for the bounds of node: ', node, ', which are (', bounds[1], ', ', bounds[2], ')'))
182
+
stop('`parameterTransform` system doesn\'t have a transformation for the bounds of node: ', node, ', which are (', bounds[1], ', ', bounds[2], ')')
181
183
} else { ## multivariate
182
-
if(dist%in% c('dmnorm', 'dmvt', 'dcar_normal', 'dcar_proper')) { ## 6: multivariate {normal, t, CAR}; also set for non-scalar determ nodes when allowDeterm is TRUE
0 commit comments