Learn R Programming

DLMRMV (version 1.0.0)

ERLS: Exponentially Weighted Recursive Least Squares with Missing Value Imputation

Description

Exponentially Weighted Recursive Least Squares with Missing Value Imputation

Usage

ERLS(data, rho = 0.01, lambda = 0.95, nb = 100, niter = 1)

Value

List containing:

Yhat

Imputed response vector

betahat

Estimated coefficients

Arguments

data

Linear regression dataset (1st column as Y, others as X)

rho

Regularization parameter

lambda

Forgetting factor

nb

Maximum iterations

niter

Initial iteration count (typically 1)

Examples

Run this code
set.seed(123)
data <- data.frame(
  y = c(rnorm(50), rep(NA, 10)),
  x1 = rnorm(60),
  x2 = rnorm(60)
)
result <- ERLS(data, rho = 0.01, lambda = 0.95, nb = 100, niter = 1)
head(result$Yhat)

Run the code above in your browser using DataLab