code: def initparamtheta(
      initial_smoothed: float,
      alpha: float,
      theta: float,
      y: np.ndarray,
      modeltype: str,
  ):
      if modeltype in ["STM", "DSTM"]:
          if np.isnan(initial_smoothed):
              initial_smoothed = y[0] / 2
              optimize_level = 1
          else:
              optimize_level = 0
          if np.isnan(alpha):
              alpha = 0.5
              optimize_alpha = 1
          else:
              optimize_alpha = 0
          theta = 2.0  # no optimize
          optimize_theta = 0
      elif modeltype in ["OTM", "DOTM"]:
          if np.isnan(initial_smoothed):
              initial_smoothed = y[0] / 2
              optimize_level = 1
          else:
              optimize_level = 0
          if np.isnan(alpha):
              alpha = 0.5
              optimize_alpha = 1
          else:
              optimize_alpha = 0
          if np.isnan(theta):
              theta = 2.0
              optimize_theta = 1
          else:
              optimize_theta = 0
      return {
          "initial_smoothed": initial_smoothed,
          "optimize_initial_smoothed": optimize_level,
          "alpha": alpha,
          "optimize_alpha": optimize_alpha,
          "theta": theta,
          "optimize_theta": optimize_theta,
      }
  
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 6 for calling a global function with example usage: initparamtheta(initial_smoothed, alpha, theta, y, modeltype) and returns: dict