GetWeightedPropMarginShifts

This application will find the weighted mean coordinates of all patches within the specified range margin, for each time step of the simulation, and calculates the change in position as the proportion of the distance from the mean of the metapopulation. That is, the application tracks the proportional movement of the weighted centroids of the range margins, where the weighting factors are the abundance of each patch within the margins.

Arguments

There are five mandatory arguments and four optional arguments to this application. Optional arguments are listed between brackets below:

MPFile Start_Year X | Y Threshold Delimiter [burn-in patch_abundance_threshold smoothing_method (sma | exp) window_size]

MPFile is the metapop file to process
Start_Year is the first year of the simulation. Each subsequent time-step is assumed to be one year after this
X | Y if X then the metapopulation movement will be tracked along the East-West axis, if Y the movement will be tracked along the North-South axis
Threshold is the proportion of the metapopulation that will be taken as the range margins. For example, if 0.1 is specified, then the most northerly and southerly ten percent of the population will be taken as the range margin.
Delimiter is the character used to delimit the fields in the outputs
burn-in is the number of years to ignore at the start of the simulation, if a "burn-in" period is being used
patch_abundance_threshold is the minimum abundance threshold, any patch with an abundance less than this will not be included in the calculations
smoothing_method is the method to use to smooth the time-series output by the application. Options are sma for simple moving average and exp for exponential smoothing
window_size is the number of years to include in the smoothing method. Although exponential smoothing doesn't strictly use a smoothing window, the application does use the window size to calculate the weighting factor

Outputs

The outputs of the application are the number of patches loaded, the number of years the simulation was run for, the initial coordinates of the centroid, and a time-series of the movements of the centroid per year of the simulation.

Examples

The command below measures the north-south range margin shiftsm using the most northerly and southerly ten percent of the metapopulation as the margins.

getweightedrangeshifts example.mp 2000 Y 0.1 ,

This yields the following output

Num patches loaded,358
Resolution(km),1
Total years,20
,,North,,South

,2000,0,0,2000,0,0
,2001,12.2413,0.806372,2001,1.6845,0.278679
,2002,16.5488,2.86686,2002,23.6717,0.00105875
,2003,10.3008,4.76719,2003,26.4806,0.464526
,2004,10.2755,7.65229,2004,16.8399,0.0331175
,2005,7.77017,9.18902,2005,36.9301,0.335337
,2006,10.7178,12.486,2006,24.1712,0.571593
,2007,31.5146,14.7458,2007,34.3557,0.714729
,2008,36.1496,16.4321,2008,63.0968,1.96416
,2009,10.8745,17.8165,2009,52.5308,3.23194
,2010,39.5802,19.231,2010,1.112,6.06514
,2011,65.0927,20.61,2011,35.2981,11.0969
,2012,75.3515,22.1291,2012,1.19908,18.6947
,2013,141.012,23.5966,2013,43.3137,24.3101
,2014,179.38,24.3329,2014,34.147,29.9004
,2015,181.119,24.471,2015,144.214,39.2462
,2016,174.491,24.6664,2016,244.455,45.0132
,2017,169.751,24.8054,2017,224.793,50.008
,2018,163.736,24.842,2018,244.399,53.2
,2019,166.763,24.9111,2019,232.208,52.7557


Applying a three-year burn-in with the following command:

getweightedrangeshifts example.mp 2000 Y 0.1 , 3

Yields the following output:

Num patches loaded,358
Resolution(km),1
Total years,17
Burn-in years,3
,,North,,South

,2003,0,0,2003,0,0
,2004,0.0220246,2.81428,2004,11.7068,0.410599
,2005,2.19918,4.3133,2005,12.6891,0.76128
,2006,18.2656,7.52935,2006,2.80433,0.98614
,2007,36.3385,9.73369,2007,9.56292,1.12237
,2008,40.3664,11.3786,2008,108.776,2.31153
,2009,0.498552,12.729,2009,95.9452,3.51816
,2010,25.4444,14.1088,2010,30.8056,6.21469
,2011,47.6153,15.4539,2011,75.0192,11.0037
,2012,56.5304,16.9357,2012,30.6999,18.235
,2013,113.591,18.3673,2013,20.4408,23.5796
,2014,146.934,19.0854,2014,30.757,28.9002
,2015,148.445,19.2202,2015,185.83,37.7951
,2016,142.684,19.4108,2016,307.556,43.284
,2017,138.566,19.5464,2017,283.679,48.0379
,2018,133.338,19.5821,2018,307.487,51.0759
,2019,135.969,19.6495,2019,292.684,50.653

Patches with abundances less the five are filtered out as follows:

getweightedrangeshifts example.mp 2000 Y 0.1 , 3 5

which gives us:

Num patches loaded,358
Patch size threshold,5
Num patches after cleaning,203
Resolution(km),1
Total years,17
Burn-in years,3
,,North,,South

,2003,0,0,2003,0,0
,2004,8.41567,2.48534,2004,0.571247,0.00210905
,2005,10.1219,3.93621,2005,32.485,0.126616
,2006,26.8711,7.23154,2006,13.6786,0.0592531
,2007,45.4383,9.27682,2007,34.289,0.120026
,2008,43.1843,10.7976,2008,64.5837,1.34746
,2009,7.07875,12.0717,2009,57.3836,2.55766
,2010,15.9674,13.4385,2010,3.65922,5.28333
,2011,36.6864,14.7765,2011,38.3615,10.1622
,2012,45.2507,16.2551,2012,5.74234,18.2548
,2013,104.805,17.7975,2013,79.1026,27.3895
,2014,128.198,18.3932,2014,29.1996,32.4515
,2015,130.406,18.5049,2015,135.663,37.2445
,2016,124.96,18.6968,2016,238.656,43.3752
,2017,121.016,18.8347,2017,214.55,48.2665
,2018,115.255,18.8677,2018,229.287,50.3566
,2019,117.481,18.9223,2019,218.877,49.9153


Finally, applying exponential smoothing with a window size of three:

getweightedrangeshifts example.mp 2000 Y 0.1 , 3 5 exp 3

Num patches loaded,358
Patch size threshold,5
Num patches after cleaning,203
Resolution(km),1
Total years,17
Burn-in years,3
Exponential smoothing window,3
,,North,,South

,2003,0,0,2003,0,0
,2004,5.26376,2.3038,2004,0.691064,0.00256786
,2005,8.73741,4.1895,2005,17.197,0.0617517
,2006,18.7377,6.79902,2006,15.9268,0.0595807
,2007,32.8982,9.13823,2007,25.7284,0.0894676
,2008,38.8664,11.077,2008,19.4378,0.72996
,2009,24.0374,12.6908,2009,38.3749,1.66698
,2010,5.25278,14.1889,2010,20.6386,3.5246
,2011,14.3615,15.6147,2011,29.3429,6.93989
,2012,28.394,17.0755,2012,17.1774,12.7719
,2013,64.7921,18.5859,2013,53.0329,20.3433
,2014,94.5323,19.6425,2014,57.0202,26.7088
,2015,110.492,20.2272,2015,41.8638,32.3343
,2016,115.785,20.6166,2016,143.459,38.2714
,2017,116.485,20.8811,2017,182.05,43.7328
,2018,113.993,21.03,2018,208.808,47.5287
,2019,113.846,21.1321,2019,216.916,49.2018



Back to RAMAS Metapop Tools main page.


Maintained by Dr Michael J. Watts