statsmodels.discrete.discrete_model.NegativeBinomialP.predict¶
-
NegativeBinomialP.predict(params, exog=
None, exposure=None, offset=None, which='mean', y_values=None)[source]¶ 预测给定外生变量的模型的响应变量。
- Parameters:¶
- paramsarray_like
模型的拟合参数的二维数组。应按照模型返回的顺序排列。
- exogarray_like,
optional 外生变量的1维或2维数组。如果没有提供,则使用模型的exog属性。如果给定的是1维数组,则假定它是外生变量的一行。如果你只有一个回归变量并且想要进行预测,你必须提供一个形状为[1] == 1的2维数组。
- offsetarray_like,
optional 偏移量被添加到线性预测器中,系数等于1。 如果exog不为None,则默认值为零;如果exog为None,则默认值为模型偏移量。
- exposurearray_like,
optional Log(exposure) 被添加到线性预测中,系数等于1。 如果exog不为None,则默认值为1,如果exog为None,则为模型曝光。
- which‘mean’, ‘linear’, ‘var’, ‘prob’ (
optional) 要预测的统计量。默认是‘均值’。
‘mean’ 返回内生变量的条件期望 E(y | x),即线性预测器的指数。
‘linear’ 返回均值函数的线性预测器。
‘var’ 返回模型所隐含的endog的估计方差。
‘prob’ 返回从 0 到 max(endog) 的计数的概率,或者如果提供了 y_values,则返回这些值的概率。
- linearbool
The
linear` keyword is deprecated and will be removed, use ``which关键字代替。 如果为 True,则返回线性预测值。如果为 False 或 None, 则将返回由which指定的统计量。- y_valuesarray_like
随机变量 endog 的值,在这些值上计算 pmf。 仅在
which="prob"时使用
Last update:
Oct 16, 2024