Skip to contents

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.

Usage

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.2652999 -4.248525 33.2708787  37.91834 0.87743494    -9.513825
#> 2  5.9191441 -5.714313  0.7847780  35.38069 0.02218097   -11.633457
#> 3  3.3246622 -6.738144  9.0470374  22.62969 0.39978616   -10.062806
#> 4  4.7367622 -5.509659  3.2810551  37.95713 0.08644107   -10.246421
#> 5  0.6991006 -4.026565  9.9913043  32.96120 0.30312317    -4.725665
#> 6  4.1794786 -5.118464 19.5194191  33.51158 0.58246789    -9.297942
#> 7  0.2239310 -9.845523 14.1013203 147.79461 0.09541160   -10.069454
#> 8  3.3367784 -6.145026 10.4120108  33.13023 0.31427522    -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.53413879    -9.842817
#> 11 3.7993881 -6.301994 12.6856177  33.51424 0.37851427   -10.101382
#> 12 4.9377792 -7.423751 12.3397890  35.36795 0.34889751   -12.361530
#> 13 3.3731318 -5.604018 16.5363477  22.30952 0.74122376    -8.977150
#> 14 4.6807709 -6.338268  8.8111826  25.27949 0.34855069   -11.019039
#> 15 4.3225697 -8.183357  0.8511008  30.41354 0.02798427   -12.505927
#> 16 3.1195383 -6.700140  3.8342427  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.1946144  30.09531 0.37197210    -9.409281
#> 19 4.7475693 -7.322764 11.9597362  34.02146 0.35153509   -12.070334
#> 20 4.0274413 -7.389551 11.1089040  32.89129 0.33774612   -11.416993
#> 21 3.2221893 -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.1927933  30.00242 0.40639365    -9.508343
#> 24 4.1528322 -5.817939 31.2651352  40.13802 0.77894057    -9.970771
#>    predictedMax observedMin observedMax        MSE   Pearson
#> 1     1.0167750       -9.28       -2.48 0.13712714 0.9897939
#> 2     0.2048312      -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.35496827 0.7266062
#> 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.6574970       -8.04       -1.92 0.19765941 0.9833570
#> 15   -3.8607871      -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.1115497       -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.6651064      -10.14       -2.93 0.17874849 0.9841492