Git Product home page Git Product logo

fittingakmigration's Introduction

EDDIE'S R CODE FOR FITTING THE ROGERS-CASTRO MODEL MIGRATION SCHEDULE WITH WILSON'S STUDENT PEAK, 
APPLIED TO ALASKA 2011 TO 2015 OUT-MIGRATION (ANNUAL AND AVERAGE ANNUAL FOR THE PERIOD)

-----
STEPS: Everything is run with the R code in ReadRunWriteByYear.R

It relies on:

(1) the input data - SPMMSData_AKExample.csv

(2) the R code with the input starting parameters/parameter ranges (just best guesses) - 
InputParametersOrParameterRanges.R

(3) the R code for fitting - Fitting.R

Each of these three items that ReadRunWriteByYear.R relies on is linked through the Internet, 
so you should be able to simply select-all, copy and paste ReadRunWriteByYear.R into an R command 
line to make it work. 

CombinedPlots.pdf and CombinedPlots.gif is output plots from ReadRunWriteByYear.R, all combined

-----
REFERENCES:
-ORIGINAL CODE WITH NOTES IS AT https://applieddemogtoolbox.github.io/Toolbox/#MMSRCode 

-INFO ON THE MODEL MIGRATION SCHEDULE WITH STUDENT PEAK, SEE: Wilson, T. (2010). 
"Model migration schedules incorporating student migration peaks." Demographic Research, 23(8): 191โ€“222. 
AVAILABLE ONLINE: https://www.demographic-research.org/Volumes/Vol23/8/default.htm 
RELATED EXCEL WORKBOOK BY TOM WILSON (PROVIDED TERRIFIC INSTRUCTION): 
https://applieddemogtoolbox.github.io/Toolbox/#SPMMS

-ON THE ROGERS-CASTRO MODEL: Rogers A & Castro LJ (1981). Model Migration Schedules. 
IIASA Research Report. IIASA, Laxenburg, Austria: RR-81-030 
AVAILABLE ONLINE: http://pure.iiasa.ac.at/id/eprint/1543/

-----
SOME NOTES: I just used very broad possible parameter bounds to fit all to, and included all parameters 
(no matter overfitting etc), but ~fun to see/think about. 
All parameters/ranges I used are as given in InputParametersOrParameterRanges.R. 
It's very slow, and I'm thinking it could probably use some apply()'s and cleanup, and warning messages 
(esp for when bounds are not wide enough), plus review for problems/errors, but ~neat/fun in any case. 
Copies of the code with some application of and comparison to R's nls() and lm() functions, 
and to more ~plain Monte Carlo, are available here:
https://github.com/AppliedDemogToolbox/Hunsinger_SPMMSRCode/tree/master/FittingComparisons. 
In January 2022 I also added some comparison of results from other fitters (migraR and rcbayes) for the 2011to2015 average annual data. 
-Eddie Hunsinger, September 2018 (updated January 2022)

-----
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 International License.

fittingakmigration's People

Contributors

edyhsgr avatar

Watchers

James Cloos avatar Mark Snead avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.