code: def thetafcst(states, i, modeltype, f, h, alpha, theta):
      # obs:
      # forecast are obtained in a recursive manner
      # this is not standard, for example in ets
      # forecasts
      new_states = np.zeros((i + h, states.shape[1]), dtype=np.float32)
      new_states[:i] = states[:i]
      for i_h in range(h):
          thetaupdate(
              states=new_states,
              i=i + i_h,
              modeltype=modeltype,
              alpha=alpha,
              theta=theta,
              y=0,
              usemu=1,
          )
          f[i_h] = new_states[i + i_h, 4]
  
imports: import math
  from typing import Tuple
  import numpy
  from numba import njit
  from scipy.stats import norm
  from statsmodels.tsa.seasonal import seasonal_decompose
  from statsmodels.tsa.stattools import acf
  from .ets import restrict_to_bounds, results
  from .utils import _seasonal_naive, _repeat_val_seas, CACHE, NOGIL
label_desc: Use image node_id 3 for calling a global function with example usage: thetafcst(states, i, modeltype, f, h, alpha, theta) without return types