Skip to main content

16 - Dynamic Rental Pricing: Elasticity and Guardrails

A naive regression estimates an elasticity ten times too small: a simulator shows the error, the guardrails and what the competition rules say.

What do you think about this article?

16 - Dynamic Rental Pricing: Elasticity and Guardrails
PropTechfedericocalo.dev

At a Glance

A naive regression estimates an elasticity ten times too small: a simulator shows the error, the guardrails and what the competition rules say.

"How much can I raise the rent before the flats stand empty?"

The question is simple and the answer that looks obvious is wrong. If you look at the historical data of a portfolio of flats, you will see that in the months when the rent was higher the inquiries were also more numerous: the agency raises prices in summer, when demand is high, and the chart seems to say that raising the price makes demand grow. The elasticity, that is by how much demand falls for each percentage point of price increase, estimated this way is almost zero. The true one, in a simulator where I fix it at −1.2, is more than ten times larger. This article shows how one would be fooled, how to correct what can be corrected, how to put a brake (the guardrails) on a pricing rule that could still be wrong, and what the texts I read say about the use of pricing software shared among landlords.

First, the perimeter. The data are synthetic: 300 invented flats, generated with a fixed seed; every figure below is the output of the simulator and describes the simulator, not the market. There is no market figure and no "+X% revenue" to take home. The part on the rules is a reading of official documents with the date of consultation, not legal advice, and I state in the text what I could not verify. How a home is valued is in another article, on property valuation; whether a model on prices is auditable, and the risk that an area acts as a proxy, is in the one on privacy and fair housing.

A simulator where the right answer is known

The only way to know whether an estimate is wrong is to know the answer. The simulator generates, for each flat and each week, the inquiries received with a formula in which the true elasticity is a number written in the code (EPS = -1.2). Then it reproduces what an agency does: it raises the price by a fraction that depends on the season (0.25 * s_t) and, slightly, on the local events that only it knows (0.03 * h_t). Two hidden causes move price and demand together, and this is confounding: the season and the quality of the flat (better flats cost more and receive more inquiries).

The rest of the listing is three estimators, all least squares on the logarithm (numpy.linalg.lstsq), and a bootstrap. In the log-log form the coefficient of the price is read as elasticity: a 10% increase with elasticity −1.2 brings inquiries to 1.1−1.2 = about 0.89 of the starting value, that is about −10.8%. Estimator 1 is the one everybody writes first: log q on log p, a single line. Estimator 2 adds the season and removes the mean of each flat (fixed effects), so the quality level does not dirty the estimate. Estimator 3 adds the local events too, which in the real world you would not see. The interval is a bootstrap: it resamples whole flats 1,000 times with replacement, because the weeks of the same flat are correlated and resampling them one by one would give an interval that is too narrow.

Simulator with a known true elasticity and three estimators compared
"""Rental demand simulator with a KNOWN TRUE elasticity. All data are synthetic.
Model (for listing i and week t):
  log q = log(LAMBDA0) + EPS * log(p/800) + GAMMA * s_t + u_i + h_t + noise      (q = weekly inquiries)
  p     = base_i * exp(0.25 * s_t + 0.03 * h_t + price_noise)                     (the agency raises prices in high season)
  expected vacancy = exp(-THETA * true_q)                                          (weeks without a tenant)
"""
import numpy as np

EPS, GAMMA, LAMBDA0, THETA = -1.2, 0.8, 23.0, 0.10   # EPS is the quantity to recover
N, T_TRAIN = 300, 104

def season(t):                         # +1 in midsummer (week 26), -1 in midwinter
    return np.sin(2 * np.pi * (t - 13) / 52)

def units(rng):
    base = 800 * np.exp(rng.normal(0, 0.3, N))
    quality = 0.5 * np.log(base / 800) + rng.normal(0, 0.2, N)   # better flats cost more AND earn more
    return base, quality

def year(rng, base, quality, weeks, price=None):
    s = season(np.asarray(weeks))[None, :]
    h = rng.normal(0, 0.3, len(weeks))[None, :]                   # local events: the agency sees them, we do not
    if price is None:
        price = base[:, None] * np.exp(0.25 * s + 0.03 * h + rng.normal(0, 0.10, (N, len(weeks))))
    true_log_q = (np.log(LAMBDA0) + EPS * np.log(price / 800) + GAMMA * s + quality[:, None] + h)
    return dict(s=np.broadcast_to(s, price.shape), h=np.broadcast_to(h, price.shape),
                lp=np.log(price / 800), price=price, true_log_q=true_log_q)

def observed(rng, d):                   # what the analyst sees: the true demand plus measurement noise
    return d['true_log_q'] + rng.normal(0, 0.3, d['lp'].shape)

def estimate(y, regressors, unit_effects):
    """Least squares. With unit_effects=True it removes the mean of each listing (fixed effects)."""
    X = np.stack(regressors, axis=-1)                           # (N, T, k)
    if unit_effects:
        X = X - X.mean(axis=1, keepdims=True); y = y - y.mean(axis=1, keepdims=True)
    else:
        X = np.concatenate([np.ones(X.shape[:2] + (1,)), X], axis=-1)
    beta = np.linalg.lstsq(X.reshape(-1, X.shape[-1]), y.reshape(-1), rcond=None)[0]
    return beta[0] if unit_effects else beta[1]                 # the first column is always log-price

def bootstrap(y, regressors, unit_effects, rng, B=1000):
    """95% interval: whole LISTINGS are resampled (the weeks of one listing are not independent)."""
    out = []
    for _ in range(B):
        idx = rng.integers(0, N, N)
        out.append(estimate(y[idx], [r[idx] for r in regressors], unit_effects))
    return np.percentile(out, [2.5, 97.5])

if __name__ == '__main__':
    rng = np.random.default_rng(20261112)
    base, quality = units(rng)
    d = year(rng, base, quality, np.arange(T_TRAIN))
    y = observed(rng, d)
    print(f'listings={N} weeks={T_TRAIN} rows={y.size}  true_elasticity={EPS}')
    print(f'correlation between log-price and season: {np.corrcoef(d["lp"].ravel(), d["s"].ravel())[0,1]:.2f}')
    cases = [('1 naive: log q on log p', [d['lp']], False),
             ('2 with season and listing', [d['lp'], d['s']], True),
             ('3 with local events too', [d['lp'], d['s'], d['h']], True)]
    for name, reg, fe in cases:
        e = estimate(y, reg, fe); lo, hi = bootstrap(y, reg, fe, rng)
        print(f'{name:34s} estimate={e:+.3f}  CI95%=[{lo:+.3f}, {hi:+.3f}]  contains the true one: {lo <= EPS <= hi}')

# Output:
# listings=300 weeks=104 rows=31200  true_elasticity=-1.2
# correlation between log-price and season: 0.50
# 1 naive: log q on log p            estimate=-0.104  CI95%=[-0.184, -0.012]  contains the true one: False
# 2 with season and listing          estimate=-0.926  CI95%=[-0.970, -0.882]  contains the true one: False
# 3 with local events too            estimate=-1.203  CI95%=[-1.236, -1.170]  contains the true one: True

The output is the instructive part. The naive estimate is −0.104, with a 95% interval of [−0.184, −0.012]: very far from −1.2 but, note, precise. Controlling for season and flat brings it to −0.926, with an even narrower interval, [−0.970, −0.882], which does not contain the true value. Only the third model, which knows the local events, recovers −1.203 with interval [−1.236, −1.170]. The bootstrap measures how much the estimate would change with another sample, not how wrong it is: a systematic error (bias) with a lot of data produces a narrow interval around the wrong value. That is why row 2 is the most useful warning: having controlled for everything you can see is not enough if there is a factor you cannot see that moves both price and demand.

Note also the first line of the output: the correlation between log-price and season is 0.50. It is the signal, recognisable in real data, that the agency raises prices when demand is high. With a correlation like that, a regression with no control is not a prudent estimate: it is the measurement of something else. In real data you do not know the value to recover, so the practical question is whether there are price variations that do not depend on demand (A/B tests on the rent, differences between identical flats in the same building) on which to base the estimate.

The guardrail: a pure function that no model can override

A wrong estimate cannot be ruled out, so the pricing rule derived from it needs limits that hold anyway. The guardrail lives in a single function, in whole euros: if the lease is in force it returns the current rent (the rent of a lease in force is not modified); otherwise it brings the model's target inside the interval [floor, ceiling] and moves towards it by at most one percentage step (step_bps, in basis points, that is hundredths of a percentage point, with at least one euro). It is pure: it depends only on its arguments, so it can be tested exhaustively.

Price guardrail and property test on 20,000 cases
"""Price guardrail: a PURE function, in whole euros, with properties checked on random cases."""
import random

def next_price(current, target, floor, ceiling, step_bps, under_lease):
    if under_lease:                               # the rent of a lease in force is not touched
        return current
    aimed = min(max(target, floor), ceiling)      # the model's target, brought inside the limits
    step = max(1, current * step_bps // 10000)    # maximum change per step (at least 1 euro)
    if aimed > current:
        return min(aimed, current + step)
    return max(aimed, current - step)

def mutant_without_limits(current, target, floor, ceiling, step_bps, under_lease):
    """Same function but without the clamp to floor and ceiling: it shows whether the tests notice."""
    if under_lease:
        return current
    step = max(1, current * step_bps // 10000)
    return min(target, current + step) if target > current else max(target, current - step)

def properties(f, cases=20000, seed=7):
    rnd = random.Random(seed)
    broken = {}
    for _ in range(cases):
        flo = rnd.randint(300, 900); cei = rnd.randint(flo + 1, 2500)
        cur = rnd.randint(flo, cei); tgt = rnd.randint(1, 4000)
        bps = rnd.choice([1, 50, 500, 2000]); lease = rnd.random() < 0.2
        new = f(cur, tgt, flo, cei, bps, lease)
        aimed = min(max(tgt, flo), cei)
        checks = {
            'P1 lease in force: unchanged':          (not lease) or new == cur,
            'P2 step within the limit':              lease or abs(new - cur) <= max(1, cur * bps // 10000),
            'P3 stays between floor and ceiling':    flo <= new <= cei,
            'P4 approaches the target, not beyond':  lease or min(cur, aimed) <= new <= max(cur, aimed),
        }
        for name, ok in checks.items():
            if not ok: broken[name] = broken.get(name, 0) + 1
    return broken

def convergence(seed=7, cases=2000):
    """Repeating the step reaches the aimed price in a finite number of steps (even with a 1-euro step)."""
    rnd = random.Random(seed); most = 0
    for _ in range(cases):
        flo = rnd.randint(300, 900); cei = rnd.randint(flo + 1, 2500); cur = rnd.randint(flo, cei)
        aimed = min(max(rnd.randint(1, 4000), flo), cei); p = cur; n = 0
        while p != aimed:
            p = next_price(p, aimed, flo, cei, rnd.choice([50, 500]), False); n += 1
            if n > 5000: raise AssertionError('does not converge')
        most = max(most, n)
    return most

if __name__ == '__main__':
    print('example: current 800, target 1100, step 5%, limits 640-1040 ->',
          next_price(800, 1100, 640, 1040, 500, False))
    print('same case with a lease in force ->', next_price(800, 1100, 640, 1040, 500, True))
    print('properties broken by the function:', properties(next_price) or 'none', '(20,000 cases with a fixed seed)')
    print('properties broken by the mutant without limits:', properties(mutant_without_limits))
    print('maximum steps to reach the aimed price (2,000 cases):', convergence())

# Output:
# example: current 800, target 1100, step 5%, limits 640-1040 -> 840
# same case with a lease in force -> 800
# properties broken by the function: none (20,000 cases with a fixed seed)
# properties broken by the mutant without limits: {'P3 stays between floor and ceiling': 1601, 'P4 approaches the target, not beyond': 1601}
# maximum steps to reach the aimed price (2,000 cases): 74

The first example in the output: with rent 800, target 1,100, a 5% step and limits 640-1,040, the next price is 840, because the maximum step is 40 euro and the target, already clamped to 1,040, is further away. With a lease in force it stays at 800. The properties checked on random cases (fixed seed, 20,000 cases) are four: the lease in force does not change, the step does not exceed the limit, the price stays between floor and ceiling, and the target is not overshot once it is reached. The function breaks none of them.

To be sure that the tests are useful, I wrote a variant without the clamp to floor and ceiling: the tests reject it in 1,601 cases out of 20,000, both on the limit and on the approach to the target. The last line says that, repeating the step, the aimed price is reached in at most 74 steps over 2,000 cases: without the minimum of one euro the step, for low rents and small percentages, would be zero and the price would never move.

Backtest: the same rule with three different estimates

The rule tries to answer the initial question: for each flat and week it looks for the highest price for which the vacancy predicted by the model stays below 15% (a threshold chosen for the example, not a market fact) and hands it to the guardrail. I consider the conversion from inquiries to vacancy (exp(-THETA * q), with THETA = 0.10) as known: in practice it would have to be estimated from rental outcomes, and it is another source of uncertainty. I try five rules on a new year of the same simulator, with the same flats and new local events. Vacancy and revenue are expected values according to the true model, with no further random draws.

Five price rules on a new year, with naive, corrected and true estimates
"""Backtest: price rules built on the estimates of simulate.py, tried on a NEW year of the same simulator."""
import numpy as np
from simulate import EPS, GAMMA, LAMBDA0, THETA, N, T_TRAIN, season, units, year, observed
from guardrail import next_price

V_TARGET = 0.15                  # "at most 15% of empty weeks": a choice of the example, not a market fact
L_STAR = -np.log(V_TARGET)       # exp(-THETA*q) <= 15%  <=>  THETA*q >= L_STAR

def target_price(intercept, eps, gamma, s_t):
    """The highest price for which the EXPECTED vacancy stays below the target. If the estimate says that demand
    does not fall with price (eps >= 0) the model sets no limits: the rule asks for an enormous price and the guardrail decides."""
    if eps >= 0:
        return 10**9
    return 800 * np.exp((intercept + gamma * s_t - np.log(L_STAR / THETA)) / (-eps))

def path(intercept, eps, gamma, base, weeks, flo, cei, bps):
    p = np.round(base).astype(int); out = np.zeros((N, len(weeks)))
    for j, t in enumerate(weeks):
        for i in range(N):
            tg = int(min(target_price(intercept[i], eps, gamma, season(t)), 10**9))
            p[i] = next_price(int(p[i]), tg, int(flo * base[i]), int(cei * base[i]), bps, False)
        out[:, j] = p
    return out

def evaluate(dn, quality, price):
    """EXPECTED vacancy and revenue according to the true model (no extra random draws)."""
    log_q = np.log(LAMBDA0) + EPS * np.log(price / 800) + GAMMA * dn['s'] + quality[:, None] + dn['h']
    vac = np.exp(-THETA * np.exp(log_q))
    return price.mean(), vac.mean(), (price * (1 - vac)).mean(), (vac > V_TARGET).mean()

rng = np.random.default_rng(20261112)
base, quality = units(rng)
d = year(rng, base, quality, np.arange(T_TRAIN)); y = observed(rng, d)

# Estimate 1, naive: a single line for all listings.
a_naive, eps_naive = np.linalg.lstsq(np.stack([np.ones(y.size), d['lp'].ravel()], 1), y.ravel(), rcond=None)[0]
# Estimate 2, with season and listing: removes the mean of each listing, then regresses on log-price and season.
X = np.stack([d['lp'], d['s']], -1); Xc = X - X.mean(1, keepdims=True); yc = y - y.mean(1, keepdims=True)
eps_ctrl, gamma_ctrl = np.linalg.lstsq(Xc.reshape(-1, 2), yc.reshape(-1), rcond=None)[0]
alpha = (y - eps_ctrl * d['lp'] - gamma_ctrl * d['s']).mean(1)         # the demand level of each listing
print(f'estimates: naive eps={eps_naive:+.3f}   with season and listing eps={eps_ctrl:+.3f}   (true {EPS})')

weeks = np.arange(T_TRAIN, T_TRAIN + 52)                               # a new year, same listings, new local events
dn = year(rng, base, quality, weeks)
rules = [
  ('A agency: price follows the season',                   dn['price']),
  ('B naive estimate, guardrails 0.8-1.5 and 5%/wk',        path(np.full(N, a_naive), eps_naive, 0.0, base, weeks, 0.8, 1.5, 500)),
  ('C naive estimate, wide guardrails 0.3-3.0 and 50%',     path(np.full(N, a_naive), eps_naive, 0.0, base, weeks, 0.3, 3.0, 5000)),
  ('D season and listing, guardrails 0.8-1.5 and 5%',       path(alpha, eps_ctrl, gamma_ctrl, base, weeks, 0.8, 1.5, 500)),
  ('E true parameters (reference), same guardrails',        path(np.log(LAMBDA0) + quality, EPS, GAMMA, base, weeks, 0.8, 1.5, 500))]
print(f'{"rule":52s} {"mean rent":>12s} {"vacancy":>8s} {"revenue/wk":>13s} {"weeks with vacancy >15%":>23s}')
for name, price in rules:
    p, v, r, q = evaluate(dn, quality, price)
    print(f'{name:52s} {p:12.0f} {v:8.1%} {r:13.0f} {q:23.1%}')

# Output:
# estimates: naive eps=-0.104   with season and listing eps=-0.926   (true -1.2)
# rule                                                    mean rent  vacancy    revenue/wk weeks with vacancy >15%
# A agency: price follows the season                            862    13.9%           742                   35.2%
# B naive estimate, guardrails 0.8-1.5 and 5%/wk               1233    25.8%           899                   59.1%
# C naive estimate, wide guardrails 0.3-3.0 and 50%            2490    50.2%          1197                   95.3%
# D season and listing, guardrails 0.8-1.5 and 5%               967    16.4%           819                   42.6%
# E true parameters (reference), same guardrails                960    16.1%           816                   42.2%

The rows are read together. The agency (A) sits at a mean rent of 862 euro and 13.9% vacancy. The rule with the naive estimate and the normal guardrails (B) believes that demand hardly falls with price, so it always pushes the price towards the ceiling: 1,233 euro and 25.8% vacancy, almost double the target. With wide guardrails (C) the damage is seen in full: mean rent 2,490 and vacancy 50.2%. The rule with the corrected estimate (D) obtains 16.4% vacancy, close to the 15% target and to the 16.1% of the rule with the true parameters (E): it does not quite reach it because its elasticity estimate, −0.926, is still smaller than the true one, and because local events shift demand and the rule does not see them (the right-hand column says that in over 42% of the weeks the vacancy exceeds 15% even for the rule with the true parameters).

One thing has to be said clearly: weekly revenue rises with vacancy (742 for A, 819 for D, 899 for B, 1,197 for C), because in the simulator an empty flat costs nothing beyond the lost income and demand responds little to price near the initial level. If the criterion were expected revenue, the most wrong rule would "win". The constraint on vacancy is not a result of the data, it is a product choice: it says how much empty-flat risk the owner accepts, which is why I put it as a target and not as a consequence. The guardrails do not correct the model: they limit the damage (B against C) and leave to whoever decides the responsibility for the limit.

What the texts say about competition rules

So far the rule uses only data of its own: the inquiries and prices of its flats, the calendar. A real pricing software often does more: it uses the data of other landlords. On this there are public proceedings and official texts that I read at the source on 2026-11-12. The state of the proceedings changes, so I report what the documents say with the dates, and not what I think the law says.

  • Article 101(1) TFEU (English text from the Official Journal of the Union, 2016): agreements between undertakings, decisions by associations of undertakings and concerted practices which have as their object or effect the prevention, restriction or distortion of competition are prohibited as incompatible with the internal market, in particular those which directly or indirectly fix purchase or selling prices.
  • Eturas judgment, case C-74/14, 21 January 2016: if the administrator of a common booking system sends a message warning of a cap on discounts and the system is then modified accordingly, the travel agencies that were aware of the message can be presumed to take part in a concerted practice, unless they publicly distance themselves from it, report it to the authorities or provide other evidence to the contrary. The mere sending of the message, however, is not enough to show that the recipients knew of it.
  • Commission Guidelines on horizontal cooperation, 2023/C 259/01: information exchange can take place indirectly, through a third party such as a service provider, a platform, an online tool or an algorithm (point 368); undertakings cannot escape responsibility because an algorithm determined the prices, as it remains under the control of the undertaking (point 379).
  • Sherman Act, section 1 (15 U.S.C. 1): every contract, combination or conspiracy in restraint of trade among the States or with foreign nations is declared illegal.

These four texts share the same idea: technology does not change who is responsible, and independence in deciding one's own prices is the protected good. Points 368 and 374 of the Guidelines add that adapting intelligently to the already observed behaviour of competitors is lawful, whereas direct or indirect contact that influences their conduct or reveals intentions is not. What changes in practice is where the inputs of your rule come from: your own data and public data are one thing, the non-public data of other landlords, collected through the same provider, are another.

The best-known proceeding is American. On 2024-08-23 the United States Department of Justice and eight States filed a civil action against a rental pricing software provider, alleging that competing landlords shared non-public, sensitive information with the provider and that the software generated rent recommendations based on those of competitors; the action invoked sections 1 and 2 of the Sherman Act. These are allegations contained in a party's filing, not findings.

In the documents I read the proceeding is moving by settlements: on 2025-11-24 the Department filed a proposed settlement with the provider that, if approved by the court, would require it among other things not to use competitors' non-public information in the software, in operation, to determine rents, to limit the training of models to historical data at least 12 months old, not to use models with geographic effects narrower than a State and to remove the features that limited price decreases.

For two of the defendant landlords I read the proposed final judgments (filed on 2026-07-06 and 2026-09-04, with notice in the Federal Register on 2026-07-16 and 2026-09-18): the second, the one of September, prohibits using pricing software that relies on competitors' sensitive data and sharing such data with other landlords, and imposes a compliance programme; the first, the one of July, provides for a monitor appointed by the court.

What I do not know. The case page on the Department's site, consulted on 2026-11-12, lists for the provider the proposed final judgment of 2025-11-24 and not a final judgment; I have not verified whether the court has meanwhile approved it. I have not read a ruling that establishes anyone's liability. For Italy I have not read the text of the national rules on competition and on residential leases (I could not open it from a primary source), and I do not summarise them: that piece should be asked of a lawyer. I have found and cited no source on the spread of this software in the Italian market.

What changes in the design of the rule

Three choices arise from this reading and do not depend on how it is interpreted. First, the provenance of the inputs has to be declared and recorded: for each price recommendation it must be possible to say from which data it was computed, and that data must be your own or public. Second, the guardrail with the ban on touching a rent in force is a product rule, not just prudence: its pure function can be put under audit together with the model, as is done for valuation and for model fairness. Third, the rule proposes and a person decides: a system that applies every price recommendation by itself does not shift the responsibility, which according to the Guidelines remains with the undertaking even when an algorithm computes the price. The property management agent described in the article on autonomous property management follows the same scheme, in which the model advises and the code decides.

Where it fits in the series

Here we estimate the response of demand to price; the value of the property as a point estimate is in the article on property valuation, and the check that a model on prices does not discriminate by proxy is in privacy and compliance.

Previous in the series: 15. Listing Events: Outbox, Offsets and Exactly-Once.

What you can do now

You can recognise why a regression of demand on price goes wrong when the seller raises prices in good periods, and you can control for the causes you see with the season and with fixed effects. You know that a narrow confidence interval does not guarantee a right estimate, and that the hidden part of confounding is not removed with more data. You can write a guardrail as a pure function and test it with random properties, and you have seen how it limits the damage of a wrong estimate without correcting it. You also know where the conclusions of the simulator end and where the competition rules begin, with the documents to read and what has not been verified.

Sources

The three Python listings (3.14 with NumPy 2.3.5) were run on 2026-11-12 in the order simulate, guardrail, backtest, with a fixed seed; the backtest imports the other two. The data are synthetic and every figure is the output of the simulator. For the regulatory sources: the texts of the Union were read in the English version, downloaded from the copy of the Publications Office of the European Union (publications.europa.eu), because EUR-Lex answers direct requests with an anti-robot check; the Italian statute text was not read and is not cited. I read the pages of the Department of Justice with a browser, because the site answers direct requests with an anti-robot check.

Try These Tools

Free developer tools related to this topic.

Commenti

Caricamento commenti...

Sign in to comment

New articles and tools on Telegram too

The Telegram channel flags the site's new articles and tools.

Did you like this article?

Explore other content on the blog or discover my projects