Python 64.6%
TeX 23.3%
HTML 11.6%
Makefile 0.5%
1% ==========================================================================2\section{Methodology}3\label{sec:methodology}4% ==========================================================================56\subsection{Hedonic Price Function}7\label{subsec:hedonic}89Let $p_i$ denote the displayed nightly price of listing $i$ and10$\mathbf{x}_i$ the vector of its observed characteristics. Following11\citet{Rosen1974}, the hedonic price function $P(\cdot)$ maps12characteristics into prices, and we approximate it by the semi-logarithmic13form that dominates the housing and short-term rental literatures14\citep{Malpezzi2003, Sirmans2005, WangNicolau2017}:15\begin{equation}16\ln p_i = \alpha17 + \boldsymbol{\beta}_S' \mathbf{S}_i18 + \boldsymbol{\beta}_A' \mathbf{A}_i19 + \boldsymbol{\beta}_H' \mathbf{H}_i20 + \boldsymbol{\beta}_L' \mathbf{L}_i21 + \mu_{c(i)}22 + \eps_i ,23\label{eq:hedonic}24\end{equation}25where $\mathbf{S}_i$ collects the structural variables ($\ln$ bedrooms,26$\ln(1+\text{bathrooms})$, $\ln$ guest capacity, a shared-bathroom27indicator, a studio indicator and five title-category indicators with28\emph{Rental unit} as the reference), $\mathbf{A}_i$ the listing-level29presentation variables ($\ln(1+\text{amenities})$, $\ln(1+\text{photos})$,30pets allowed), $\mathbf{H}_i$ the host and reputation variables (Superhost,31Guest Favourite, $\ln(1+\text{reviews})$, a rated indicator and the32centred rating interacted with it), $\mathbf{L}_i$ the location variables33($\ln(1+\text{km to the nearest centre})$ and $\ln(1+\text{listings within341 km})$), and $\mu_{c(i)}$ a fixed effect for the city or spatial cell35$c(i)$ in which the listing is located. The error $\eps_i$ is mean zero36conditional on the regressors but is allowed to be heteroskedastic and37spatially correlated within cities.3839The semi-logarithmic form has three consequences for interpretation. For40a continuous regressor entered in logarithms the coefficient is an41elasticity. For a continuous regressor in levels, such as the rating,42$100\,\beta$ is the approximate percentage change in price per unit. For43an indicator variable the percentage premium is44\begin{equation}45g = 100\left[\exp\!\left(\hat{\beta} - \tfrac{1}{2}\widehat{\Var}(\hat{\beta})\right) - 1\right],46\label{eq:kennedy}47\end{equation}48the \citet{Kennedy1981} correction of the \citet{HalvorsenPalmquist1980}49transformation, which removes the small-sample bias of50$\exp(\hat{\beta}) - 1$ and is the form we report in the text. The51coefficients in Equation~\eqref{eq:hedonic} are conditional associations52between characteristics and asking prices in a cross-section; they are53not marginal willingness to pay, which would require the stronger54assumptions discussed by \citet{Kuminoff2010} and \citet{Bishop2020}, nor55realised transaction prices.5657\subsection{Specifications and Inference}58\label{subsec:specs}5960We estimate Equation~\eqref{eq:hedonic} by ordinary least squares in five61nested specifications: M1 contains the structural block only; M2 adds the62presentation block; M3 the host and reputation block; M4 the two location63variables; and M5 the city fixed effects. Cities with at least 15 listings64in the analysis sample receive their own effect; the remaining listings,65which are scattered across several hundred small municipalities, are66grouped into 25 spatial cells obtained by $k$-means clustering of their67projected coordinates, so that every listing belongs to exactly one68fixed-effect group. The fixed effects absorb all between-city variation in69prices, including tourism demand, seasonality of the local market and70regulation, and the remaining coefficients are identified from71within-city variation.7273Standard errors are heteroskedasticity-robust (HC3,74\citealp{MacKinnonWhite1985}) in all specifications. Because the75regressors of neighbouring listings are correlated and the error term is76likely to be spatially correlated, we also report standard errors77clustered by fixed-effect group for M5 \citep{CameronMiller2015}, and we78re-estimate M5 with 60 finer spatial cells as the fixed-effect unit in the79robustness section. Multicollinearity among the capacity variables is80monitored through variance inflation factors, and block significance is81assessed with robust $F$ tests.8283\subsection{Quantile Regression}84\label{subsec:quantile_methods}8586To examine whether implicit prices differ between budget and premium87listings we estimate the conditional quantile function of88\citet{KoenkerBassett1978},89\begin{equation}90Q_\tau(\ln p_i \mid \mathbf{x}_i) = \alpha_\tau + \boldsymbol{\beta}_\tau' \mathbf{x}_i + \mu_{c(i),\tau},91\qquad \tau \in \{0.10, 0.25, 0.50, 0.75, 0.90\},92\label{eq:quantile}93\end{equation}94with the full M5 regressor set, by minimising the check-function loss95$\sum_i \rho_\tau(\ln p_i - \alpha_\tau - \boldsymbol{\beta}_\tau'\mathbf{x}_i - \mu_{c(i),\tau})$,96$\rho_\tau(u) = u\,(\tau - \mathbf{1}\{u<0\})$97\citep{KoenkerHallock2001}. Standard errors use the kernel estimate of the98sparsity function. Goodness of fit is the Koenker--Machado pseudo-$R^2$,99one minus the ratio of the minimised loss to the loss of the100unconditional quantile. Because the coefficients at different quantiles101are estimated from the same sample, differences between the102$\tau = 0.90$ and $\tau = 0.10$ coefficients are tested with a paired103bootstrap of 100 replications in which both quantile regressions are104re-estimated on each resample.105106\subsection{Spatial Econometric Models}107\label{subsec:spatial_methods}108109Listings cluster in space and their prices may depend on neighbours'110prices or on spatially correlated unobservables. We construct a111row-standardised $k$-nearest-neighbour weights matrix $\mathbf{W}$112($k = 5$, with $k = 10$ as a check) from coordinates projected to113kilometres, so that the anisotropy of degrees of longitude at Quebec's114latitude does not distort distances, and we test the OLS residuals of M4115and M5 for spatial autocorrelation with Moran's $I$,116\begin{equation}117I = \frac{N}{\sum_i \sum_j w_{ij}}\,118 \frac{\sum_i \sum_j w_{ij}\,\hat{u}_i \hat{u}_j}{\sum_i \hat{u}_i^2},119\label{eq:moran}120\end{equation}121with inference from 999 random permutations. We then estimate by maximum122likelihood \citep{Anselin1988, LeSagePace2009} the spatial lag model123(SAR), the spatial error model (SEM) and the spatial Durbin model (SDM),124\begin{align}125\text{SAR:}\quad & \ln \mathbf{p} = \rho\,\mathbf{W}\ln\mathbf{p} + \mathbf{X}\boldsymbol{\beta} + \boldsymbol{\eps}, \label{eq:sar}\\126\text{SEM:}\quad & \ln \mathbf{p} = \mathbf{X}\boldsymbol{\beta} + \mathbf{u}, \qquad \mathbf{u} = \lambda\,\mathbf{W}\mathbf{u} + \boldsymbol{\eps}, \label{eq:sem}\\127\text{SDM:}\quad & \ln \mathbf{p} = \rho\,\mathbf{W}\ln\mathbf{p} + \mathbf{X}\boldsymbol{\beta} + \mathbf{W}\mathbf{X}\boldsymbol{\theta} + \boldsymbol{\eps}, \label{eq:sdm}128\end{align}129using the M4 regressor set, since the city fixed effects and the spatial130lag compete for the same between-city variation. The SDM nests the SAR131($\boldsymbol{\theta} = \mathbf{0}$) and the SEM132($\boldsymbol{\theta} = -\rho\boldsymbol{\beta}$), and we use a133likelihood-ratio test of the first restriction \citep{Elhorst2010}.134135In models with a spatial lag the coefficients are not marginal effects.136Writing $\mathbf{S}_k(\mathbf{W}) = (\mathbf{I} - \rho\mathbf{W})^{-1}(\mathbf{I}\beta_k + \mathbf{W}\theta_k)$137for regressor $k$ (with $\theta_k = 0$ in the SAR), the average direct138effect is $N^{-1}\,\mathrm{tr}\,\mathbf{S}_k(\mathbf{W})$, the average139total effect is $N^{-1}\,\boldsymbol{\iota}'\mathbf{S}_k(\mathbf{W})\boldsymbol{\iota}$,140and the indirect (spillover) effect is their difference141\citep{LeSagePace2009}. We compute the three summary measures exactly142from the dense inverse and obtain their standard errors from 300 draws143of the parameters from their estimated asymptotic distribution.144145\subsection{Machine Learning Benchmarks and Interpretation}146\label{subsec:ml_methods}147148The log-linear form imposes additive, constant implicit prices. To149measure how much predictive accuracy this restriction costs we compare150the M5 specification with an elastic net \citep{ZouHastie2005}, a random151forest \citep{Breiman2001}, gradient boosting \citep{Friedman2001},152XGBoost \citep{ChenGuestrin2016} and LightGBM, all trained on the same153regressors, including the fixed-effect indicators. Performance is154measured out of sample by five-fold cross-validation in two designs:155random folds, which is the usual benchmark, and spatially blocked folds in156which the 20 spatial clusters of listings are assigned to folds as whole157blocks \citep{Roberts2017}. The second design asks whether a model trained158on some areas predicts prices in areas it has never seen, which is the159relevant question for an automated valuation tool and a stricter test of160generalisation when observations are spatially dependent. We report the161out-of-sample $R^2$, root mean squared error and mean absolute error on the162log scale and the median absolute percentage error (MdAPE) on the price163scale, $\operatorname{median}_i |\exp(\hat{y}_i) - p_i| / p_i$. The164first version of this paper reported a mean absolute percentage error165computed on log prices, which is not interpretable as a price error and166is not used here.167168The best learner is interpreted with SHAP values \citep{Lundberg2017},169computed exactly for tree ensembles \citep{Lundberg2020}. For a prediction170$\hat f(\mathbf{x}_i)$ the SHAP values $\phi_{ik}$ satisfy171$\hat f(\mathbf{x}_i) = \phi_0 + \sum_k \phi_{ik}$ with172$\phi_0 = \E[\hat f]$, and the mean absolute value173$\overline{|\phi_k|} = N^{-1}\sum_i |\phi_{ik}|$ ranks features by their174average contribution to predicted log prices. SHAP values describe the175fitted model, not the data-generating process; they are attribution176weights for associations captured by the learner and carry no causal177content.178179\subsection{Identifying the Nightly-Price Regime}180\label{subsec:mixture_methods}181182Section~\ref{sec:data} shows that the displayed price field mixes183nightly prices with total prices of multi-night stays. A price threshold184separates the two regimes imperfectly because the stay total of a cheap185listing can fall below the threshold while the nightly price of a large186chalet can exceed it. We therefore model the regime explicitly with a187two-component mixture of hedonic regressions with common slopes,188\begin{equation}189\ln p_i = \mathbf{x}_i'\boldsymbol{\beta} + \delta\, z_i + \eps_i,190\qquad \eps_i \mid z_i \sim \mathcal{N}(0, \sigma^2_{z_i}),191\qquad \Pr(z_i = 1 \mid \mathbf{w}_i) = \Lambda(\mathbf{w}_i'\boldsymbol{\gamma}),192\label{eq:mixture}193\end{equation}194where $z_i = 1$ indicates the stay regime, $\delta$ is the log of the195typical stay length that the displayed price covers, the regime-specific196variance allows stay lengths to vary across listings, and the regime197probability depends through a logistic link on characteristics198$\mathbf{w}_i$ (Montreal location, review count, capacity, Superhost199status and the hotel and chalet categories) that the descriptive analysis200identifies as predictors of the second mode. The model is estimated by201the EM algorithm, initialised at the \$1,000 rule; the E-step computes202the posterior probability $\hat p_i = \Pr(z_i = 1 \mid \ln p_i,203\mathbf{x}_i, \mathbf{w}_i)$ and the M-step updates204$(\boldsymbol{\beta}, \delta)$ by weighted least squares on the stacked205data, $(\sigma_0, \sigma_1)$ from the weighted residuals and206$\boldsymbol{\gamma}$ by a weighted logistic regression. Listings with207$\hat p_i < 0.5$ constitute the analysis sample used in all subsequent208estimation; the robustness section varies the cut-off, re-weights by209$1 - \hat p_i$ and compares with the simple price-threshold rules.210