Limit very high and low ratios by capping them to a fixed boundary. If a property has a sale, its ratio should be adjusted to be within these bounds.

For example, a property with an estimate of \$300,000 and a sale of \$100,000 will have a sale ratio of 3. This function would lower the estimate to the specified lower bound. If the lower bound were 2, then the estimate would become \$200,000.

val_limit_ratios(truth, estimate, lower, upper)

Arguments

truth

Vector of true market values. Typically sale prices.

estimate

Vector of estimated market values. Typically model results.

lower

The lower ratio bound for properties with sales. Typically 0.7.

upper

The upper ratio bound for properties with sales. Typically 2.

Value

A vector of adjusted estimates.

Examples

sales <- c(20000, 15000, 30000, NA, 55000, 40000, NA)
estimates <- c(30000, 50000, 31000, 10000, 200000, 30000, 20000)
val_limit_ratios(sales, estimates, lower = 0.7, upper = 2.0)
#> [1]  30000  30000  31000  10000 110000  30000  20000