CRAN Package Check Results for Package bentcableAR

Last updated on 2015-02-28 19:51:00.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 0.2.3 0.68 25.09 25.77 ERROR
r-devel-linux-x86_64-debian-gcc 0.2.3 0.67 24.36 25.02 NOTE
r-devel-linux-x86_64-fedora-clang 0.2.3 44.81 ERROR
r-devel-linux-x86_64-fedora-gcc 0.2.3 27.61 ERROR
r-devel-osx-x86_64-clang 0.2.3 26.88 ERROR
r-devel-windows-ix86+x86_64 0.2.3 2.00 39.00 41.00 NOTE
r-patched-linux-x86_64 0.2.3 0.76 28.00 28.76 NOTE
r-patched-solaris-sparc 0.2.3 340.30 NOTE
r-patched-solaris-x86 0.2.3 69.70 NOTE
r-release-linux-ix86 0.2.3 0.99 34.55 35.54 NOTE
r-release-linux-x86_64 0.2.3 0.76 27.92 28.68 NOTE
r-release-osx-x86_64-mavericks 0.2.3 NOTE
r-release-windows-ix86+x86_64 0.2.3 2.00 44.00 46.00 NOTE
r-oldrel-windows-ix86+x86_64 0.2.3 2.00 41.00 43.00 NOTE

Check Details

Version: 0.2.3
Check: R code for possible problems
Result: NOTE
    cable.Sig.ar.p: warning in ar(w.vect, aic = FALSE, order = p, demean =
     TRUE, method = method): partial argument match of ‘order’ to
     ‘order.max’
    cable.Sig.ar.p: warning in acf(w.vect, plot = FALSE, lag = p, demean =
     TRUE): partial argument match of ‘lag’ to ‘lag.max’
    cable.ar.p.iter: warning in nls(formula = y.vect ~ fullcable.t(t.vect,
     b0, b1, b2, tau, gamm), trace = TRUE, alg = "plinear", start =
     list(b0 = init[1], b1 = init[2], b2 = init[3], tau = init[4], gamm =
     init[5])): partial argument match of ‘alg’ to ‘algorithm’
    cable.ar.p.iter: warning in nls(formula = y.vect ~ fullcable.t(t.vect,
     b0, b1, b2, tau, gamm), trace = TRUE, alg = "port", start = list(b0 =
     init[1], b1 = init[2], b2 = init[3], tau = init[4], gamm = init[5])):
     partial argument match of ‘alg’ to ‘algorithm’
    stick.ar.0: warning in nls(formula = y.vect ~ fullcable.t(t.vect, b0,
     b1, b2, tau, 0), alg = "plinear", start = list(b0 = init.vect[1], b1
     = init.vect[2], b2 = init.vect[3], tau = init.vect[4]), trace =
     TRUE): partial argument match of ‘alg’ to ‘algorithm’
    stick.ar.0: warning in nls(formula = y.vect ~ fullcable.t(t.vect, b0,
     b1, b2, tau, 0), alg = "port", start = list(b0 = init.vect[1], b1 =
     init.vect[2], b2 = init.vect[3], tau = init.vect[4]), trace = TRUE):
     partial argument match of ‘alg’ to ‘algorithm’
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-osx-x86_64-clang, r-devel-windows-ix86+x86_64, r-patched-linux-x86_64, r-patched-solaris-sparc, r-patched-solaris-x86, r-release-linux-ix86, r-release-linux-x86_64, r-release-osx-x86_64-mavericks, r-release-windows-ix86+x86_64, r-oldrel-windows-ix86+x86_64

Version: 0.2.3
Check: examples
Result: ERROR
    Running examples in ‘bentcableAR-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: bentcable.ar
    > ### Title: Bent-Cable Regression for Independent and Autoregressive Data
    > ### Aliases: bentcable.ar bentcable.dev.plot
    > ### Keywords: dplot ts models regression nonlinear
    >
    > ### ** Examples
    >
    > data(stagnant)
    > data(sockeye)
    >
    > # Scenario (1)
    > ##############
    >
    > # independent non-time-series cable:
    > bentcable.dev.plot( seq(-1,1,length=20),
    + seq(.1,1,length=20), stagnant$loght, stagnant$logflow )
    $dev
     [,1] [,2] [,3] [,4] [,5] [,6]
     [1,] -117.05447 -116.43716 -115.63155 -114.684983 -113.579186 -112.348486
     [2,] -112.64195 -112.17114 -111.57246 -110.798723 -109.847303 -108.646800
     [3,] -107.58152 -107.23212 -106.73113 -105.904060 -104.868583 -103.628113
     [4,] -102.11772 -101.45622 -100.57129 -99.565386 -98.448299 -97.162042
     [5,] -94.23719 -93.43085 -92.53318 -91.581552 -90.505941 -89.329388
     [6,] -82.72481 -82.72481 -82.54131 -81.977599 -81.108449 -80.026601
     [7,] -71.59723 -71.49189 -71.05152 -70.470553 -69.761202 -68.697489
     [8,] -61.42922 -60.14754 -58.76077 -57.260743 -55.735022 -54.263703
     [9,] -47.04724 -45.42968 -43.36083 -41.091676 -38.781114 -36.643487
    [10,] -26.84378 -25.16270 -23.28916 -21.105982 -18.559936 -15.999016
    [11,] -18.02230 -14.71052 -11.21406 -7.756144 -4.401552 -1.845292
    [12,] -30.91542 -28.42625 -25.38923 -22.080570 -18.704993 -15.649832
    [13,] -49.90812 -48.00381 -45.89161 -43.392255 -40.651124 -37.855445
    [14,] -65.85466 -64.45794 -62.67570 -60.705449 -58.567897 -56.355058
    [15,] -78.23132 -77.55239 -76.47469 -75.148048 -73.389888 -71.246574
    [16,] -90.56902 -89.91696 -88.74317 -87.239033 -85.483017 -83.317922
    [17,] -102.11930 -100.92584 -99.50588 -97.692256 -95.549261 -93.091738
    [18,] -111.08625 -109.91103 -108.30898 -106.356737 -103.994577 -101.307289
    [19,] -117.90411 -116.64734 -115.05164 -113.102098 -110.725112 -108.055417
    [20,] -122.50627 -121.34433 -119.87226 -117.969105 -115.910061 -113.735320
     [,7] [,8] [,9] [,10] [,11] [,12]
     [1,] -111.0089399 -109.50380 -107.8543102 -106.068804 -104.155896 -102.124982
     [2,] -107.2150077 -105.56755 -103.7084675 -101.658658 -99.497577 -97.242765
     [3,] -102.1624405 -100.49388 -98.6337334 -96.587688 -94.355560 -91.927454
     [4,] -95.7345059 -94.16618 -92.4119612 -90.454088 -88.282907 -85.911098
     [5,] -88.0318056 -86.52995 -84.8337072 -82.971638 -80.901019 -78.607975
     [6,] -78.7393603 -77.27491 -75.6539030 -73.835916 -71.822696 -69.664221
     [7,] -67.3651401 -65.86727 -64.2174775 -62.492199 -60.775733 -58.998606
     [8,] -52.8743258 -51.46727 -50.0309496 -48.599322 -47.296703 -46.121755
     [9,] -34.7224243 -33.12614 -32.0926800 -31.454794 -31.277042 -31.528731
    [10,] -13.7658444 -12.23429 -11.8441198 -12.574317 -14.338536 -16.764437
    [11,] -0.4064017 0.00000 -0.5403004 -2.031931 -4.483549 -7.799618
    [12,] -13.0361698 -11.11552 -10.2745647 -10.437267 -11.466453 -13.059784
    [13,] -35.0336934 -32.47236 -30.3060669 -28.418003 -27.058508 -26.169886
    [14,] -53.9502372 -51.34728 -48.5878280 -45.699399 -42.713179 -39.628509
    [15,] -68.8283141 -66.12207 -63.0459614 -59.637413 -55.921348 -51.922816
    [16,] -80.7477068 -77.78565 -74.4575786 -70.836282 -66.894417 -62.616547
    [17,] -90.3343917 -87.26264 -83.8707045 -80.139631 -76.192175 -72.112802
    [18,] -98.3327074 -95.09123 -91.7456628 -88.291107 -84.716612 -80.991316
    [19,] -105.1845739 -102.16700 -99.0522054 -95.822727 -92.497759 -89.068889
    [20,] -111.2957836 -108.66745 -105.8373445 -102.847146 -99.753992 -96.549625
     [,13] [,14] [,15] [,16] [,17] [,18] [,19]
     [1,] -99.98634 -97.75130 -95.43203 -93.02749 -90.52309 -87.91493 -85.21942
     [2,] -94.90563 -92.48001 -89.95190 -87.32399 -84.60664 -81.77741 -78.83771
     [3,] -89.37520 -86.72868 -83.98831 -81.13268 -78.17008 -75.09430 -71.97767
     [4,] -83.32016 -80.48328 -77.49677 -74.40118 -71.28474 -68.15541 -65.00734
     [5,] -76.09858 -73.37192 -70.50160 -67.45657 -64.31387 -61.23778 -58.27366
     [6,] -67.42236 -65.05730 -62.58268 -60.04214 -57.47795 -54.95162 -52.52628
     [7,] -57.17865 -55.36826 -53.65790 -52.06691 -50.58476 -49.19892 -47.89281
     [8,] -45.23977 -44.61842 -44.15686 -43.84181 -43.66265 -43.61267 -43.67521
     [9,] -32.18145 -33.10958 -34.27423 -35.65375 -37.09021 -38.54663 -39.98653
    [10,] -19.44893 -22.35346 -25.41128 -28.46431 -31.42548 -34.28008 -36.80263
    [11,] -11.78569 -16.04455 -20.14328 -24.03264 -27.53624 -30.63020 -33.37454
    [12,] -15.13063 -17.60022 -20.14228 -22.73545 -25.23702 -27.62569 -29.89098
    [13,] -25.43987 -24.85953 -24.51049 -24.49444 -24.84251 -25.59201 -26.65050
    [14,] -36.65082 -33.89827 -31.34191 -28.99346 -27.01304 -25.72326 -25.19577
    [15,] -47.78701 -43.50229 -39.31263 -35.55658 -32.27729 -29.53337 -27.39736
    [16,] -58.13449 -53.51743 -48.94377 -44.47625 -40.20765 -36.35178 -32.96208
    [17,] -67.91924 -63.59347 -59.14330 -54.54652 -49.95192 -45.45788 -41.12386
    [18,] -77.08584 -73.02704 -68.86385 -64.56419 -60.14464 -55.57942 -50.96488
    [19,] -85.52252 -81.83403 -77.97007 -73.93623 -69.80077 -65.52916 -61.13867
    [20,] -93.24451 -89.84088 -86.32136 -82.66799 -78.84489 -74.84113 -70.73050
     [,20]
     [1,] -82.41680
     [2,] -75.78760
     [3,] -68.85284
     [4,] -61.91516
     [5,] -55.53430
     [6,] -50.37951
     [7,] -46.67480
     [8,] -43.82247
     [9,] -41.37647
    [10,] -38.92984
    [11,] -35.83199
    [12,] -32.02139
    [13,] -28.06966
    [14,] -25.46240
    [15,] -25.94581
    [16,] -30.09330
    [17,] -37.16991
    [18,] -46.44641
    [19,] -56.60710
    [20,] -66.48888
    
    $tau
     [1] -1.00000000 -0.89473684 -0.78947368 -0.68421053 -0.57894737 -0.47368421
     [7] -0.36842105 -0.26315789 -0.15789474 -0.05263158 0.05263158 0.15789474
    [13] 0.26315789 0.36842105 0.47368421 0.57894737 0.68421053 0.78947368
    [19] 0.89473684 1.00000000
    
    $gamma
     [1] 0.1000000 0.1473684 0.1947368 0.2421053 0.2894737 0.3368421 0.3842105
     [8] 0.4315789 0.4789474 0.5263158 0.5736842 0.6210526 0.6684211 0.7157895
    [15] 0.7631579 0.8105263 0.8578947 0.9052632 0.9526316 1.0000000
    
    >
    > # zoom in to global max
    > dev0 <- bentcable.dev.plot( seq(-.04,.16,length=20),
    + seq(.2,.65,length=20), stagnant$loght, stagnant$logflow )
    > # locally smooth deviance surface
    >
    > cable <- bentcable.ar( stagnant$loght, tgdev=dev0, t.vect=stagnant$logflow )
    *******************************
    WARNING:
    Cannot estimate CTP correctly
    unless 't.vect' is c(0,1,2,...)
    *******************************
    *****************************************
    Finding initial values for AR(0) cable...
    *****************************************
    *******************************
    Finding best AR(0) cable fit...
    *******************************
    Trying 'nls()' Gauss-Newton algorithm...
    0.004823871 : 0.57083966 -0.39695082 -0.66845925 0.05473684 0.43684211
    0.004821113 : 0.56936590 -0.39833046 -0.66608038 0.05573005 0.42889019
    0.004821103 : 0.56929818 -0.39839465 -0.66597876 0.05579035 0.42846509
    0.004821103 : 0.5692938 -0.3983988 -0.6659720 0.0557938 0.4284415
    Converged!
    ******************************************
    If you have time-series data, then
    choose your p according to AIC and PACF...
    ******************************************
    p.aic
     1
    ************************************************
    Please apply 'coef()[1:5]' to the '$fit' element
    of the returned AR(0) fit as initial values for
    subsequent AR(p) fits.
    ************************************************
    > # ignore time-series diagnostics
    > # local regularity - expect to be true best fit
    > # SSE=0.005
    > # feed 'cable' in Scenario (3) to get fitted plot:
    > # bentcable.ar( cable$y, init.cable=coef(cable$fit),
    > # t.vect=cable$t )
    >
    >
    > # AR(0) stick, start time at 80:
    > dev0 <- bentcable.dev.plot( seq(85,97,length=15), 0,
    + sockeye$logReturns, sockeye$year, TRUE ) # obvious global max
    Ignoring 'gamma.vect'...
    > stick0 <- bentcable.ar( sockeye$logReturns, tgdev=dev0, stick=TRUE,
    + t.vect=sockeye$year )
    *******************************
    WARNING:
    Cannot estimate CTP correctly
    unless 't.vect' is c(0,1,2,...)
    *******************************
    *****************************************
    Finding initial values for AR(0) stick...
    *****************************************
    *******************************
    Finding best AR(0) stick fit...
    *******************************
    Trying 'nls()' Gauss-Newton algorithm...
    8.855402 : 11.74864017 0.01895696 -0.52337353 91.85714286
    8.854106 : 11.59544591 0.02078887 -0.52236001 91.79705775
    8.854106 : 11.59544199 0.02078892 -0.52236005 91.79694060
    Converged!
    ******************************************
    If you have time-series data, then
    choose your p according to AIC and PACF...
    ******************************************
    4
    ************************************************
    Please apply 'coef()[1:4]' to the '$fit' element
    of the returned AR(0) fit as initial values for
    subsequent AR(p) fits.
    ************************************************
    > # local regularity - should be true best fit
    > # SSE=8.85
    > # diagnostics: take p=0 to 4 ??
    >
    > # AR(0) cable, start at time 0:
    > bentcable.dev.plot( seq(1,20,length=25),
    + seq(.1,15,length=25), sockeye$logReturns )
    $dev
     [,1] [,2] [,3] [,4] [,5] [,6]
     [1,] -14.8542755 -14.3954994 -14.0645472 -13.7296305 -13.3995231 -13.0261837
     [2,] -14.0882713 -13.9058218 -13.6462005 -13.2992263 -12.8893862 -12.2754372
     [3,] -13.5744117 -13.5097217 -13.2061330 -12.7359463 -12.0850417 -11.3125483
     [4,] -13.0296690 -12.9670556 -12.5147834 -11.8765019 -11.0841380 -10.2473500
     [5,] -12.1454658 -11.8546210 -11.3745030 -10.7235663 -9.9789351 -9.1802568
     [6,] -10.2655598 -10.0714048 -9.8107448 -9.3477880 -8.7704833 -8.1012704
     [7,] -8.1420432 -8.1159215 -8.0042442 -7.8085187 -7.4506505 -6.9767255
     [8,] -6.4408533 -6.4238967 -6.3341677 -6.2200386 -6.0546154 -5.7474160
     [9,] -5.1181483 -5.0844715 -4.9681118 -4.8331650 -4.6357445 -4.3911195
    [10,] -4.0982581 -4.0214982 -3.8766350 -3.6129202 -3.3398632 -3.0943740
    [11,] -3.3541826 -3.1052669 -2.8292795 -2.5422434 -2.2539073 -1.9679354
    [12,] -2.0306273 -2.0170086 -1.8689281 -1.6219978 -1.3487579 -1.1478542
    [13,] -1.1141399 -1.0969298 -0.9896522 -0.8739928 -0.7610758 -0.6890907
    [14,] -0.6151815 -0.5500794 -0.4895990 -0.5058424 -0.5742000 -0.5979810
    [15,] -0.5208001 -0.6070772 -0.7104199 -0.7744645 -0.7836093 -0.7558453
    [16,] -1.8186753 -1.7378033 -1.6786739 -1.5588515 -1.3725880 -1.1206601
    [17,] -3.6275465 -3.5005648 -3.1348823 -2.6718676 -2.1943269 -1.6478859
    [18,] -5.1643729 -5.0855866 -4.5875339 -3.9270961 -3.0848691 -2.3344681
    [19,] -6.3592052 -6.1860127 -5.7041637 -4.9247351 -4.1482365 -3.4401101
    [20,] -7.3122443 -6.8019312 -6.3248238 -5.8924609 -5.4447871 -4.9102456
    [21,] -6.8764338 -7.0823185 -7.2312099 -7.1711004 -6.8886143 -6.2083765
    [22,] -9.1385886 -9.0590608 -9.0308574 -8.7908063 -8.0357725 -7.2382954
    [23,] -13.3425121 -13.1917337 -11.8405771 -10.2284605 -9.1448004 -8.2583808
    [24,] -17.4009324 -16.4643195 -14.5283430 -12.4442877 -10.6215504 -9.4024143
    [25,] -17.4009324 -17.4009324 -16.9141534 -15.0769407 -13.0133246 -11.0625229
     [,7] [,8] [,9] [,10] [,11] [,12]
     [1,] -12.4566909 -11.7504049 -10.9406899 -10.10070097 -9.2674035 -8.4554737
     [2,] -11.5345652 -10.7104081 -9.8696655 -9.04155215 -8.2372249 -7.4700875
     [3,] -10.4791779 -9.6398009 -8.8174187 -8.02214318 -7.2659902 -6.5337714
     [4,] -9.4114407 -8.5952339 -7.8101252 -7.06479165 -6.3309336 -5.5943390
     [5,] -8.3746039 -7.6010946 -6.8637600 -6.12749372 -5.3959637 -4.6923847
     [6,] -7.3907990 -6.6614729 -5.9236150 -5.19971172 -4.5042254 -3.8399873
     [7,] -6.3925449 -5.7161458 -5.0061058 -4.31860218 -3.6622114 -3.0773802
     [8,] -5.2882994 -4.7374796 -4.1281074 -3.49489861 -2.9334316 -2.4737995
     [9,] -4.0986066 -3.7046007 -3.2448054 -2.78750786 -2.3764116 -2.0419412
    [10,] -2.8561012 -2.6395708 -2.4102202 -2.18405473 -1.9577852 -1.7276331
    [11,] -1.7740929 -1.6776209 -1.6666674 -1.64509955 -1.5703440 -1.4385038
    [12,] -1.0270503 -1.0092007 -1.0501441 -1.11558950 -1.1495334 -1.0933579
    [13,] -0.6597058 -0.6357028 -0.6278556 -0.64416851 -0.6507780 -0.6493054
    [14,] -0.5600786 -0.4839764 -0.3848471 -0.25481259 -0.1946969 -0.2689497
    [15,] -0.6495016 -0.4640932 -0.2150648 -0.04265475 0.0000000 -0.1265711
    [16,] -0.8252920 -0.4905319 -0.2385039 -0.11223809 -0.1224464 -0.1464096
    [17,] -1.1082927 -0.7420687 -0.5531791 -0.46189825 -0.3329056 -0.2120602
    [18,] -1.7731505 -1.3931276 -1.1172352 -0.82958293 -0.5751570 -0.3765783
    [19,] -2.8695548 -2.3237376 -1.7445054 -1.26202910 -0.9091506 -0.6400248
    [20,] -4.1457161 -3.2749804 -2.5260080 -1.89821011 -1.3812715 -0.9942799
    [21,] -5.3182803 -4.4016015 -3.5038172 -2.71938988 -2.0599230 -1.5108823
    [22,] -6.4394769 -5.5685744 -4.6538963 -3.74301334 -2.9223880 -2.2298346
    [23,] -7.4602377 -6.6614941 -5.8156112 -4.90640526 -3.9912874 -3.1350507
    [24,] -8.4915690 -7.6812101 -6.8780975 -6.05790196 -5.1586416 -4.2419776
    [25,] -9.6820574 -8.7338558 -7.8993145 -7.09786391 -6.2938691 -5.4101388
     [,13] [,14] [,15] [,16] [,17] [,18]
     [1,] -7.6772237 -6.9373834 -6.2019856 -5.4682853 -4.7619185 -4.0863927
     [2,] -6.7359280 -5.9982281 -5.2712739 -4.5727550 -3.9056348 -3.2856508
     [3,] -5.7950287 -5.0763022 -4.3862323 -3.7267939 -3.1318736 -2.6330495
     [4,] -4.8832909 -4.2020637 -3.5528777 -2.9851089 -2.5149122 -2.1535113
     [5,] -4.0200332 -3.3869404 -2.8451068 -2.4051337 -2.0698271 -1.8005882
     [6,] -3.2285591 -2.7124815 -2.3033635 -1.9905599 -1.7349371 -1.5159451
     [7,] -2.5888343 -2.2093078 -1.9153757 -1.6721442 -1.4593969 -1.2565286
     [8,] -2.1223593 -1.8439932 -1.6114347 -1.4040378 -1.1976064 -0.9717216
     [9,] -1.7761794 -1.5525080 -1.3491313 -1.1366925 -0.9180812 -0.7790191
    [10,] -1.4995008 -1.2929640 -1.0735837 -0.8712664 -0.7563213 -0.7424734
    [11,] -1.2560082 -1.0179809 -0.8312902 -0.7419343 -0.7568451 -0.8115920
    [12,] -0.9493926 -0.8199618 -0.7497348 -0.7775355 -0.8187152 -0.8227688
    [13,] -0.6704387 -0.7282961 -0.8154034 -0.8426553 -0.8264312 -0.8227688
    [14,] -0.4714216 -0.6877303 -0.8015729 -0.8423102 -0.8469757 -0.8296669
    [15,] -0.3254052 -0.5117717 -0.6719531 -0.7808123 -0.8362750 -0.8485270
    [16,] -0.1849381 -0.2953397 -0.4597261 -0.6329602 -0.7560089 -0.8265636
    [17,] -0.1553079 -0.1670818 -0.2587228 -0.4099669 -0.5900839 -0.7272738
    [18,] -0.2388897 -0.1649867 -0.1552843 -0.2264089 -0.3635343 -0.5433635
    [19,] -0.4247511 -0.2710506 -0.1790491 -0.1499045 -0.1992637 -0.3206213
    [20,] -0.7087274 -0.4777801 -0.3075985 -0.1977135 -0.1513662 -0.1777225
    [21,] -1.0882587 -0.7813795 -0.5359844 -0.3484131 -0.2212640 -0.1583517
    [22,] -1.6511375 -1.1915568 -0.8581760 -0.5984486 -0.3936589 -0.2500588
    [23,] -2.4082546 -1.7998176 -1.3044852 -0.9394070 -0.6647106 -0.4435709
    [24,] -3.3575274 -2.5956426 -1.9564366 -1.4274575 -1.0275972 -0.7348409
    [25,] -4.4938451 -3.5901004 -2.7925412 -2.1211212 -1.5610099 -1.1249552
     [,19] [,20] [,21] [,22] [,23] [,24]
     [1,] -3.4467518 -2.8955560 -2.4443503 -2.0999115 -1.8254576 -1.5954615
     [2,] -2.7599573 -2.3396872 -2.0190700 -1.7585674 -1.5369678 -1.3342050
     [3,] -2.2428398 -1.9424274 -1.6948581 -1.4799379 -1.2776317 -1.0562549
     [4,] -1.8696835 -1.6334239 -1.4241640 -1.2193829 -0.9931019 -0.8213539
     [5,] -1.5738769 -1.3693312 -1.1592224 -0.9369009 -0.7892208 -0.7353469
     [6,] -1.3136858 -1.0969388 -0.8876172 -0.7636518 -0.7391386 -0.7961905
     [7,] -1.0324486 -0.8450101 -0.7462459 -0.7506986 -0.8081065 -0.8227688
     [8,] -0.8088703 -0.7370302 -0.7692719 -0.8165183 -0.8227688 -0.8227688
     [9,] -0.7358246 -0.7868338 -0.8214016 -0.8227688 -0.8227688 -0.8227688
    [10,] -0.8009545 -0.8227688 -0.8227688 -0.8227688 -0.8227688 -0.8227688
    [11,] -0.8227688 -0.8227688 -0.8227688 -0.8227688 -0.8227688 -0.8227688
    [12,] -0.8227688 -0.8227688 -0.8227688 -0.8227688 -0.8227688 -0.8227688
    [13,] -0.8227688 -0.8227688 -0.8227688 -0.8227688 -0.8227688 -0.8227688
    [14,] -0.8227734 -0.8227688 -0.8227688 -0.8227688 -0.8227688 -0.8227688
    [15,] -0.8339930 -0.8233547 -0.8227688 -0.8227688 -0.8227688 -0.8227688
    [16,] -0.8478658 -0.8394820 -0.8249187 -0.8227688 -0.8227688 -0.8227688
    [17,] -0.8126007 -0.8450990 -0.8448045 -0.8274923 -0.8227688 -0.8227688
    [18,] -0.6946588 -0.7944527 -0.8403532 -0.8478059 -0.8311197 -0.8228731
    [19,] -0.4928621 -0.6581395 -0.7722014 -0.8332189 -0.8485365 -0.8358619
    [20,] -0.2814697 -0.4411459 -0.6177227 -0.7459457 -0.8219452 -0.8470915
    [21,] -0.1620453 -0.2463751 -0.3925843 -0.5734342 -0.7157941 -0.8064427
    [22,] -0.1696128 -0.1525506 -0.2158419 -0.3474145 -0.5253218 -0.6817510
    [23,] -0.2839346 -0.1853302 -0.1496216 -0.1907202 -0.3058468 -0.4736219
    [24,] -0.4984648 -0.3220285 -0.2057455 -0.1534350 -0.1712911 -0.2681421
    [25,] -0.8089820 -0.5583984 -0.3644416 -0.2311689 -0.1619673 -0.1578356
     [,25]
     [1,] -1.3893662
     [2,] -1.1199842
     [3,] -0.8598374
     [4,] -0.7394636
     [5,] -0.7808053
     [6,] -0.8226633
     [7,] -0.8227688
     [8,] -0.8227688
     [9,] -0.8227688
    [10,] -0.8227688
    [11,] -0.8227688
    [12,] -0.8227688
    [13,] -0.8227688
    [14,] -0.8227688
    [15,] -0.8227688
    [16,] -0.8227688
    [17,] -0.8227688
    [18,] -0.8227688
    [19,] -0.8238118
    [20,] -0.8416885
    [21,] -0.8435850
    [22,] -0.7867831
    [23,] -0.6438040
    [24,] -0.4229974
    [25,] -0.2346173
    
    $tau
     [1] 1.000000 1.791667 2.583333 3.375000 4.166667 4.958333 5.750000
     [8] 6.541667 7.333333 8.125000 8.916667 9.708333 10.500000 11.291667
    [15] 12.083333 12.875000 13.666667 14.458333 15.250000 16.041667 16.833333
    [22] 17.625000 18.416667 19.208333 20.000000
    
    $gamma
     [1] 0.1000000 0.7208333 1.3416667 1.9625000 2.5833333 3.2041667
     [7] 3.8250000 4.4458333 5.0666667 5.6875000 6.3083333 6.9291667
    [13] 7.5500000 8.1708333 8.7916667 9.4125000 10.0333333 10.6541667
    [19] 11.2750000 11.8958333 12.5166667 13.1375000 13.7583333 14.3791667
    [25] 15.0000000
    
    >
    > # zoom in to global max
    > dev0 <- bentcable.dev.plot( seq(10,15,length=25),
    + seq(2,10,length=20), sockeye$logReturns )
    > # surface has ridge - expect some trouble locating true peak
    >
    > cable0 <- bentcable.ar( sockeye$logReturns, tgdev=dev0 )
    *****************************************
    Finding initial values for AR(0) cable...
    *****************************************
    *******************************
    Finding best AR(0) cable fit...
    *******************************
    Trying 'nls()' Gauss-Newton algorithm...
    8.681477 : 13.07502533 0.08331756 -0.69455652 12.08333333 6.21052632
    8.681128 : 13.07865445 0.08201756 -0.69901816 12.15669338 6.24206902
    8.680729 : 13.07950943 0.08163856 -0.69503529 12.12576398 6.18874636
    8.68063 : 13.08045646 0.08129548 -0.69585902 12.14149460 6.19241656
    8.680569 : 13.08218382 0.08061981 -0.69400323 12.13804768 6.15827835
    8.68055 : 13.08241974 0.08057323 -0.69674610 12.16617299 6.19001227
    8.68049 : 13.0827076 0.0804441 -0.6952650 12.1544158 6.1701997
    8.68048 : 13.08301160 0.08033318 -0.69545785 12.15874415 6.17037094
    8.680471 : 13.08354333 0.08012806 -0.69504146 12.15912121 6.16153508
    8.680469 : 13.08363661 0.08010261 -0.69569108 12.16607042 6.16867856
    8.680468 : 13.08380063 0.08003114 -0.69499770 12.16079934 6.15911842
    8.680467 : 13.08384345 0.08002576 -0.69573099 12.16813219 6.16763103
    8.680467 : 13.08397153 0.07996656 -0.69495528 12.16178401 6.15733657
    8.680467 : 13.08398973 0.07997148 -0.69576248 12.16962001 6.16692429
    8.680462 : 13.08404747 0.07994369 -0.69533632 12.16603064 6.16136483
    8.680462 : 13.08410385 0.07992292 -0.69536403 12.16675134 6.16126504
    8.680461 : 13.08421061 0.07988194 -0.69530057 12.16701208 6.15968320
    8.680461 : 13.08424397 0.07987078 -0.69539393 12.16817135 6.16055089
    8.680461 : 13.08428503 0.07985394 -0.69529410 12.16755365 6.15903670
    8.680461 : 13.08430903 0.07984641 -0.69539709 12.16872876 6.16009178
    8.680461 : 13.08434308 0.07983207 -0.69528748 12.16796131 6.15851422
    8.680461 : 13.08435970 0.07982747 -0.69540105 12.16917721 6.15975356
    8.680461 : 13.08438842 0.07981496 -0.69528066 12.16826404 6.15808713
    8.680461 : 13.08439904 0.07981279 -0.69540579 12.16954135 6.15951163
    8.680461 : 13.08442386 0.07980158 -0.69527354 12.16848375 6.15773252
    8.680461 : 13.08442957 0.07980142 -0.69541132 12.16984166 6.15934670
    8.680461 : 13.08445158 0.07979108 -0.69526601 12.16863693 6.15743192
    8.680461 : 13.08445316 0.07979267 -0.69541764 12.17009324 6.15924403
    8.68046 : 13.08446323 0.07978775 -0.69533782 12.16941509 6.15820774
    8.68046 : 13.08447243 0.07978435 -0.69534166 12.16952626 6.15818440
    8.68046 : 13.0844896 0.0797778 -0.6953327 12.1695799 6.1579462
    8.68046 : 13.08449510 0.07977591 -0.69534563 12.16974793 6.15806009
    8.68046 : 13.08450159 0.07977328 -0.69533173 12.16966827 6.15784382
    8.68046 : 13.08450565 0.07977197 -0.69534597 12.16983669 6.15798448
    8.68046 : 13.08451101 0.07976974 -0.69533072 12.16973497 6.15776074
    8.68046 : 13.08451390 0.07976889 -0.69534643 12.16990791 6.15792816
    8.68046 : 13.08451834 0.07976698 -0.69532980 12.16978572 6.15769453
    8.68046 : 13.08452019 0.07976653 -0.69534700 12.16996461 6.15788726
    8.68046 : 13.08452398 0.07976485 -0.69532884 12.16982250 6.15764014
    8.68046 : 13.08452516 0.07976468 -0.69534767 12.17001126 6.15785812
    8.68046 : 13.08452850 0.07976314 -0.69532777 12.16984900 6.15759366
    8.68046 : 13.08452900 0.07976326 -0.69534854 12.17005069 6.15783983
    8.68046 : 13.08453051 0.07976253 -0.69533756 12.16995849 6.15769645
    8.68046 : 13.08453202 0.07976198 -0.69533808 12.16997558 6.15769151
    8.68046 : 13.08453473 0.07976094 -0.69533679 12.16998545 6.15765548
    Converged!
    ******************************************
    If you have time-series data, then
    choose your p according to AIC and PACF...
    ******************************************
    p.aic
     6
    ************************************************
    Please apply 'coef()[1:5]' to the '$fit' element
    of the returned AR(0) fit as initial values for
    subsequent AR(p) fits.
    ************************************************
    > # apparent best AR(0) fit: SSE=8.68
    > # diagnostics: take p=2 to 6
    >
    > # compare to this:
    > # dev1 <- bentcable.dev.plot( seq(10,15,length=25),
    > # seq(2,10,length=15), sockeye$logReturns )
    > # bentcable.ar( sockeye$logReturns, tgdev=dev1 ) # SSE=8.683
    > # # not an obvious local max!
    >
    > # feed 'cable0' in Scenario (3) to get fitted plot:
    > # bentcable.ar( cable0$y, init.cable=coef(cable0$fit) )
    >
    >
    >
    >
    > # Scenario (2)
    > ##############
    >
    > # AR(2) cable, start time at 0:
    > bentcable.dev.plot( seq(6,18,length=15),
    + seq(.01,12,length=15), sockeye$logReturns, p=2 )
    Please be patient...
    $dev
     [,1] [,2] [,3] [,4] [,5] [,6]
     [1,] -13.4652667 -13.2275740 -12.8565630 -12.20245718 -11.25568523 -10.0271068
     [2,] -11.4938041 -11.2123481 -10.7445832 -10.18987082 -9.32092968 -8.2356850
     [3,] -8.5662068 -8.5900436 -8.3411640 -7.67864144 -6.98352448 -6.1964638
     [4,] -6.0702026 -5.9057702 -5.4021443 -4.92469344 -4.37520924 -3.9183024
     [5,] -3.1917620 -3.0215021 -2.6004360 -2.16774328 -1.87816246 -1.8740205
     [6,] -0.5554747 -0.6645690 -0.5564947 -0.23419940 -0.23655650 -0.4905613
     [7,] -0.6459248 -0.2707555 -0.0169360 -0.06349562 -0.01174146 0.0000000
     [8,] -1.8546040 -1.9489089 -1.8557577 -1.50267035 -1.05852446 -0.6156093
     [9,] -5.5399622 -5.2632474 -4.8003927 -3.95508060 -2.96820733 -1.9464187
    [10,] -8.9606633 -8.6336226 -7.7502615 -6.67079241 -5.24234927 -3.6741464
    [11,] -11.2143255 -11.1022721 -10.4070544 -9.08987165 -7.49822517 -5.8108721
    [12,] -13.1806068 -13.0461878 -12.2802797 -11.15667526 -9.75220535 -8.0313741
    [13,] -14.4093055 -14.0929472 -13.6162877 -13.00161711 -11.84378152 -10.0372645
    [14,] -14.3598968 -14.7297496 -15.0448802 -14.59527986 -13.39695492 -11.8652411
    [15,] -17.3552067 -17.1375985 -16.6251985 -15.68466886 -14.62531653 -13.3980911
     [,7] [,8] [,9] [,10] [,11] [,12]
     [1,] -8.6830963 -7.2300495 -5.8414420 -4.7291181 -3.9216677 -3.3374456
     [2,] -7.0320611 -5.7978620 -4.7283288 -3.9210861 -3.3370845 -3.0375021
     [3,] -5.2990411 -4.5275440 -3.8808427 -3.3367236 -3.0373200 -2.8422970
     [4,] -3.6443888 -3.3920707 -3.1510874 -3.0013884 -2.8421608 -2.7357726
     [5,] -2.0879157 -2.3279914 -2.5506943 -2.6711641 -2.7020182 -2.7391809
     [6,] -0.8429496 -1.3946970 -1.9111397 -2.2738615 -2.5736563 -2.7595208
     [7,] -0.2548412 -0.6444135 -1.1932180 -1.8348660 -2.3372750 -2.6315287
     [8,] -0.2870335 -0.2671058 -0.6416166 -1.2757415 -1.8954946 -2.3408006
     [9,] -0.9917040 -0.4553863 -0.4089714 -0.7139880 -1.2794125 -1.8950471
    [10,] -2.3377626 -1.2488346 -0.5580023 -0.4142619 -0.7135976 -1.2788847
    [11,] -4.0701828 -2.4883866 -1.2574307 -0.5583449 -0.4141795 -0.7132075
    [12,] -6.0212999 -4.0827033 -2.4895689 -1.2582531 -0.5586880 -0.4140974
    [13,] -8.0480126 -6.0229882 -4.0841889 -2.4907513 -1.2590759 -0.5590314
    [14,] -10.0389040 -8.0496952 -6.0246765 -4.0856749 -2.4919340 -1.2598991
    [15,] -11.8666434 -10.0405434 -8.0513777 -6.0263648 -4.0871611 -2.4931169
     [,13] [,14] [,15]
     [1,] -3.0376843 -2.8425696 -2.7359132
     [2,] -2.8424333 -2.7358663 -2.7390310
     [3,] -2.7358194 -2.7390809 -2.7925689
     [4,] -2.7391309 -2.7925877 -2.7963413
     [5,] -2.7926065 -2.7963413 -2.7963413
     [6,] -2.7963413 -2.7963413 -2.7963413
     [7,] -2.7631966 -2.7963413 -2.7963413
     [8,] -2.6313523 -2.7631415 -2.7963413
     [9,] -2.3404951 -2.6311758 -2.7630865
    [10,] -1.8945995 -2.3401895 -2.6309992
    [11,] -1.2783571 -1.8941518 -2.3398839
    [12,] -0.7128175 -1.2778295 -1.8937039
    [13,] -0.4140156 -0.7124278 -1.2773020
    [14,] -0.5593753 -0.4139342 -0.7120382
    [15,] -1.2607227 -0.5597195 -0.4138531
    
    $tau
     [1] 6.000000 6.857143 7.714286 8.571429 9.428571 10.285714 11.142857
     [8] 12.000000 12.857143 13.714286 14.571429 15.428571 16.285714 17.142857
    [15] 18.000000
    
    $gamma
     [1] 0.0100000 0.8664286 1.7228571 2.5792857 3.4357143 4.2921429
     [7] 5.1485714 6.0050000 6.8614286 7.7178571 8.5742857 9.4307143
    [13] 10.2871429 11.1435714 12.0000000
    
    >
    > # zoom in to global max
    > dev2 <- bentcable.dev.plot( seq(10,12,length=15),
    + seq(1,5,length=15), sockeye$logReturns, p=2 )
    Please be patient...
    >
    > # best grid-based fit
    > gr.cable2 <- bentcable.ar( sockeye$logReturns, tgdev=dev2, p=2 )
    *****************************************
    Finding initial values for AR(2) cable...
    *****************************************
    *************************
    AR(2) fit failed.
    *************************
    > # to be used in Scenario (4)
    > # local regularity - expect little trouble
    >
    > # AR(2) stick, start time at 80:
    > bentcable.dev.plot( seq(86,98,length=15), y.vect=sockeye$logReturns,
    + p=2, stick=TRUE, t.vect=sockeye$year )
    Please be patient...
    $dev
     [,1]
     [1,] -12.91279939
     [2,] -10.93832939
     [3,] -8.01073206
     [4,] -5.51472786
     [5,] -2.63628731
     [6,] 0.00000000
     [7,] -0.09045004
     [8,] -1.29845771
     [9,] -4.98448745
    [10,] -8.40518862
    [11,] -10.65885076
    [12,] -12.62513211
    [13,] -13.85383081
    [14,] -13.80442205
    [15,] -16.80254797
    
    $tau
     [1] 86.00000 86.85714 87.71429 88.57143 89.42857 90.28571 91.14286 92.00000
     [9] 92.85714 93.71429 94.57143 95.42857 96.28571 97.14286 98.00000
    
    $gamma
    [1] 0
    
    >
    > # zoom in to global max
    > dev3 <- bentcable.dev.plot( seq(88.5,93,length=25),
    + y.vect=sockeye$logReturns,
    + p=2, stick=TRUE, t.vect=sockeye$year )
    Please be patient...
    > # camel hump - double peaks!
    >
    > # best grid-based fit
    > gr.stick2 <- bentcable.ar( sockeye$logReturns, tgdev=dev3, p=2, stick=TRUE,
    + t.vect=sockeye$year )
    *******************************
    WARNING:
    Cannot estimate CTP correctly
    unless 't.vect' is c(0,1,2,...)
    *******************************
    *****************************************
    Finding initial values for AR(2) stick...
    *****************************************
    *************************
    AR(2) fit failed.
    *************************
    > # irregularity - expect some trouble if used in Scenario (4)
    >
    > # AR(4) cable, start time at 0:
    > bentcable.dev.plot( seq(6,18,length=15), seq(.01,12,length=15),
    + sockeye$logReturns, p=4 )
    Please be patient...
    $dev
     [,1] [,2] [,3] [,4] [,5] [,6]
     [1,] -29.246253 -28.801217 -28.176138 -27.161876 -25.891023 -24.164693
     [2,] -27.997430 -27.521825 -26.701011 -25.628448 -24.059794 -22.219818
     [3,] -25.326153 -25.242779 -24.611763 -23.296644 -21.662500 -19.690404
     [4,] -22.079658 -21.855298 -20.946815 -19.680440 -18.004263 -16.111851
     [5,] -15.700288 -15.431247 -14.483603 -13.169807 -11.779539 -10.664269
     [6,] -7.103308 -6.718321 -5.302206 -3.507027 -2.593613 -3.193492
     [7,] -10.986714 -10.071382 -7.938074 -4.766827 -1.418094 0.000000
     [8,] -19.261520 -18.688606 -17.510949 -15.240893 -11.801097 -7.191750
     [9,] -24.304268 -23.993266 -23.322366 -21.979058 -19.622025 -15.692351
    [10,] -27.778880 -27.507271 -26.753526 -25.731976 -24.030672 -21.315814
    [11,] -29.338438 -29.315385 -28.954491 -27.987959 -26.641015 -24.818214
    [12,] -30.313681 -30.303488 -30.030898 -29.420990 -28.484925 -27.125069
    [13,] -30.895885 -30.741983 -30.474550 -30.294822 -29.809885 -28.694332
    [14,] -30.612883 -30.735274 -30.873634 -30.772451 -30.467305 -29.822197
    [15,] -30.959838 -31.046981 -31.076866 -31.011023 -30.781373 -30.467666
     [,7] [,8] [,9] [,10] [,11] [,12]
     [1,] -22.260814 -20.096720 -17.730160 -15.331549 -13.126522 -11.400635
     [2,] -20.069491 -17.716902 -15.329598 -13.124848 -11.399462 -10.278302
     [3,] -17.473599 -15.200514 -13.088471 -11.398289 -10.277561 -9.549924
     [4,] -14.222359 -12.517186 -11.164152 -10.227429 -9.549448 -9.150838
     [5,] -9.972169 -9.639230 -9.481848 -9.279638 -9.097456 -9.038041
     [6,] -4.857951 -6.528648 -7.653790 -8.329972 -8.763879 -9.014988
     [7,] -1.031012 -3.275703 -5.491281 -7.168089 -8.250463 -8.796449
     [8,] -2.969917 -1.611283 -3.164747 -5.479651 -7.207491 -8.252243
     [9,] -10.051137 -4.390647 -2.029375 -3.256354 -5.481657 -7.206356
    [10,] -17.055588 -10.876186 -4.635914 -2.039979 -3.254564 -5.479936
    [11,] -21.934139 -17.304750 -10.897687 -4.640005 -2.040208 -3.252774
    [12,] -25.037806 -21.951139 -17.309394 -10.903429 -4.644099 -2.040441
    [13,] -27.139511 -25.039901 -21.954253 -17.314042 -10.909170 -4.648196
    [14,] -28.695486 -27.140989 -25.041996 -21.957365 -17.318689 -10.914911
    [15,] -29.822925 -28.696640 -27.142466 -25.044089 -21.960476 -17.323335
     [,13] [,14] [,15]
     [1,] -10.279042 -9.550875 -9.151443
     [2,] -9.550399 -9.151241 -9.038018
     [3,] -9.151039 -9.038026 -9.068897
     [4,] -9.038039 -9.068909 -9.071280
     [5,] -9.068921 -9.071280 -9.071280
     [6,] -9.071280 -9.071280 -9.071280
     [7,] -9.017232 -9.071280 -9.071280
     [8,] -8.796149 -9.017142 -9.071280
     [9,] -8.251601 -8.795848 -9.017052
    [10,] -7.205221 -8.250959 -8.795548
    [11,] -5.478215 -7.204084 -8.250316
    [12,] -3.250985 -5.476493 -7.202948
    [13,] -2.040676 -3.249185 -5.474771
    [14,] -4.652296 -2.040914 -3.247396
    [15,] -10.920653 -4.656398 -2.041156
    
    $tau
     [1] 6.000000 6.857143 7.714286 8.571429 9.428571 10.285714 11.142857
     [8] 12.000000 12.857143 13.714286 14.571429 15.428571 16.285714 17.142857
    [15] 18.000000
    
    $gamma
     [1] 0.0100000 0.8664286 1.7228571 2.5792857 3.4357143 4.2921429
     [7] 5.1485714 6.0050000 6.8614286 7.7178571 8.5742857 9.4307143
    [13] 10.2871429 11.1435714 12.0000000
    
    >
    > # zoom in to global max
    > dev4 <- bentcable.dev.plot( seq(10,12,length=15),
    + seq(1,7,length=25), sockeye$logReturns, p=4 )
    Please be patient...
    > # slight ridge
    >
    > # best grid-based fit
    > gr.cable4 <- bentcable.ar( sockeye$logReturns, tgdev=dev4, p=4 )
    *****************************************
    Finding initial values for AR(4) cable...
    *****************************************
    *************************
    AR(4) fit failed.
    *************************
    > # to be used in Scenario (4)
    > # will ridge be problem???
    >
    >
    >
    > # Scenario (3)
    > ##############
    >
    > # independent non-time-series cable:
    > bentcable.ar( stagnant$loght, t.vect=stagnant$logflow,
    + init.cable=c(.6,-.4,-.7,0,.5) ) # SSE=0.005
    *******************************
    WARNING:
    Cannot estimate CTP correctly
    unless 't.vect' is c(0,1,2,...)
    *******************************
    Trying 'nls()' Gauss-Newton algorithm...
    0.02697941 : 0.6 -0.4 -0.7 0.0 0.5
    0.004928361 : 0.56883919 -0.39872669 -0.66778566 0.05664015 0.44490146
    0.004821135 : 0.5694103 -0.3982883 -0.6660852 0.0556161 0.4290926
    0.004821104 : 0.56930101 -0.39839199 -0.66598320 0.05578825 0.42848052
    0.004821103 : 0.56929392 -0.39839865 -0.66597222 0.05579369 0.42844238
    Converged!
    ******************************************
    Failed to compute CTP confidence interval!
    ******************************************
    $cable
    $cable$fit
    Nonlinear regression model
     model: y.vect ~ fullcable.t(t.vect, b0, b1, b2, tau, gamm)
     data: parent.frame()
     b0 b1 b2 tau gamm
     0.56929 -0.39840 -0.66597 0.05579 0.42844
     residual sum-of-squares: 0.004821
    
    Number of iterations to convergence: 4
    Achieved convergence tolerance: 6.314e-06
    
    $cable$y
     [1] 1.12 1.12 0.99 1.03 0.92 0.90 0.81 0.83 0.65 0.67 0.60 0.59
    [13] 0.51 0.44 0.43 0.43 0.33 0.30 0.25 0.24 0.13 -0.01 -0.13 -0.14
    [25] -0.30 -0.33 -0.46 -0.43 -0.65
    
    $cable$t
     [1] -1.39 -1.39 -1.08 -1.08 -0.94 -0.80 -0.63 -0.63 -0.25 -0.25 -0.12 -0.12
    [13] 0.01 0.11 0.11 0.11 0.25 0.25 0.34 0.34 0.44 0.59 0.70 0.70
    [25] 0.85 0.85 0.99 0.99 1.19
    
    $cable$n
    [1] 29
    
    $cable$p
    [1] 0
    
    $cable$stick
    [1] FALSE
    
    
    > # identical to 'cable' in Scenario (1)
    > # no irregularity, no ambiguity!
    >
    >
    >
    > # AR(0) stick, start time at 80:
    > bentcable.ar( sockeye$logReturns, init.cable=c(10,.1,-.5,90),
    + stick=TRUE, t.vect=sockeye$year )
    *******************************
    WARNING:
    Cannot estimate CTP correctly
    unless 't.vect' is c(0,1,2,...)
    *******************************
    Trying 'nls()' Gauss-Newton algorithm...
    570.0665 : 10.0 0.1 -0.5 90.0
    9.049265 : 10.06888312 0.03910762 -0.49965330 91.03134375
    8.857079 : 11.59543796 0.02078896 -0.52236009 91.83173251
    8.854106 : 11.59543957 0.02078894 -0.52236008 91.79694024
    Converged!
    ******************************************
    Failed to compute CTP confidence interval!
    ******************************************
    $cable
    $cable$fit
    Nonlinear regression model
     model: y.vect ~ fullcable.t(t.vect, b0, b1, b2, tau, 0)
     data: parent.frame()
     b0 b1 b2 tau
    11.59544 0.02079 -0.52236 91.79694
     residual sum-of-squares: 8.854
    
    Number of iterations to convergence: 3
    Achieved convergence tolerance: 7.955e-08
    
    $cable$y
     [1] 12.655625 13.655085 13.667217 13.417511 12.499414 13.437136 13.966513
     [8] 13.732741 13.682008 12.992086 13.618007 13.151390 13.654253 12.884477
    [15] 11.789193 11.671612 11.082143 12.528156 10.858999 8.188689 9.903488
    
    $cable$t
     [1] 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
    [20] 99 100
    
    $cable$n
    [1] 21
    
    $cable$p
    [1] 0
    
    $cable$stick
    [1] TRUE
    
    
    > # identical to 'stick0' in Scenario (1)
    > # local regularity, no trouble
    >
    >
    > # AR(0) stick, start time at 0:
    > bentcable.ar( sockeye$logReturns, init.cable=coef(cable0$fit)[1:5],
    + stick=TRUE )
    Using only 'init.cable[1:4]'...
    Trying 'nls()' Gauss-Newton algorithm...
    11.11711 : 13.08453473 0.07976094 -0.69533679 12.16998545
    8.937778 : 13.24087864 0.02560978 -0.50014866 11.61709568
    8.854263 : 13.25855490 0.02078898 -0.52236012 11.80492662
    8.854106 : 13.2585548 0.0207890 -0.5223601 11.7969395
    Converged!
    $cable
    $cable$fit
    Nonlinear regression model
     model: y.vect ~ fullcable.t(t.vect, b0, b1, b2, tau, 0)
     data: parent.frame()
     b0 b1 b2 tau
    13.25855 0.02079 -0.52236 11.79694
     residual sum-of-squares: 8.854
    
    Number of iterations to convergence: 3
    Achieved convergence tolerance: 2.67e-07
    
    $cable$y
     [1] 12.655625 13.655085 13.667217 13.417511 12.499414 13.437136 13.966513
     [8] 13.732741 13.682008 12.992086 13.618007 13.151390 13.654253 12.884477
    [15] 11.789193 11.671612 11.082143 12.528156 10.858999 8.188689 9.903488
    
    $cable$t
     [1] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
    
    $cable$n
    [1] 21
    
    $cable$p
    [1] 0
    
    $cable$stick
    [1] TRUE
    
    
    $ctp
    $ctp$change.hat
    [1] 11.79694
    
    $ctp$var
    [1] 1.183866
    
    $ctp$interval
    [1] 9.664389 13.929490
    
    
    > # identical to 'cable0' in Scenario (1)
    > # here you get plot of fit and CTP confidence interval
    >
    > # Scenario (4)
    > ##############
    >
    > # AR(2) cable, start time at 0:
    > # use 'gr.cable2' from Scenario (2)
    > cable2 <- bentcable.ar( sockeye$logReturns,
    + init.cable=gr.cable2$init[1:5], init.phi=gr.cable2$init[-c(1:5)] )
    Error in bentcable.ar(sockeye$logReturns, init.cable = gr.cable2$init[1:5], :
     Must supply 'init.cable' or 'tgdev'!
    Execution halted
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-osx-x86_64-clang