Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect error messages when predefined parameters in ets models when using future calls #412

Open
GBarnsley-ukhsa opened this issue Nov 27, 2024 · 0 comments

Comments

@GBarnsley-ukhsa
Copy link

GBarnsley-ukhsa commented Nov 27, 2024

I seem to be getting error messages about objects not being found when I use an object from outside the ets call to defined something in the ETS formula. This only occurs in a very specific scenario where I'm using a multisession future (not tested multicore) and parameters are out of range

Could be related to #405

See the code below, the first couple of examples suffice for a minimal working example

library(tsibble)
library(fabletools)
library(future)

# specify a parameter outside the ETS call
alpha <- 0.666

# run model, no paralleism

fabletools::model(
  tourism,
  ets = fable::ETS(
    Trips ~ error("A") +
      trend(
        "A",
        alpha = alpha,
        beta = 0.610
      ) +
      season(
        "A",
        period = "4 year",
        gamma = 0.1
      )
  )
)

#correct error, parameters out of range

future::plan(future::sequential())

fabletools::model(
  tourism,
  ets = fable::ETS(
   Trips ~ error("A") +
      trend(
        "A",
        alpha = alpha,
        beta = 0.610
      ) +
      season(
        "A",
        period = "4 year",
        gamma = 0.1
      )
  )
)

#correct error, parameters out of range

future::plan(future::multisession(workers = 2))

fabletools::model(
  tourism,
  ets = fable::ETS(
    Trips ~ error("A") +
      trend(
        "A",
        alpha = alpha,
        beta = 0.610
      ) +
      season(
        "A",
        period = "4 year",
        gamma = 0.1
      )
  )
)

# error about how alpha cannot be found

lambda <- 0.3
fabletools::model(
  tourism,
  ets = fable::ETS(
   Trips ~ error("A") +
      trend(
        "A",
        alpha = 0.666,
        beta = 0.610
      ) +
      season(
        "A",
        period = "4 year",
        gamma = 0.1
      )
  )
)

# different error (also wrong) if in the transformation

# but works if not out of range

fabletools::model(
  tourism,
  ets = fable::ETS(
   Trips ~ error("A") +
      trend(
        "A",
        alpha = alpha,
        beta = 0.610
      ) +
      season(
        "A",
        period = "1 year",
        gamma = 0.1
      )
  )
)

fabletools::model(
  tourism,
  ets = fable::ETS(
    fabletools::box_cox(Trips, lambda) ~ error("A") +
      trend(
        "A",
        alpha = 0.666,
        beta = 0.610
      ) +
      season(
        "A",
        period = "1 year",
        gamma = 0.1
      )
  )
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant