Performs the nonlinear least squares (NLS) regression method for the cosine model, with the proposed initialization for all the parameters. It fits the NLS method as required, and then computes different quantities for the birth seasonality estimates corresponding to different individuals.

makeFits_OLS(paths)

Arguments

paths

A list of data frames, where each frame contains the data for one individual. Every data frame should have two columns with names 'distance' and 'oxygen'.

Value

A data frame containing the following components:

amplitude

estimated amplitude

intercept

estimated intercept

x0

delay of the data

X

period of the data

birth

birth seasonality estimate

predictedMin

predicted minimum for the oxygen isotope variable

predictedMax

predicted maximum for the oxygen isotope variable

observedMin

observed minimum for the oxygen isotope variable

observedMax

observed minimum for the oxygen isotope variable

MSE

mean squared error corresponding to the model fit for every individual

Pearson

Pearson's R^2 corresponding to the model fit for every individual

Examples

armenia_split = split(armenia,f = armenia$ID) makeFits_OLS(armenia_split)
#> Warning: step factor 0.000488281 reduced below 'minFactor' of 0.000976562
#> amplitude intercept x0 X birth predictedMin #> 1 5.2652994 -4.248525 33.2708773 37.91834 0.87743496 -9.513825 #> 2 5.9191442 -5.714313 0.7847776 35.38069 0.02218096 -11.633457 #> 3 3.3246623 -6.738144 9.0470374 22.62969 0.39978616 -10.062806 #> 4 4.7367622 -5.509659 3.2810551 37.95713 0.08644108 -10.246421 #> 5 0.6991006 -4.026565 9.9913045 32.96120 0.30312318 -4.725665 #> 6 4.1794786 -5.118464 19.5194190 33.51158 0.58246789 -9.297942 #> 7 0.2239461 -9.845539 14.1014168 147.81603 0.09539843 -10.069485 #> 8 3.3367784 -6.145026 10.4120107 33.13023 0.31427521 -9.481804 #> 9 3.4307832 -6.294008 9.1121024 29.38078 0.31013816 -9.724792 #> 10 3.4624988 -6.380318 17.7009474 33.13923 0.53413878 -9.842817 #> 11 3.7993884 -6.301994 12.6856178 33.51424 0.37851425 -10.101382 #> 12 4.9377793 -7.423751 12.3397890 35.36795 0.34889751 -12.361531 #> 13 3.3731318 -5.604018 16.5363477 22.30952 0.74122376 -8.977150 #> 14 4.6807720 -6.338269 8.8111826 25.27949 0.34855063 -11.019041 #> 15 4.3225696 -8.183357 0.8511012 30.41354 0.02798428 -12.505927 #> 16 3.1195383 -6.700140 3.8342428 35.44646 0.10816997 -9.819679 #> 17 3.3664785 -6.120014 10.1234946 33.96788 0.29803139 -9.486493 #> 18 3.6488657 -5.760415 11.1946145 30.09531 0.37197210 -9.409281 #> 19 4.7475694 -7.322764 11.9597362 34.02146 0.35153508 -12.070334 #> 20 4.0274413 -7.389551 11.1089040 32.89129 0.33774612 -11.416993 #> 21 3.2221892 -6.548938 9.7099434 29.49489 0.32920766 -9.771127 #> 22 3.9674723 -5.180679 15.7330178 26.45066 0.59480626 -9.148151 #> 23 4.0093494 -5.498993 12.1927934 30.00242 0.40639365 -9.508343 #> 24 4.1528320 -5.817939 31.2651341 40.13802 0.77894059 -9.970771 #> predictedMax observedMin observedMax MSE Pearson #> 1 1.0167739 -9.28 -2.48 0.13712714 0.9897939 #> 2 0.2048314 -11.34 -0.09 0.10486315 0.9969164 #> 3 -3.4134819 -9.52 -2.42 0.24706940 0.9752471 #> 4 -0.7728966 -10.18 -0.69 0.17725811 0.9925065 #> 5 -3.3274640 -4.65 -2.90 0.20709011 0.7365597 #> 6 -0.9389852 -10.07 -0.47 0.60311759 0.9716171 #> 7 -9.6215924 -12.30 -6.22 3.35497392 0.7266128 #> 8 -2.8082472 -9.37 -1.90 0.47731459 0.9559358 #> 9 -2.8632250 -9.69 -3.15 0.09364418 0.9924722 #> 10 -2.9178194 -9.36 -2.36 0.21643700 0.9775559 #> 11 -2.5026056 -7.88 -2.47 0.07582879 0.9897773 #> 12 -2.4859720 -11.52 -2.73 0.08274287 0.9954652 #> 13 -2.2308865 -9.66 -2.88 0.58893347 0.9545514 #> 14 -1.6574971 -8.04 -1.92 0.19765941 0.9833570 #> 15 -3.8607874 -12.33 -3.89 0.19330565 0.9889660 #> 16 -3.5806022 -9.58 -3.19 0.12381115 0.9879239 #> 17 -2.7535356 -9.41 -2.89 0.12589665 0.9893759 #> 18 -2.1115496 -9.51 -2.22 0.15829539 0.9882583 #> 19 -2.5751950 -10.29 -2.56 0.26970116 0.9795975 #> 20 -3.3621102 -11.45 -3.59 0.10567727 0.9933704 #> 21 -3.3267489 -8.41 -3.51 0.03810623 0.9933530 #> 22 -1.2132066 -9.40 -1.41 0.10895676 0.9938152 #> 23 -1.4896439 -8.81 -1.52 0.32154728 0.9790757 #> 24 -1.6651069 -10.14 -2.93 0.17874849 0.9841492