Closed rafapereirabr closed 3 years ago
First estimates, using a step decay function:
Conveyal documentation on decay functions is here. Those functions, beyond the step / cumulative opportunities function, are:
cutoff
value.decay constant
parameter.standard_deviation
parameter;width
parameter;I think we have two options:
decay_parameter
parameter that is passed to each function accordingly;I prefer exposing all decay functions and documenting what the parameter means in each case.
Regarding the figure you posted above, are all of these "no accessibility islands" snap-related? The image seems a bit weird to me. Had we calculated the travel time matrices manually and calculated accessibility within R, the resulting plot would be similar?
I would also prefer we expose all decay functions and create and decay
argument.
I agree the maps has quite a few unexpected blind spots. Perhaps we should calculate accessibility step-by-step in R and compare agains the R5 estimates.
Good points! The "inaccessible islands" of the previous maps happened because max_walk_dist
was set to just 300m. I've increased it to 1km and calculated accessibility again, using the two methods. Now the areas with "no accessibility" (dark grey on the maps below) are concentrated towards the southern edge of the city, which makes more sense.
The resulting maps look the same. I've also compared both data.frames, and the accessibility values are exactly the same as well. I believe that using a frequency-based GTFS and larger number of Monte Carlo draws, there will be some variation in travel times and accessibility values, but in this simple tests all values are equal.
Perfect. Thanks for looking into this, Marcus!Rafael H M Pereira -------- Original message --------From: Marcus Saraiva @.> Date: 5/14/21 14:42 (GMT-03:00) To: ipeaGIT/r5r @.> Cc: Rafael H M Pereira @.>, Author @.> Subject: Re: [ipeaGIT/r5r] Add function to calculate accessibility (#169) Good points! The "inaccessible islands" of the previous maps happened because max_walk_dist was set to just 300m. I've increased it to 1km and calculated accessibility again, using the two methods. Now the areas with "no accessibility" (dark grey on the maps below) are concentrated towards the southern edge of the city, which makes more sense.
The resulting maps look the same. I've also compared both data.frames, and the accessibility values are exactly the same as well. I believe that using a frequency-based GTFS and larger number of Monte Carlo draws, there will be some variation in travel times and accessibility values, but in this simple tests all values are equal.
—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.
Simple demonstration of the effects of all decay functions on accessibility. The title of each facet states the decay function used and the corresponding parameter value. In the case of step and exp, it's simply the travel time cutoff; the other functions were calculated with a cutoff of 30 min and the decay parameter stated in the facet.
Plots of the decay functions, for the record:
Travel times on the x axis, step and exponential functions using cutoff = 30
, fixed_exponential with decay = 0.001
, and logistic and linear using decay = 10
.
To-do:
decay_value
parameter: for fixed_exponential function, decay_value
must be between 0 and 1, for logistic and linear functions, decay_value
must be greater or equal to 1I've added some more documentation to the function but I think we still have to provide (1) intuitive explanations to the behavior of each decay function, (2) the equations of each decay function
@mvpsaraiva , I get the following error when I try to reproduce the example in the function:
library(r5r)
# build transport network
data_path <- system.file("extdata/poa", package = "r5r")
r5r_core <- setup_r5(data_path = data_path)
# load origin/destination points
points <- read.csv(file.path(data_path, "poa_hexgrid.csv"))
access <- accessibility(r5r_core,
origins = points,
destinations = points,
opportunities_colname = "schools",
mode = "WALK",
cutoffs = c(25, 30),
max_trip_duration = 30,
verbose = FALSE)
Error in get(opportunities_colname) : object 'schools' not found
The issue seems to be in this line. I've removed the get
from the data.table call and it seems to be working now. But sometimes it requires the get
, so I'm not quite sure what's going on.
Thanks! I've just added a test script for the accessibility()
function, commit 09e45870
Setting this issue as priority, to be incorporated in the next package release.
Although accessibility can be calculated from the travel time matrices produced by r5r, a dedicated accessibility function has many advantages:
Additionally, the new
accessibility()
function signature is very similar to that of thetravel_time_matrix()
function, with just a few differences:destinations
data.frame needs a newopportunities
columncutoffs
parameterdecay_function
parameter