skmisc.loess.loess_prediction

class skmisc.loess.loess_prediction(newdata, loess, stderror=False)

Class for loess prediction results

Holds the predicted values and standard errors of a loess object

Parameters:
newdatandarray[m, p]

Independent variables where the surface must be estimated, with m the number of new data points, and p the number of independent variables.

loessloess.loess

Loess object that has been successfully fitted, i.e loess.fit has been called and it returned without any errors.

stderrorboolean

Whether the standard error should be computed

confidence(self, alpha=0.05)

Returns the pointwise confidence intervals

Parameters:
alphafloat

The alpha level for the confidence interval. The default alpha=0.05 returns a 95% confidence interval. Therefore it must be in the range (0, 1).

Returns:
outloess_confidence_intervals

Confidence intervals object. It has attributes fit, lower and upper

df

float - Degrees of freedom of the loess fit.

It is used with the t-distribution to compute pointwise confidence intervals for the evaluated surface. It is obtained using the formula (one_delta ** 2) / two_delta.

m

int - Number of observations in the new data points

residual_scale

float - Estimate of the scale of the residuals

stderr

ndarray - Estimates of the standard error on the estimated values, shape (m,)

Raises ValueError if the standard error was not computed.

values

ndarray - loess values evaluated at newdata, shape (m,)