Code Monkey home page Code Monkey logo

Comments (3)

christophsax avatar christophsax commented on August 22, 2024

@jlivsey, @andreranza can we take a look at this when we investigate quality measures? Can we get this statistic from X-13 instead?

from seasonal.

andreranza avatar andreranza commented on August 22, 2024

Maybe?

library(seasonal)
m <- seas(AirPassengers)
series <- series(m, "check.acf")
#> specs have been added to the model: check
#> To speed up, extend the `seas()` call (see ?series):
#> seas(x = AirPassengers, check.save = "acf")
series_df <- as.data.frame(series)
series_df$Ljung.Box_Q
#>  [1]  0.0496485  2.4306218  6.8130876  7.0890097  7.1140683  9.3729836
#>  [7] 10.0627983 11.8883864 12.1304734 12.8287381 12.8652000 13.2923086
#> [13] 13.3074845 13.3578531 13.3801174 13.4152318 13.6177014 13.6814549
#> [19] 14.8550759 20.3043691 21.7717755 21.8652860 23.8364488 23.8849767

Created on 2024-02-29 with reprex v2.1.0

from seasonal.

andreranza avatar andreranza commented on August 22, 2024

Also, I discovered udg() returns just the significant ones:

library(seasonal)
m <- seas(AirPassengers)

udg <- udg(m)
udg$`lbq$03`
#> [1] 6.813 1.000 0.009
udg$`lbq$04`
#> [1] 7.089 2.000 0.029
udg$nlbq
#> [1] 2
udg$lblags
#> [1] 3 4

Created on 2024-02-29 with reprex v2.1.0

I guess we get in order:

  • statistic value
  • std. error
  • p-value

The degrees of freedom can be found in here:

library(seasonal)
m <- seas(AirPassengers)
series <- series(m, "check.acf")
#> specs have been added to the model: check
#> To speed up, extend the `seas()` call (see ?series):
#> seas(x = AirPassengers, check.save = "acf")
series_df <- as.data.frame(series)
series_df$df_of_Q
#>  [1]  0  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22

Created on 2024-02-29 with reprex v2.1.0

@christophsax not sure how it would be possible to reproduce these results using Box.test(residuals) if I got the question right. It would be indeed interesting to compare

from seasonal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.