openavmkit.value_studies
Assessment-quality studies on any value field, written to disk.
The assessment_quality notebook runs ratio, vertical-equity and
horizontal-equity studies on a value field (typically the assessor's current
market value) one model group at a time and displays the results. This module
runs the same studies for every model group plus the whole jurisdiction, for one
or more value fields, and writes the results as JSON so that reports and other
front ends can use them without re-running anything.
No modeling is required: the studies only need sales, model groups and the value
field(s). Horizontal equity additionally needs the equity clusters marked in the
clean stage (he_id); without them it is skipped.
Sales are scored on raw sale_price within the ratio-study window
(analysis.ratio_study.look_back_years before the valuation date), matching
the formal ratio study.
region_stats
region_stats(df, field, region, limit=10.0)
Neighborhood price level statistics: the median ratio by the price level of the region each sale is in.
Each region's price level is the median market value proxy of its sales (half the price, half the value at the
median ratio); the regions are grouped by level as the VEI groups sales (2 groups up to 50 sales, 4 up to 500,
else 10, never splitting a region), and the VEI is worked out over those groups (openratiostudy.com's
"neighborhood price level" statistics; not an IAAO test). run_value_field_studies reports it under
regions for its region; called on its own, on the sales table it writes (<field>.sales.parquet, with
field="value") and any location field joined to it, it gives the same figures for another location field
without running the study again.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
The sales: |
required |
field
|
str
|
The value field. |
required |
region
|
str
|
The location field. |
required |
limit
|
float
|
The VEI's limit for its verdict, in percent. Defaults to 10. |
10.0
|
Returns:
| Type | Description |
|---|---|
dict
|
|
Source code in openavmkit/value_studies.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
run_value_field_studies
run_value_field_studies(sup, settings, fields, *, location=None, start_date=None, end_date=None, confidence_interval=0.9, max_trim=0.05, outpath='out/studies', sale_field='sale_price', trim_outliers=False, iqr_factor=1.5, trim_share=0.1, median_ci='bootstrap', standards=None, classes=None, region=None)
Run ratio and equity studies on value fields for every model group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sup
|
SalesUniversePair
|
Sales and universe, after the clean stage (or at least after model groups are tagged). |
required |
settings
|
dict
|
Settings dictionary. |
required |
fields
|
list[str]
|
Universe value fields to study, e.g. |
required |
location
|
str
|
Location field for the grouped vertical-equity quantiles. Defaults to the
first entry of |
None
|
start_date
|
date - like
|
Sales window. Defaults to the ratio-study look-back window ending at the valuation date. |
None
|
end_date
|
date - like
|
Sales window. Defaults to the ratio-study look-back window ending at the valuation date. |
None
|
confidence_interval
|
float
|
Confidence level for bootstrap intervals. Defaults to 0.90. |
0.9
|
max_trim
|
float
|
Maximum share of ratios trimmed for the trimmed statistics. Defaults to 0.05. |
0.05
|
outpath
|
str or None
|
Folder to write |
'out/studies'
|
sale_field
|
str
|
The price the values are compared with: |
'sale_price'
|
trim_outliers
|
bool
|
Also study each model group without its outlying ratios (outside |
False
|
iqr_factor
|
float
|
1.5 (outliers, the IAAO's usual) or 3.0 (extreme outliers only). |
1.5
|
trim_share
|
float
|
The most of a group trimmed (default 0.10; the exposure draft's Appendix C.5: no more than 10% under 30 sales, 20% in the most extreme cases; 5 to 10% for larger samples). |
0.1
|
median_ci
|
str
|
|
'bootstrap'
|
standards
|
dict
|
Targets to judge each study against ( |
None
|
classes
|
dict
|
Model group -> class ( |
None
|
region
|
str
|
A location field (a neighborhood, say): adds |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
|
Source code in openavmkit/value_studies.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | |