zemlyansky / arima

ARIMA, SARIMA, SARIMAX and AutoARIMA models for time series analysis and forecasting in the browser and Node.js
https://www.npmjs.com/arima
75 stars 18 forks source link

Auto arima produces logs #5

Open y4nnick opened 3 years ago

y4nnick commented 3 years ago

Hi, thanks for the gread library!

The following call produces a console.log which is not ideal in my case since i love a clean console ;).

Call:

static forecastTimeseriesNpmArima({ts, exog, newExog, forecastHorizon}: ForecastArguments): Array<Array<number>> {

        // Init and fit sarimax
        const sarimax = new ARIMA({
            auto: true,
            transpose: false,
            verbose: false
        }).fit(ts, exog)

        return sarimax.predict(forecastHorizon, newExog)
    }

Log:

0.05

      at Object.printChar (../node_modules/arima/wasm/native.js:9:14612)
          at wasm-function[173]:0x1b591
          at wasm-function[70]:0x942d
          at wasm-function[21]:0x3e4b
          at wasm-function[72]:0x95ea
          at wasm-function[105]:0xfd0c

Arguments to the function:

{
      args: {
        forecastHorizon: 24,
        ts: [
            -1.3218134721103225,  5.402732981816372, 11.994985179193174,
             17.251233364558672, 27.918535436034198, 33.663998749376425,
              37.40250522110233,  45.88332535115516,  54.63113638724488,
             59.396328386032614,  64.48860471187179,  72.31638867650383,
              69.42073816816638,  65.62843331042902,  61.62907309148302,
             62.296603419396845, 44.495230513590144,  40.05695375648077,
             38.408008406341246, 31.578441456483517, 25.567934069804355,
              21.68860153033101, 15.293043989021381,  8.399252785372369,
              6.189879772888429,  3.493364310438718,  3.433373296228903,
               0.87996779604127, 4.4859112456723915,  4.536935267618869,
              4.236849557182065,  7.466436534775678,  9.498055009414607,
              11.47632364410014, 15.569494898507319,  17.67094703582015,
             20.575811635614794,  23.66550570546584,  22.96313167300972,
             24.276368316366792, 25.091757726854812, 25.887536187031124,
              27.53074419573853, 27.264400951382473, 30.806624159636044,
              32.27615214781896,     32.60034307113,  35.34624576189487,
              36.74175183865871, 37.368658445938905,  45.82184802280855,
             48.422008095788385, 51.261887437126184,  51.56174133874234,
              49.98035900463187,  47.74559330768086,  40.98075557680516,
              39.66895599919573,  38.53111178358073,  38.83802388163839,
              36.63894916189736,  34.99460043197398,  23.49473869759815,
             20.609852646973415, 19.899640918226645, 20.158389927033248,
             21.472083359464158,  22.65749599365079, 26.580690395434956,
             25.867244997693906,  23.04889599475246, 18.156063652284526,
              16.27163534215159, 13.877019507665999, 16.281019929314766,
             16.256807599982427,  9.364818197617941,  5.506147787799653,
          0.0017394231295098095, -3.151708823228039, -7.421134271637109,
             -9.121630467226948,  -8.19553134001647, -4.084845977909756,
            -3.3471405705705615, -0.609890765045118, 0.6064547579733404,
            -1.0472245501352617, 3.1033971660887394,  5.195470965021043,
             11.298653672855519, 13.326694113397973, 16.179313543651787,
              17.45005665622008, 16.700312024566877, 10.155839492293905
        ],
        exog: [ [Array] ],
        newExog: [ [Array] ]
      },
      result: [
        [
           23.834858289310922,  25.616766483546634,
           26.649978366484927,  28.149767139089793,
            29.80090299478742,   30.63404061398223,
           31.099174549544646,  30.796995327647913,
            29.63344461358344,  27.384883597474058,
           24.258592508764057,   20.66523012516985,
           16.461959335877612,  10.778594630082804,
            4.729207102716685, -1.4051787201827333,
           -7.147559941166158,  -12.25851653703733,
          -17.166871897789875,  -20.69421099265017,
          -23.436964816708677, -24.512538585109148,
          -25.417778886566403, -25.845485052675407
        ],
        [
          32.383248623448466,  86.93430506599908,
          167.69195231439193,  284.9795214568142,
           428.9110178991678,  597.7124419561235,
           789.5493024371243, 1000.1221976608723,
           1226.777212174488,  1467.063091676959,
          1718.5876954922085,  1979.461856116068,
           2248.065993010299,  2523.017193595188,
           2803.181980100002, 3087.6176823478645,
           3375.544221405373,  3666.321970160712,
           3959.425624267539, 4254.4248681057115,
           4550.968124509848,  4848.768271513382,
           5147.591108282911,  5447.245791436911
        ]
      ]
    }
jornncc commented 3 years ago

I saw this too. can't have logging in production env.