xls.fit: Fitting an eXtreme Least Squares Model

View source: R/xls.fit.R

xls.fitR Documentation

Fitting an eXtreme Least Squares Model

Description

Almost the same interface as stats::lm. Just includes two parameters more, error_weights and error_ahead_level

Usage

xls.fit(formula, data, error_weights = NULL, error_ahead_level = 4)

Arguments

formula

An object of class "formula": a symbolic description of the model to be fitted.

data

A "data.frame" (with no missing values) object containing the variables in the model.

error_weights

A numeric vector including error weights by order. If NULL, it is created automatically by error_ahead_level amount, decreasing at equal intervals.

error_ahead_level

An integer which represents how many steps further the parameters will be optimized for each data point.

Value

A lm object whose coefficients are optimized by the mentioned method.

Examples

df <- datasets::airquality

ordered_df <- df[with(df,order(Month,Day)),]

model <- xls.fit(Ozone ~ Solar.R + Wind + Temp,ordered_df,
error_weights = c(0.4,0.3,0.2,0.1),error_ahead_level = 4)

XLS documentation built on March 18, 2022, 7:03 p.m.

Related to xls.fit in XLS...