Title: | Quality-of-Life Solver for "Measuring Quality of Life under Spatial Frictions" |
---|---|
Description: | This toolkit implements a numerical solution algorithm to invert a quality of life measure from observed data. Unlike the traditional Rosen-Roback measure, this measure accounts for mobility frictions—generated by idiosyncratic tastes and local ties — and trade frictions — generated by trade costs and non-tradable services, thereby reducing non-classical measurement error. The QoL measure is based on Ahlfeldt, Bald, Roth, Seidel (2024) <https://econpapers.repec.org/RePEc:boc:bocode:s459382> "Measuring Quality of Life under Spatial Frictions". When using this programme or the toolkit in your work, please cite the paper. |
Authors: | Gabriel M Ahlfeldt [cph, aut] (Humboldt University of Berlin), Fabian Bald [aut] (European University Viadrina), Duncan Roth [aut] (Institute for Employment Research), Tobias Seidel [aut] (University of Duisburg-Essen), Max von Mylius [trl, cre] (Humboldt University of Berlin) |
Maintainer: | Max von Mylius <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2024-12-07 06:57:57 UTC |
Source: | CRAN |
This toolkit implements a numerical solution algorithm to invert a quality of life (QoL) from observed data in various programming languages. The QoL measure is based on Ahlfeldt, Bald, Roth, Seidel (2024): Measuring quality of life under spatial frictions. Unlike the traditional Rosen-Roback measure, this measure accounts for mobility frictions—generated by idiosyncratic tastes and local ties—and trade frictions—generated by trade costs and non-tradable services, thereby reducing non-classical measurement error. When using this programme or the toolkit in your work, please cite the paper.
ABRSQOL( df, w = "w", p_H = "p_H", P_t = "P_t", p_n = "p_n", L = "L", L_b = "L_b", alpha = 0.7, beta = 0.5, gamma = 3, xi = 5.5, conv = 0.5, tolerance = 1e-10, maxiter = 10000 )
ABRSQOL( df, w = "w", p_H = "p_H", P_t = "P_t", p_n = "p_n", L = "L", L_b = "L_b", alpha = 0.7, beta = 0.5, gamma = 3, xi = 5.5, conv = 0.5, tolerance = 1e-10, maxiter = 10000 )
df |
input data containing variables refenced by following arguments: data.frame or matrix |
w |
wage index variable name or column index: character or integer (or list), default='w' |
p_H |
floor_space_price variable name or column index: character or integer, default='p_H' |
P_t |
tradable_goods_price variable name or column index: character or integer, default='P_t' |
p_n |
local_services_price variable name or column index: character or integer, default='p_n' |
L |
residence_population variable name or column index: character or integer, default='L' |
L_b |
hometown_population variable name or column index: character or integer, default='L_b' |
alpha |
Income share on non-housing consumtpion: double, default=0.7 |
beta |
Share of tradable goods in non-housing consumption: double, default=0.5 |
gamma |
Idiosyncratic taste dispersion (inverse labour supply elasticity): double, default=3 |
xi |
Valuation of local ties: double, default=5 |
conv |
Convergence parameter (Hgher value increases spead of, convergence and risk of bouncing): double, default=0.5 |
tolerance |
Value used in stopping rule (The mean absolute error (MAE). Smaller values imply greater precision and longer convergence): double, default=1e-10 |
maxiter |
Maximum number of iterations after which the algorithm is forced to stop: integer, default=1e4 |
Notice that quality of life is identified up to a constant. Therefore, the inverted QoL measures measure has a relative interpretation only. We normalize the QoL relative to the first observation in the data set. It is straightforward to rescale the QoL measure to any other location or any other value (such as the mean or median in the distribution of QoL across locations).
inverted quality of life measure as Numeric vector (identified up to a constant)
# Example 1: # load testdata, # run QoL inversion with default parameters and append result data(ABRSQOL_testdata) my_dataframe <- ABRSQOL_testdata my_dataframe$qol1 <- ABRSQOL(df=ABRSQOL_testdata) my_dataframe # Example 2: load your data from csv, run inversion, save result as csv # my_dataframe <- read.csv("path/to/your/csv_filename.csv") # my_dataframe$qol2 <- ABRSQOL( # # supply your dataset as a dataframe # df=my_dataframe, # # and specify the corresponding variable name for your dataset # w = 'wage', # p_H = 'floor_space_price', # P_t = 'tradable_goods_price', # p_n = 'local_services_price', # L = 'residence_pop', # L_b = 'L_b', # # freely adjust remaining parameters # alpha = 0.7, # beta = 0.5, # gamma = 3, # xi = 5.5, # conv = 0.3, # tolerance = 1e-11, # maxiter = 50000 #) #write.csv(my_dataframe, 'qol_of_my_data.csv' # Example 3: Reference variables in your dataset by using the column index my_dataframe$qol3 <- ABRSQOL( df=my_dataframe, w = 1, p_H = 3, P_t = 4, p_n = 2, L = 6, L_b = 5 ) # Example 4: Having named the variables in your data according to the # default parameters, you can ommit specifying variable names my_dataframe$qol4 <- ABRSQOL( df=my_dataframe, alpha = 0.7, beta = 0.5, gamma = 3, xi = 5.5, conv = 0.5 )
# Example 1: # load testdata, # run QoL inversion with default parameters and append result data(ABRSQOL_testdata) my_dataframe <- ABRSQOL_testdata my_dataframe$qol1 <- ABRSQOL(df=ABRSQOL_testdata) my_dataframe # Example 2: load your data from csv, run inversion, save result as csv # my_dataframe <- read.csv("path/to/your/csv_filename.csv") # my_dataframe$qol2 <- ABRSQOL( # # supply your dataset as a dataframe # df=my_dataframe, # # and specify the corresponding variable name for your dataset # w = 'wage', # p_H = 'floor_space_price', # P_t = 'tradable_goods_price', # p_n = 'local_services_price', # L = 'residence_pop', # L_b = 'L_b', # # freely adjust remaining parameters # alpha = 0.7, # beta = 0.5, # gamma = 3, # xi = 5.5, # conv = 0.3, # tolerance = 1e-11, # maxiter = 50000 #) #write.csv(my_dataframe, 'qol_of_my_data.csv' # Example 3: Reference variables in your dataset by using the column index my_dataframe$qol3 <- ABRSQOL( df=my_dataframe, w = 1, p_H = 3, P_t = 4, p_n = 2, L = 6, L_b = 5 ) # Example 4: Having named the variables in your data according to the # default parameters, you can ommit specifying variable names my_dataframe$qol4 <- ABRSQOL( df=my_dataframe, alpha = 0.7, beta = 0.5, gamma = 3, xi = 5.5, conv = 0.5 )
This is a test data set, and it is not identical to the data used in the paper. The data set includes average disposable household income as a measure of wage, the local labour market house price index from Ahlfeldt, Heblich, Seidel (2023), the 2015 census population as a measure of residence population and hte 1985 census population as measure of hometown population. Tradable goods price and local services price indices are uniformly set to one.
data(ABRSQOL_testdata)
data(ABRSQOL_testdata)
data.frame with colnames=c('llm_id','w','p_H','P_t','p_n','L','L_b', 'Name','coord_x','coord_y') and 141 observations
Gabriel M. Ahlfeldt, Fabian Bald, Duncan Roth, Tobias Seidel (forthcoming): Measuring quality of life under spatial frictions.
library('ABRSQOL') data(ABRSQOL_testdata) ABRSQOL_testdata$QoL = ABRSQOL(df=ABRSQOL_testdata) ABRSQOL_testdata
library('ABRSQOL') data(ABRSQOL_testdata) ABRSQOL_testdata$QoL = ABRSQOL(df=ABRSQOL_testdata) ABRSQOL_testdata