如何用R计算客户对未来三个月销售额的预测?

时间:2016-11-24 15:16:49

标签: r forecasting predict

我从2009年1月到2012年12月的4年内每月总销售额,我有749位客户,我想要2013年1月,2013年2月和2013年3月的客户预测。我该怎么做?所有人都用R谈论ARIMA,但我不知道。你能帮帮我吗?

     CustomerName        01/2009 02/2009 03/2009 04/2009 05/2009 06/2009 07/2009 08/2009 09/2009 10/2009
     Aaron Bergman         0.00    0.00    0.00    0.00    0.00     0.0 4270.87    0.00    0.00       0
     Aaron Hawkins         0.00    0.00    0.00    0.00    0.00     0.0    0.00  455.04    0.00       0
     Aaron Smayling        136.29  4658.69 0.00    119.34  4674.16  0.0    0.00    0.00    0.00       0
     Adam Bellavance       0.00    0.00    0.00    0.00    2107.55  0.0    0.00    0.00    0.00       0
     Adam Hart             60.52   0.00    0.00    0.00    0.00     0.0    0.00    0.00    0.00       0
     Adam Shillingsburg    0.00    1749.50 125.86  0.00    0.00     5689.4 3275.74 1296.30 9887.52    0
     Adrian Barton         0.00    0.00    0.00    0.00    0.00     0.0    0.00    0.00    0.00       0
     Adrian Hane           0.00    0.00    0.00    0.00    0.00     0.0    0.00    0.00    0.00       0
     Adrian Shami          0.00    0.00    0.00    0.00    0.00     0.0    0.00    0.00    0.00       0
     Aimee Bixby           0.00    0.00    0.00    0.00    0.00     0.0    0.00    0.00    0.00       0

数据的dput()

structure(
  list(
    CustomerName = structure(
      1:10,
      .Label = c(
        "Aaron Bergman",
        "Aaron Hawkins",
        "Aaron Smayling",
        "Adam Bellavance",
        "Adam Hart",
        "Adam Shillingsburg",
        "Adrian Barton",
        "Adrian Hane",
        "Adrian Shami",
        "Aimee Bixby"
      ),
      class = "factor"
    ),
    "01 - 2009" = c(0, 0, 136.29,  0, 60.52, 0, 0, 0, 0, 0),
    "02 - 2009" = c(0, 0, 4658.69, 0, 0,  1749.5, 0, 0, 0, 0),
    "03 - 2009" = c(0, 0, 0, 0, 0, 125.86, 0,  0, 0, 0),
    "04 - 2009" = c(0, 0, 119.34, 0, 0, 0, 0, 0, 0, 0),
    "05 - 2009" = c(0,  0, 4674.16, 2107.55, 0, 0, 0, 0, 0, 0),
    "06 - 2009" = c(0, 0, 0,  0, 0, 5689.4, 0, 0, 0, 0),
    "07 - 2009" = c(4270.87, 0, 0, 0, 0,  3275.74, 0, 0, 0, 0),
    "08 - 2009" = c(0, 455.04, 0, 0, 0, 1296.3, 0, 0, 0, 0),
    "09 - 2009" = c(0, 0, 0, 0, 0, 9887.52, 0, 0, 0, 0),
    "10 - 2009" = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
    "11 - 2009" = c(0, 0, 0, 0, 2169.64, 0, 0, 0, 699.93, 0),
    "12 - 2009" = c(0, 12524.5, 0, 0, 0, 0, 0, 0, 0, 0),
    "01 - 2010" = c(0, 0, 0, 0, 665.86, 0, 0, 0, 0, 0),
    "02 - 2010" = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
    "03 - 2010" = c(0, 0, 0, 30.98, 0, 0, 0, 0, 0, 0),
    "04 - 2010" = c(0, 0, 0, 52.65, 0, 0, 0, 0, 0, 0),
    "05 - 2010" = c(0, 3880.32, 0, 0, 0, 0, 0, 0, 0, 0),
    "06 - 2010" = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
    "07 - 2010" = c(5640.02, 0, 0, 0, 0, 0, 0, 386.52, 0, 0),
    "08 - 2010" = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
    "09 - 2010" = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
    "10 - 2010" = c(0, 467.1, 0, 0, 0, 295.35, 0, 0, 0, 0),
    "11 - 2010" = c(2385.64, 0, 0, 0, 1965.4, 0, 0, 0, 0, 0),
    "12 - 2010" = c(0, 0, 38.72, 0, 0, 0, 0, 0, 0, 0),
    "01 - 2011" = c(0, 0, 0, 0, 0, 91.58, 0, 0, 0, 0),
    "02 - 2011" = c(0, 296.46, 0, 0, 0, 0, 0, 0, 0, 1816.08),
    "03 - 2011" = c(0, 0, 0, 0, 9475.54, 0, 0, 0, 0, 0),
    "04 - 2011" = c(0, 0, 71.76, 124.32, 41.86, 0, 0, 0, 0, 0),
    "05 - 2011" = c(14.4, 291.6, 0, 3932.65, 0, 0, 0, 0, 0, 0),
    "06 - 2011" = c(0, 0, 0, 0, 1559.48, 0, 0, 0, 0, 0),
    "07 - 2011" = c(0, 0, 0, 0, 1832.32, 0, 0, 0, 0, 0),
    "08 - 2011" = c(0, 0, 0, 0, 0, 194.4, 0, 0, 0, 0),
    "09 - 2011" = c(0, 0, 0, 0, 319.76, 0, 0, 0, 0, 1156.23),
    "10 - 2011" = c(0, 466.64, 0, 0, 706.83, 0, 0, 0, 0, 0),
    "11 - 2011" = c(0, 0, 0, 0, 0, 0, 20819.54, 0, 413.91, 0),
    "12 - 2011" = c(0, 10051.63, 0, 0, 213.8, 0, 0, 0, 0, 0),
    "01 - 2012" = c(0, 0, 98.67, 0, 351, 0, 0, 0, 0, 0),
    "02 - 2012" = c(0, 0, 0, 0, 0, 0, 0, 0, 325.85, 0),
    "03 - 2012" = c(0, 0, 0, 0, 0, 0, 0, 127.68, 0, 0),
    "04 - 2012" = c(0, 0, 0, 0, 900.16, 0, 0, 0, 0, 0),
    "05 - 2012" = c(0, 0, 0, 0, 0, 0, 1451.78, 0, 0, 0),
    "06 - 2012" = c(0, 0, 0, 0, 0, 0, 0, 309.65, 0, 0),
    "07 - 2012" = c(0, 0, 0, 0, 5791.64, 0, 0, 0, 0, 0),
    "08 - 2012" = c(0, 0, 0, 0, 0, 0, 0, 0, 2783.42, 0),
    "09 - 2012" = c(0, 0, 0, 0, 40.46, 0, 0, 0, 0, 0),
    "10 - 2012" = c(0, 0, 0, 5062.12, 0, 0, 0, 0, 0, 0),
    "11 - 2012" = c(0, 0, 0, 0, 1752.6, 0, 0, 0, 533.5, 0),
    "12 - 2012" = c(0, 0, 0, 0, 436.96, 0, 0, 0, 0, 0)
  ),
  .Names = c(
    "CustomerName",
    "01-2009",
    "02-2009",
    "03-2009",
    "04-2009",
    "05-2009",
    "06-2009",
    "07-2009",
    "08-2009",
    "09-2009",
    "10-2009",
    "11-2009",
    "12-2009",
    "01-2010",
    "02-2010",
    "03-2010",
    "04-2010",
    "05-2010",
    "06-2010",
    "07-2010",
    "08-2010",
    "09-2010",
    "10-2010",
    "11-2010",
    "12-2010",
    "01-2011",
    "02-2011",
    "03-2011",
    "04-2011",
    "05-2011",
    "06-2011",
    "07-2011",
    "08-2011",
    "09-2011",
    "10-2011",
    "11-2011",
    "12-2011",
    "01-2012",
    "02-2012",
    "03-2012",
    "04-2012",
    "05-2012",
    "06-2012",
    "07-2012",
    "08-2012",
    "09-2012",
    "10-2012",
    "11-2012",
    "12-2012"
  ),
  class = "data.frame",
  row.names = c(NA, -10L)
)

0 个答案:

没有答案