UDST / pandana

Pandas Network Analysis by UrbanSim: fast accessibility metrics and shortest paths, using contraction hierarchies :world_map:
http://udst.github.io/pandana
GNU Affero General Public License v3.0
387 stars 83 forks source link

Exponential decay constant #128

Open rolocampusano opened 5 years ago

rolocampusano commented 5 years ago

Is there a way to change the lambda (exponential decay function) used in the exponential decay option in the aggregate module? I assume this is now set to be 1 by default, but there is no information about this in the docs.

In particular the exponential decay equation is as follow and the parameter I'm speaking of its called the exponential decay constant, and relates to how fast the decay is over space.

Thanks

knaaptime commented 5 years ago

you might look into this old example that includes a manual decay function.

not too sure, but you may be able to pass your own function to the current aggregate function. Unfortunately the anything_score utility from that notebook was removed some time ago (any chance we could get that back? 🙏)

rolocampusano commented 5 years ago

That would be great!! I second the request! :)

smmaurer commented 4 years ago

Following up on this issue, I tracked down the exponential decay equation.

It's defined in accessibility.cpp#L21-L24: exp(-1*distance/radius) * var. I'm adding this information to the docstring for network.aggregate(), along with some other notes from reading through the code.

Because the math happens on the C++ side, it would be difficult to accept custom decay functions -- but it looks pretty feasible to add more alternatives, or further parameterize them. PRs welcome!