View source: R/DERLS_Woodbury.R
DERLS_Woodbury | R Documentation |
Impute missing values in the response variable Y using the distributed ERLS method with the Woodbury Identity. Multiple independent runs are performed to stabilize coefficient estimates. Missing values are imputed recursively and refined over multiple iterations.
DERLS_Woodbury(data, rho, lambda, R, nb)
data |
A data frame where:
|
rho |
Regularization parameter. |
lambda |
Forgetting factor. |
R |
Number of independent runs to stabilize estimates. |
nb |
Number of iterations per run. |
This function implements the Distributed Exponentially Weighted Recursive Least Squares (DERLS) method using the Woodbury Identity for efficient updates of the covariance matrix. The key steps include:
Initial imputation of missing values.
Recursive updates of the regression coefficients using the ERLS algorithm with the Woodbury Identity.
Multiple independent runs to stabilize the coefficient estimates.
Final prediction of missing values using the averaged coefficients.
The Woodbury Identity is used to efficiently update the covariance matrix Pstar during each iteration, making the algorithm computationally efficient and suitable for large datasets.
A list containing:
Imputed response vector.
Estimated coefficient vector.
set.seed(123)
n <- 60
data <- data.frame(
Y = c(rnorm(n - 10), rep(NA, 10)), # 50 observed+10 missing
X1 = rnorm(n),
X2 = rnorm(n)
)
result <- DERLS_Woodbury(data, rho = 0.01, lambda = 0.95, R = 3, nb = 50)
head(result$Yhat) # inspect imputed Y
result$betahat # inspect estimated coefficients
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.