statsmodels.discrete.discrete_model.CountModel.predict

CountModel.predict(params, exog=None, exposure=None, offset=None, which='mean', linear=None)[source]

预测给定外生变量的计数模型的响应变量

Parameters:
paramsarray_like

模型参数

exogarray_like, optional

设计 / 外生数据。如果 exog 为 None,则使用模型的 exog。

exposurearray_like, optional

Log(exposure) 被添加到线性预测中,系数等于 1。如果未提供 exposure 且 exog 为 None,则使用模型中存在的 exposure(如果有)。如果没有,则使用 0 作为默认值。

offsetarray_like, optional

偏移量与系数等于1的线性预测相加。如果未提供偏移量且exog为None,则使用模型中存在的偏移量(如果存在)。如果不存在,则使用0作为默认值。

which‘mean’, ‘linear’, ‘var’, ‘prob’ (optional)

要预测的统计量。默认是‘均值’。

  • ‘mean’ 返回内生变量的条件期望 E(y | x),即线性预测器的指数。

  • ‘linear’ 返回均值函数的线性预测器。

  • ‘var’ 似然模型隐含的因变量方差

  • ‘prob’ 预测的计数概率。

linearbool

如果为True,返回线性预测值。如果为False或None,则返回由which指定的统计量。

注释

如果指定了曝光,那么该方法将会记录它。用户不需要先记录它。


Last update: Oct 16, 2024