class_docstr: A class containing functions supporting quantile, poisson and gaussian regression, to be used as a mixin for some
  `RegressionModel` subclasses.
class_docstr_tok: ["A","class","containing","functions","supporting","quantile",",","poisson","and","gaussian","regression",",","to","be","used","as","a","mixin","for","some","`","RegressionModel","`","subclasses","."]
code: def _predict_and_sample_likelihood(
      self,
      x: np.ndarray,
      num_samples: int,
      likelihood: str,
      predict_likelihood_parameters: bool,
      **kwargs,
  ) -> np.ndarray:
      model_output = getattr(self, f"_predict_{likelihood}")(
          x, num_samples, predict_likelihood_parameters, **kwargs
      )
      if predict_likelihood_parameters:
          return getattr(self, f"_params_{likelihood}")(model_output)
      else:
          if num_samples == 1:
              return model_output
          else:
              return getattr(self, f"_sampling_{likelihood}")(
                  model_output
              )
  
imports: from collections import OrderedDict
  from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
  import numpy
  import pandas
  from sklearn.linear_model import LinearRegression
  from darts.logging import get_logger, raise_if, raise_if_not, raise_log
  from darts.models.forecasting.forecasting_model import GlobalForecastingModel
  from darts.timeseries import TimeSeries
  from darts.utils.data.tabularization import add_static_covariates_to_lagged_data, create_lagged_component_names, create_lagged_training_data
  from darts.utils.historical_forecasts import _check_optimizable_historical_forecasts_global_models, _optimized_historical_forecasts_all_points, _optimized_historical_forecasts_last_points_only, _process_historical_forecast_input
  from darts.utils.multioutput import MultiOutputRegressor
  from darts.utils.utils import _check_quantiles, get_single_series, seq2series, series2seq
label_desc: Use image node_id 14 for calling the _LikelihoodMixin obj's underlying member method code with example usage: obj._predict_and_sample_likelihood(x, num_samples, likelihood, predict_likelihood_parameters) and returns: getattr, model_output, getattr