Quantcast

Gravity (spatial interaction) models in R

classic Classic list List threaded Threaded
2 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Gravity (spatial interaction) models in R

Melanie Murphy
Hi All,
 
I am constructing "gravity" (spatial interaction) models in R for
ecological application.  I have linearized the unconstrained model and
solved using OLS.  However, I would like to do some further, more
in-depth, analyses.
 
1)     Is there an R package actually designed for gravity models?  I
have done several searches on the CRAN site with no luck.  My preference
would be to use R for this manuscript versus commercially available
software.  
2)     I would like to estimate my linearized unconstrained model using
maximum likelihood.  This may be a simple solution, but I have yet to
figure out how to do this (my apologies if this is something I should
have been able to figure out on my own).
3)     For a production (origin) constrained model, I can linearize the
equation as in the unconstrained model.  The models are similar, accept
I need to estimate a constant (k) for each origin, but with only one
estimate of the remaining parameters.  Any ideas on how to
operationalize this?  I have tried exploring options with multiple
regression, but am not finding a solution with the appropriate
mechanics.  This would also be an ML estimate.  
4)     Any feedback/experience from people who have used gravity models
in R and/or ecological application would be appreciated.
5)     I have tried to keep this posting as brief as possible.  Please
let me know if you need further information to answer my questions.
 
Thank you all in advance
 
 
Melanie Murphy
EPA-STAR Fellow
School of Biological Sciences
Washington State University
e-mail: [hidden email]
 

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Gravity (spatial interaction) models in R

Ben Bolker-3
Melanie Murphy wrote:

> Hi All,
>  
> I am constructing "gravity" (spatial interaction) models in R for
> ecological application.  I have linearized the unconstrained model and
> solved using OLS.  However, I would like to do some further, more
> in-depth, analyses.
>  
> 1)     Is there an R package actually designed for gravity models?  I
> have done several searches on the CRAN site with no luck.  My preference
> would be to use R for this manuscript versus commercially available
> software.  
> 2)     I would like to estimate my linearized unconstrained model using
> maximum likelihood.  This may be a simple solution, but I have yet to
> figure out how to do this (my apologies if this is something I should
> have been able to figure out on my own).
    See the mle (stats4) and mle2 (bbmle package on CRAN) functions --
if you can write a function for the (negative log-)likelihood, these
functions will minimize it and provide wrappers for computing
likelihood ratio tests, profile confidence intervals, etc. etc..

> 3)     For a production (origin) constrained model, I can linearize the
> equation as in the unconstrained model.  The models are similar, accept
> I need to estimate a constant (k) for each origin, but with only one
> estimate of the remaining parameters.  Any ideas on how to
> operationalize this?  I have tried exploring options with multiple
> regression, but am not finding a solution with the appropriate
> mechanics.  This would also be an ML estimate.  

    Don't know quite enough about this to answer, but wouldn't
this just be equivalent to ANCOVA with parallel slopes?
(i.e., something like lm(z~origin+distance), where distance
is distance from (any) source?

> 4)     Any feedback/experience from people who have used gravity models
> in R and/or ecological application would be appreciated.
> 5)     I have tried to keep this posting as brief as possible.  Please
> let me know if you need further information to answer my questions.

    More detail might not hurt for those of us who aren't terribly
familiar with gravity models.  The functions mentioned above
(mle, mle2) are very general, but NOT necessarily efficient
or stable or avoiding multiple minima for particular kinds of complex
problems -- that's why the special-purpose gravity model tools
might work better (if they were available) ...

    Some of the people who work on gravity models in epidemiology
(Bjornstad, Ferrari, et al) use R a lot, but I don't know if they
have developed special-purpose tools.

   Ben Bolker



_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

signature.asc (260 bytes) Download Attachment
Loading...