Skip to content

Commit 0849c57

Browse files
committed
long run
1 parent 150fa9e commit 0849c57

File tree

2 files changed

+6
-24063
lines changed

2 files changed

+6
-24063
lines changed

R/npiv_regression.R

+6-5
Original file line numberDiff line numberDiff line change
@@ -264,15 +264,16 @@ npiv_regression <- function(data,
264264
D_max <- max(D)
265265
Xx_min <- min(Xx_sub)
266266
Xx_max <- max(Xx_sub)
267-
# log_info(paste("D range:", D_min, "to", D_max))
268-
# log_info(paste("Xx_sub range:", Xx_min, "to", Xx_max))
269267

270268
# Clamp D values to the range of Xx_sub
271269
D_clamped <- pmax(pmin(D, Xx_max), Xx_min)
272-
# if (any(D != D_clamped)) {
273-
# log_info(paste("Warning:", sum(D != D_clamped), "D values clamped to Xx_sub range"))
274-
# }
275270

271+
if (any(D != D_clamped)) {
272+
message(sprintf("Note: %d D values clamped to Xx_sub range.\n Original D range: [%.4f, %.4f]\n Xx_sub range: [%.4f, %.4f]\n Values outside this range were clamped.",
273+
sum(D != D_clamped),
274+
D_min, D_max,
275+
Xx_min, Xx_max))
276+
}
276277
intervals <- findInterval(D_clamped, Xx_sub)
277278
# log_dim("intervals", intervals)
278279

0 commit comments

Comments
 (0)