facebook / prophet

Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.
https://facebook.github.io/prophet
MIT License
18.38k stars 4.52k forks source link

cross_validation doesn't seem to respect period and horizon values #471

Closed roumail closed 6 years ago

roumail commented 6 years ago
period <- horizon <- 92
initial <- 1269
cv_result <- prophet::cross_validation(model = model, 
        period = period, horizon = horizon,  units = "days", initial = initial)
library(dplyr)
cv_result %>% group_by(cutoff) %>% summarise(days = max(ds) - min(ds))
# A tibble: 9 x 2
  cutoff              days  
  <dttm>              <time>
1 2015-09-05 00:00:00 77    
2 2015-12-06 00:00:00 84    
3 2016-03-07 00:00:00 56    
4 2016-06-07 00:00:00 84    
5 2016-09-07 00:00:00 63    
6 2016-12-08 00:00:00 77    
7 2017-03-10 00:00:00 77    
8 2017-06-10 00:00:00 56    
9 2017-09-10 00:00:00 91  

Hi. I would expect the days value to be 92, or at least near it for all these cases. However, that doesn't seem to be the case. Any ideas why? Is it behaviour expected?

roumail commented 6 years ago
structure(list(growth = "linear", n.changepoints = 0, yearly.seasonality = FALSE, 
    weekly.seasonality = FALSE, daily.seasonality = FALSE, holidays = NULL, 
    seasonality.prior.scale = 10, changepoint.prior.scale = 0.05, 
    holidays.prior.scale = 10, mcmc.samples = 0, interval.width = 0.8, 
    uncertainty.samples = 1000, specified.changepoints = FALSE, 
    start = structure(1325462400, class = c("POSIXct", "POSIXt"
    ), tzone = "GMT"), y.scale = 1396257, logistic.floor = FALSE, 
    t.scale = 187488000, changepoints.t = 0, seasonalities = structure(list(
        weekly = structure(list(period = 7, fourier.order = 3, 
            prior.scale = 10), .Names = c("period", "fourier.order", 
        "prior.scale"))), .Names = "weekly"), extra_regressors = structure(list(
        half = structure(list(prior.scale = 10, standardize = FALSE, 
            mu = 0, std = 1), .Names = c("prior.scale", "standardize", 
        "mu", "std")), quarter = structure(list(prior.scale = 10, 
            standardize = FALSE, mu = 0, std = 1), .Names = c("prior.scale", 
        "standardize", "mu", "std")), mday = structure(list(prior.scale = 10, 
            standardize = FALSE, mu = 0, std = 1), .Names = c("prior.scale", 
        "standardize", "mu", "std")), qday = structure(list(prior.scale = 10, 
            standardize = FALSE, mu = 0, std = 1), .Names = c("prior.scale", 
        "standardize", "mu", "std")), yday = structure(list(prior.scale = 10, 
            standardize = FALSE, mu = 0, std = 1), .Names = c("prior.scale", 
        "standardize", "mu", "std")), mweek = structure(list(
            prior.scale = 10, standardize = FALSE, mu = 0, std = 1), .Names = c("prior.scale", 
        "standardize", "mu", "std")), week = structure(list(prior.scale = 10, 
            standardize = FALSE, mu = 0, std = 1), .Names = c("prior.scale", 
        "standardize", "mu", "std"))), .Names = c("half", "quarter", 
    "mday", "qday", "yday", "mweek", "week")), stan.fit = NULL, 
    params = structure(list(k = 0.156575840484923, m = 0.0485434428246513, 
        delta = structure(0, .Dim = c(1L, 1L)), sigma_obs = 0.231109955498977, 
        beta = structure(c(0.00030176943025388, 0.000626630678830601, 
        -0.000543769723902985, -0.000433641884573619, 0.000678069754781236, 
        0.000154764997104237, 0.0613064327128702, 0.00827046737118359, 
        -0.00181675398440918, 0.00233755279665552, 0.0209349452169481, 
        0.000720012942452726, -0.148090313763796), .Dim = c(1L, 
        13L)), gamma = structure(0, .Dim = 1L)), .Names = c("k", 
    "m", "delta", "sigma_obs", "beta", "gamma")), history = structure(list(
        ds = structure(c(1325462400, 1328486400, 1329091200, 
        1329696000, 1330300800, 1330905600, 1331510400, 1332720000, 
        1333324800, 1335139200, 1336348800, 1337558400, 1338163200, 
        1338768000, 1339977600, 1340582400, 1341187200, 1341792000, 
        1342396800, 1343001600, 1344816000, 1345420800, 1347235200, 
        1348444800, 1349049600, 1349654400, 1350259200, 1351468800, 
        1352678400, 1353283200, 1353888000, 1354492800, 1355097600, 
        1358121600, 1358726400, 1359331200, 1359936000, 1360540800, 
        1361145600, 1361750400, 1363564800, 1364169600, 1364774400, 
        1365379200, 1366588800, 1369008000, 1369612800, 1370217600, 
        1370822400, 1372032000, 1372636800, 1373241600, 1373846400, 
        1374451200, 1376870400, 1378684800, 1379289600, 1380499200, 
        1381104000, 1381708800, 1382313600, 1384128000, 1385337600, 
        1386547200, 1387152000, 1388966400, 1389571200, 1390176000, 
        1391385600, 1393200000, 1394409600, 1395014400, 1395619200, 
        1396828800, 1397433600, 1398038400, 1398643200, 1399248000, 
        1400457600, 1401062400, 1402876800, 1403481600, 1404691200, 
        1405296000, 1405900800, 1407110400, 1408320000, 1408924800, 
        1410134400, 1410739200, 1411948800, 1413158400, 1414368000, 
        1414972800, 1416182400, 1416787200, 1417996800, 1418601600, 
        1421020800, 1421625600, 1422835200, 1424044800, 1424649600, 
        1425254400, 1425859200, 1426464000, 1427068800, 1428278400, 
        1428883200, 1429488000, 1430092800, 1431302400, 1432512000, 
        1434326400, 1435536000, 1436745600, 1437350400, 1439164800, 
        1439769600, 1440979200, 1442188800, 1442793600, 1443398400, 
        1444003200, 1444608000, 1445212800, 1445817600, 1446422400, 
        1447027200, 1447632000, 1448236800, 1448841600, 1449446400, 
        1450051200, 1450656000, 1451865600, 1454284800, 1455494400, 
        1456704000, 1457913600, 1460332800, 1460937600, 1462752000, 
        1465776000, 1466985600, 1468195200, 1469404800, 1470009600, 
        1473033600, 1473638400, 1474243200, 1476057600, 1476662400, 
        1478476800, 1479081600, 1481500800, 1483920000, 1486339200, 
        1488153600, 1489363200, 1490572800, 1491177600, 1491782400, 
        1492387200, 1492992000, 1494201600, 1495411200, 1496016000, 
        1497830400, 1499040000, 1499644800, 1500854400, 1502064000, 
        1502668800, 1505088000, 1506297600, 1506902400, 1507507200, 
        1509926400, 1510531200, 1511740800, 1512345600, 1512950400
        ), class = c("POSIXct", "POSIXt"), tzone = "GMT"), y = c(68810, 
        266206, 1447, 588622, 1447, 170874, 859127, 344990, 130015, 
        119319, 2170, 18972, 183478, 79744, 460898, 160920, 29763, 
        6234, 1808, 154719, 1085, 23917, 774394, 106138, 24123, 
        150290, 33188, 26515, 136279, 5669, 260956, 32812, 237745, 
        4921, 150876, 1160, 19133, 28041, 157820, 1160, 224496, 
        198459, 36867, 146773, 773, -379, 152416, 188124, 6313, 
        979019, 51474, 191473, 93177, 172178, 8416, 248510, 1332, 
        -33572, 308491, 59030, 1345221, 189211, 17760, 731945, 
        2722, 164747, 5017, 216946, 21164, 251385, 313606, 731821, 
        404666, 17256, 309237, 434304, 309335, 484128, 457531, 
        493780, 196332, 303166, 318, 747391, -907, 822371, 476415, 
        -1, 619381, 558994, 1177845, 756149, 352800, 556317, 
        214831, 286624, 358902, 762793, 358224, 762691, 359031, 
        618510, 420375, 245384, 58706, 1073172, 354044, 33808, 
        782643, 2769, 419589, 1020817, 406665, 16079, 466882, 
        1031408, 418940, 1117181, 488249, 1112493, 447974, 451902, 
        1107992, 67257, 846955, 332049, 6504, 493832, 1149802, 
        470985, 6504, 597704, 1112485, 787285, 30129, 38933, 
        1291948, 108044, 806373, 107028, 60067, 224303, 93631, 
        1396257, 5184, 171369, 7960, 13044, 1377971, -52916, 
        5044, -66850, 7440, 4415, 64247, 54941, 64458, 15273, 
        25620, 80873, 5265, 133372, 203935, 75679, 406623, -6500, 
        275199, 372071, 139764, 4600, 393356, 139709, 376744, 
        3947, 322574, 1105851, 356161, 377744, 557367, 5040, 
        148318, 424850, 401840), half = c(1, 1, 1, 1, 1, 1, 1, 
        1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
        2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
        1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
        2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
        1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
        2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
        2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 
        2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2), quarter = c(1, 
        1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 
        3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 
        1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 
        3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 
        2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 
        4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 
        2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 
        4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 
        3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 2, 2, 
        2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 
        4, 4), mday = c(2, 6, 13, 20, 27, 5, 12, 26, 2, 23, 7, 
        21, 28, 4, 18, 25, 2, 9, 16, 23, 13, 20, 10, 24, 1, 8, 
        15, 29, 12, 19, 26, 3, 10, 14, 21, 28, 4, 11, 18, 25, 
        18, 25, 1, 8, 22, 20, 27, 3, 10, 24, 1, 8, 15, 22, 19, 
        9, 16, 30, 7, 14, 21, 11, 25, 9, 16, 6, 13, 20, 3, 24, 
        10, 17, 24, 7, 14, 21, 28, 5, 19, 26, 16, 23, 7, 14, 
        21, 4, 18, 25, 8, 15, 29, 13, 27, 3, 17, 24, 8, 15, 12, 
        19, 2, 16, 23, 2, 9, 16, 23, 6, 13, 20, 27, 11, 25, 15, 
        29, 13, 20, 10, 17, 31, 14, 21, 28, 5, 12, 19, 26, 2, 
        9, 16, 23, 30, 7, 14, 21, 4, 1, 15, 29, 14, 11, 18, 9, 
        13, 27, 11, 25, 1, 5, 12, 19, 10, 17, 7, 14, 12, 9, 6, 
        27, 13, 27, 3, 10, 17, 24, 8, 22, 29, 19, 3, 10, 24, 
        7, 14, 11, 25, 2, 9, 6, 13, 27, 4, 11), qday = c(2, 37, 
        44, 51, 58, 65, 72, 86, 2, 23, 37, 51, 58, 65, 79, 86, 
        2, 9, 16, 23, 44, 51, 72, 86, 1, 8, 15, 29, 43, 50, 57, 
        64, 71, 14, 21, 28, 35, 42, 49, 56, 77, 84, 1, 8, 22, 
        50, 57, 64, 71, 85, 1, 8, 15, 22, 50, 71, 78, 92, 7, 
        14, 21, 42, 56, 70, 77, 6, 13, 20, 34, 55, 69, 76, 83, 
        7, 14, 21, 28, 35, 49, 56, 77, 84, 7, 14, 21, 35, 49, 
        56, 70, 77, 91, 13, 27, 34, 48, 55, 69, 76, 12, 19, 33, 
        47, 54, 61, 68, 75, 82, 6, 13, 20, 27, 41, 55, 76, 90, 
        13, 20, 41, 48, 62, 76, 83, 90, 5, 12, 19, 26, 33, 40, 
        47, 54, 61, 68, 75, 82, 4, 32, 46, 60, 74, 11, 18, 39, 
        74, 88, 11, 25, 32, 67, 74, 81, 10, 17, 38, 45, 73, 9, 
        37, 58, 72, 86, 3, 10, 17, 24, 38, 52, 59, 80, 3, 10, 
        24, 38, 45, 73, 87, 2, 9, 37, 44, 58, 65, 72), yday = c(2, 
        37, 44, 51, 58, 65, 72, 86, 93, 114, 128, 142, 149, 156, 
        170, 177, 184, 191, 198, 205, 226, 233, 254, 268, 275, 
        282, 289, 303, 317, 324, 331, 338, 345, 14, 21, 28, 35, 
        42, 49, 56, 77, 84, 91, 98, 112, 140, 147, 154, 161, 
        175, 182, 189, 196, 203, 231, 252, 259, 273, 280, 287, 
        294, 315, 329, 343, 350, 6, 13, 20, 34, 55, 69, 76, 83, 
        97, 104, 111, 118, 125, 139, 146, 167, 174, 188, 195, 
        202, 216, 230, 237, 251, 258, 272, 286, 300, 307, 321, 
        328, 342, 349, 12, 19, 33, 47, 54, 61, 68, 75, 82, 96, 
        103, 110, 117, 131, 145, 166, 180, 194, 201, 222, 229, 
        243, 257, 264, 271, 278, 285, 292, 299, 306, 313, 320, 
        327, 334, 341, 348, 355, 4, 32, 46, 60, 74, 102, 109, 
        130, 165, 179, 193, 207, 214, 249, 256, 263, 284, 291, 
        312, 319, 347, 9, 37, 58, 72, 86, 93, 100, 107, 114, 
        128, 142, 149, 170, 184, 191, 205, 219, 226, 254, 268, 
        275, 282, 310, 317, 331, 338, 345), mweek = c(1, 2, 3, 
        4, 5, 2, 3, 5, 1, 4, 2, 4, 5, 2, 4, 5, 1, 2, 3, 4, 3, 
        4, 3, 5, 1, 2, 3, 5, 3, 4, 5, 2, 3, 3, 4, 5, 2, 3, 4, 
        5, 4, 5, 1, 2, 4, 4, 5, 2, 3, 5, 1, 2, 3, 4, 4, 2, 3, 
        5, 2, 3, 4, 3, 5, 2, 3, 2, 3, 4, 2, 5, 3, 4, 5, 2, 3, 
        4, 5, 2, 4, 5, 3, 4, 2, 3, 4, 2, 4, 5, 2, 3, 5, 3, 5, 
        2, 4, 5, 2, 3, 3, 4, 1, 3, 4, 1, 2, 3, 4, 2, 3, 4, 5, 
        3, 5, 3, 5, 3, 4, 3, 4, 6, 3, 4, 5, 2, 3, 4, 5, 1, 2, 
        3, 4, 5, 2, 3, 4, 2, 1, 3, 5, 3, 3, 4, 2, 3, 5, 3, 5, 
        1, 2, 3, 4, 3, 4, 2, 3, 3, 2, 2, 5, 3, 5, 2, 3, 4, 5, 
        2, 4, 5, 4, 2, 3, 5, 2, 3, 3, 5, 1, 2, 2, 3, 5, 2, 3), 
        week = c(1, 6, 7, 8, 9, 10, 11, 13, 14, 17, 19, 21, 22, 
        23, 25, 26, 27, 28, 29, 30, 33, 34, 37, 39, 40, 41, 42, 
        44, 46, 47, 48, 49, 50, 2, 3, 4, 5, 6, 7, 8, 11, 12, 
        13, 14, 16, 20, 21, 22, 23, 25, 26, 27, 28, 29, 33, 36, 
        37, 39, 40, 41, 42, 45, 47, 49, 50, 1, 2, 3, 5, 8, 10, 
        11, 12, 14, 15, 16, 17, 18, 20, 21, 24, 25, 27, 28, 29, 
        31, 33, 34, 36, 37, 39, 41, 43, 44, 46, 47, 49, 50, 2, 
        3, 5, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 19, 21, 24, 
        26, 28, 29, 32, 33, 35, 37, 38, 39, 40, 41, 42, 43, 44, 
        45, 46, 47, 48, 49, 50, 51, 1, 5, 7, 9, 11, 15, 16, 19, 
        24, 26, 28, 30, 31, 36, 37, 38, 41, 42, 45, 46, 50, 2, 
        6, 9, 11, 13, 14, 15, 16, 17, 19, 21, 22, 25, 27, 28, 
        30, 32, 33, 37, 39, 40, 41, 45, 46, 48, 49, 50), floor = c(0, 
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
        0, 0), t = c(0, 0.0161290322580645, 0.0193548387096774, 
        0.0225806451612903, 0.0258064516129032, 0.0290322580645161, 
        0.032258064516129, 0.0387096774193548, 0.0419354838709677, 
        0.0516129032258065, 0.0580645161290323, 0.0645161290322581, 
        0.067741935483871, 0.0709677419354839, 0.0774193548387097, 
        0.0806451612903226, 0.0838709677419355, 0.0870967741935484, 
        0.0903225806451613, 0.0935483870967742, 0.103225806451613, 
        0.106451612903226, 0.116129032258065, 0.12258064516129, 
        0.125806451612903, 0.129032258064516, 0.132258064516129, 
        0.138709677419355, 0.145161290322581, 0.148387096774194, 
        0.151612903225806, 0.154838709677419, 0.158064516129032, 
        0.174193548387097, 0.17741935483871, 0.180645161290323, 
        0.183870967741935, 0.187096774193548, 0.190322580645161, 
        0.193548387096774, 0.203225806451613, 0.206451612903226, 
        0.209677419354839, 0.212903225806452, 0.219354838709677, 
        0.232258064516129, 0.235483870967742, 0.238709677419355, 
        0.241935483870968, 0.248387096774194, 0.251612903225806, 
        0.254838709677419, 0.258064516129032, 0.261290322580645, 
        0.274193548387097, 0.283870967741935, 0.287096774193548, 
        0.293548387096774, 0.296774193548387, 0.3, 0.303225806451613, 
        0.312903225806452, 0.319354838709677, 0.325806451612903, 
        0.329032258064516, 0.338709677419355, 0.341935483870968, 
        0.345161290322581, 0.351612903225806, 0.361290322580645, 
        0.367741935483871, 0.370967741935484, 0.374193548387097, 
        0.380645161290323, 0.383870967741935, 0.387096774193548, 
        0.390322580645161, 0.393548387096774, 0.4, 0.403225806451613, 
        0.412903225806452, 0.416129032258065, 0.42258064516129, 
        0.425806451612903, 0.429032258064516, 0.435483870967742, 
        0.441935483870968, 0.445161290322581, 0.451612903225806, 
        0.454838709677419, 0.461290322580645, 0.467741935483871, 
        0.474193548387097, 0.47741935483871, 0.483870967741935, 
        0.487096774193548, 0.493548387096774, 0.496774193548387, 
        0.509677419354839, 0.512903225806452, 0.519354838709677, 
        0.525806451612903, 0.529032258064516, 0.532258064516129, 
        0.535483870967742, 0.538709677419355, 0.541935483870968, 
        0.548387096774194, 0.551612903225806, 0.554838709677419, 
        0.558064516129032, 0.564516129032258, 0.570967741935484, 
        0.580645161290323, 0.587096774193548, 0.593548387096774, 
        0.596774193548387, 0.606451612903226, 0.609677419354839, 
        0.616129032258064, 0.62258064516129, 0.625806451612903, 
        0.629032258064516, 0.632258064516129, 0.635483870967742, 
        0.638709677419355, 0.641935483870968, 0.645161290322581, 
        0.648387096774194, 0.651612903225806, 0.654838709677419, 
        0.658064516129032, 0.661290322580645, 0.664516129032258, 
        0.667741935483871, 0.674193548387097, 0.687096774193548, 
        0.693548387096774, 0.7, 0.706451612903226, 0.719354838709677, 
        0.72258064516129, 0.732258064516129, 0.748387096774194, 
        0.754838709677419, 0.761290322580645, 0.767741935483871, 
        0.770967741935484, 0.787096774193548, 0.790322580645161, 
        0.793548387096774, 0.803225806451613, 0.806451612903226, 
        0.816129032258065, 0.819354838709677, 0.832258064516129, 
        0.845161290322581, 0.858064516129032, 0.867741935483871, 
        0.874193548387097, 0.880645161290323, 0.883870967741936, 
        0.887096774193548, 0.890322580645161, 0.893548387096774, 
        0.9, 0.906451612903226, 0.909677419354839, 0.919354838709677, 
        0.925806451612903, 0.929032258064516, 0.935483870967742, 
        0.941935483870968, 0.945161290322581, 0.958064516129032, 
        0.964516129032258, 0.967741935483871, 0.970967741935484, 
        0.983870967741935, 0.987096774193548, 0.993548387096774, 
        0.996774193548387, 1), y_scaled = c(0.0492817583009432, 
        0.190656877637856, 0.00103634216336964, 0.421571386929484, 
        0.00103634216336964, 0.122380048945144, 0.615307210635291, 
        0.247082020000616, 0.0931168115898434, 0.0854563307471332, 
        0.00155415514479068, 0.0135877564087414, 0.131407040394426, 
        0.057112694869211, 0.330095390748265, 0.115250988893878, 
        0.0213162763015691, 0.00446479408876733, 0.00129489055381638, 
        0.11080982942252, 0.00077707757239534, 0.0171293680174925, 
        0.554621391334117, 0.0760160915934531, 0.0172769053261685, 
        0.107637777285987, 0.0237692631084392, 0.018990056988076, 
        0.0976030916944373, 0.00406014079069971, 0.186896824868201, 
        0.0234999717100792, 0.170273094423161, 0.00352442279608983, 
        0.108057470795133, 0.000830792611961838, 0.0137030646936775, 
        0.0200829789931223, 0.113030767258463, 0.000830792611961838, 
        0.160784153633608, 0.142136440497702, 0.0264041648493078, 
        0.105118900030582, 0.000553623007798708, -0.000271439999942704, 
        0.109160419607565, 0.134734508045439, 0.00452137393044404, 
        0.701173924284713, 0.036865705955279, 0.137133063612215, 
        0.0667334165558346, 0.123313974433074, 0.00602754363988865, 
        0.177982993102273, 0.000953979102701007, -0.0240442841110197, 
        0.220941416945448, 0.0422773171414718, 0.963447989875789, 
        0.135513018018889, 0.0127197213693468, 0.524219395140006, 
        0.00194949783600011, 0.117991888312825, 0.00359317804673495, 
        0.15537683965058, 0.0151576679651382, 0.180042069618988, 
        0.224604782643883, 0.52413058627459, 0.289822002682887, 
        0.0123587563034599, 0.221475702539002, 0.311048753918512, 
        0.221545890190703, 0.346732729003328, 0.327683943571993, 
        0.353645496495273, 0.140613081975596, 0.217127649136226, 
        0.000227751767761952, 0.535281828488595, -0.000649593878490851, 
        0.588982544044542, 0.34120867433431, -7.16200527553309e-07, 
        0.443600998956496, 0.400351797699134, 0.843573210376027, 
        0.541554312708907, 0.252675546120807, 0.398434528886874, 
        0.153862075534805, 0.20528026000944, 0.257045801739938, 
        0.546312749013971, 0.256560217782256, 0.54623969656016, 
        0.257138191607992, 0.442977188296997, 0.301072796770222, 
        0.175744150253141, 0.0420452681705445, 0.768606352555439, 
        0.253566499577084, 0.0242133074355223, 0.560529329485904, 
        0.00198315926079511, 0.300509863155565, 0.731109673935386, 
        0.291253687537466, 0.0115157882825296, 0.334381134705144, 
        0.738694953722703, 0.300045049013183, 0.800125621572533, 
        0.349684191377375, 0.796768073499363, 0.320839215130166, 
        0.323652450802395, 0.793544454924845, 0.0481694988816529, 
        0.606589617813913, 0.237813668973549, 0.00465816823120672, 
        0.353682738922705, 0.823488798981849, 0.337319705469695, 
        0.00465816823120672, 0.428075920120723, 0.796762343895143, 
        0.563853932334807, 0.0215784056946536, 0.027883835139233, 
        0.925293839171442, 0.0773811697989697, 0.577524768004744, 
        0.0766535100629755, 0.0430200170885446, 0.16064592693179, 
        0.0670585715953438, 1, 0.00371278353483635, 0.122734568206283, 
        0.00570095619932434, 0.00934211968140536, 0.98690355715316, 
        -0.0378984671160109, 0.00361251546097889, -0.0478780052669387, 
        0.00532853192499662, 0.00316202532914786, 0.0460137352937174, 
        0.0393487731843063, 0.0461648536050312, 0.0109385306573217, 
        0.0183490575159158, 0.0579212852648187, 0.00377079577756817, 
        0.0955210967608399, 0.146058354586584, 0.0542013397247068, 
        0.291223607115309, -0.00465530342909651, 0.197097668982143, 
        0.266477446487287, 0.100099050532961, 0.00329452242674522, 
        0.281721774716259, 0.100059659503945, 0.269824251552544, 
        0.00282684348225291, 0.231027668974981, 0.792011069595354, 
        0.255082696093914, 0.270540452080097, 0.399186539440805, 
        0.00360965065886868, 0.106225429845652, 0.304277794131023, 
        0.287798019992022)), .Names = c("ds", "y", "half", "quarter", 
    "mday", "qday", "yday", "mweek", "week", "floor", "t", "y_scaled"
    ), row.names = c(NA, -183L), class = c("tbl_df", "tbl", "data.frame"
    )), history.dates = structure(c(1325462400, 1328486400, 1329091200, 
    1329696000, 1330300800, 1330905600, 1331510400, 1332720000, 
    1333324800, 1335139200, 1336348800, 1337558400, 1338163200, 
    1338768000, 1339977600, 1340582400, 1341187200, 1341792000, 
    1342396800, 1343001600, 1344816000, 1345420800, 1347235200, 
    1348444800, 1349049600, 1349654400, 1350259200, 1351468800, 
    1352678400, 1353283200, 1353888000, 1354492800, 1355097600, 
    1358121600, 1358726400, 1359331200, 1359936000, 1360540800, 
    1361145600, 1361750400, 1363564800, 1364169600, 1364774400, 
    1365379200, 1366588800, 1369008000, 1369612800, 1370217600, 
    1370822400, 1372032000, 1372636800, 1373241600, 1373846400, 
    1374451200, 1376870400, 1378684800, 1379289600, 1380499200, 
    1381104000, 1381708800, 1382313600, 1384128000, 1385337600, 
    1386547200, 1387152000, 1388966400, 1389571200, 1390176000, 
    1391385600, 1393200000, 1394409600, 1395014400, 1395619200, 
    1396828800, 1397433600, 1398038400, 1398643200, 1399248000, 
    1400457600, 1401062400, 1402876800, 1403481600, 1404691200, 
    1405296000, 1405900800, 1407110400, 1408320000, 1408924800, 
    1410134400, 1410739200, 1411948800, 1413158400, 1414368000, 
    1414972800, 1416182400, 1416787200, 1417996800, 1418601600, 
    1421020800, 1421625600, 1422835200, 1424044800, 1424649600, 
    1425254400, 1425859200, 1426464000, 1427068800, 1428278400, 
    1428883200, 1429488000, 1430092800, 1431302400, 1432512000, 
    1434326400, 1435536000, 1436745600, 1437350400, 1439164800, 
    1439769600, 1440979200, 1442188800, 1442793600, 1443398400, 
    1444003200, 1444608000, 1445212800, 1445817600, 1446422400, 
    1447027200, 1447632000, 1448236800, 1448841600, 1449446400, 
    1450051200, 1450656000, 1451865600, 1454284800, 1455494400, 
    1456704000, 1457913600, 1460332800, 1460937600, 1462752000, 
    1465776000, 1466985600, 1468195200, 1469404800, 1470009600, 
    1473033600, 1473638400, 1474243200, 1476057600, 1476662400, 
    1478476800, 1479081600, 1481500800, 1483920000, 1486339200, 
    1488153600, 1489363200, 1490572800, 1491177600, 1491782400, 
    1492387200, 1492992000, 1494201600, 1495411200, 1496016000, 
    1497830400, 1499040000, 1499644800, 1500854400, 1502064000, 
    1502668800, 1505088000, 1506297600, 1506902400, 1507507200, 
    1509926400, 1510531200, 1511740800, 1512345600, 1512950400
    ), class = c("POSIXct", "POSIXt"), tzone = "GMT")), .Names = c("growth", 
"n.changepoints", "yearly.seasonality", "weekly.seasonality", 
"daily.seasonality", "holidays", "seasonality.prior.scale", "changepoint.prior.scale", 
"holidays.prior.scale", "mcmc.samples", "interval.width", "uncertainty.samples", 
"specified.changepoints", "start", "y.scale", "logistic.floor", 
"t.scale", "changepoints.t", "seasonalities", "extra_regressors", 
"stan.fit", "params", "history", "history.dates"), class = c("prophet", 
"list"))
bletham commented 6 years ago

Are the data here daily data or are their gaps (missing days) in the data?

A horizon of 92 days would mean that from cutoff we would extend out 92 days, but if there is (for example) only data for days 5, 10, and 80, then you will see that the difference between max and min will be 80-5=75. Is that possibly what's happening here?

roumail commented 6 years ago

Hi, Indeed, this is weekly data with missing values. What you say makes sense. Thanks for the clarification! We can only validate for the given horizon if we have the data.

I was just surprised to see this behaviour. Perhaps helpful to add a warning here?

bletham commented 6 years ago

Great, yeah this should be more clearly described in the documentation.

bletham commented 6 years ago

Described more clearly, and now in v0.3 also always respects initial.