PPLS: Penalized Partial Least Squares (PPLS) Estimation

View source: R/PPLS.R

PPLSR Documentation

Penalized Partial Least Squares (PPLS) Estimation

Description

This function performs Penalized Partial Least Squares (PPLS) estimation for grouped data. It supports ridge regression regularization and handles missing data by excluding incomplete cases. The function returns regression coefficients, residual sum of squares, and other diagnostic information.

Usage

PPLS(d, yidx, Xidx, n, lam = 0.005)

Arguments

d

Containing the dependent and independent variables.

yidx

Column index of the dependent variable in d.

Xidx

Column indices of the independent variables in d.

n

Vector of sample sizes for each group.

lam

Regularization parameter for ridge regression (default is 0.005).

Details

This function assumes that the data is grouped and that the sample sizes for each group are provided. It excludes cases with missing values in the dependent or independent variables. The function uses Cholesky decomposition to solve the regularized least squares problem.

Value

A list containing the following elements:

beta

Regression coefficients.

SSE

Residual sum of squares.

df

Number of complete cases used in the estimation.

gram

Gram matrix (X^TX + \lambda I).

cgram

Cholesky decomposition of the Gram matrix.

comm

Indicator variable (0 for single group, 1 for multiple groups).

Examples

# Example data
set.seed(123)
n_total <- 1000
p <- 5
n_groups <- c(300, 300, 400)
d <- list(all = cbind(rnorm(n_total), matrix(rnorm(n_total*p), ncol=p)),p = p)

# Call PPLS function
result <- PPLS(d, yidx=1, Xidx=2:(p+1), n=n_groups)

# View results
print(result$beta)  # Regression coefficients
print(result$SSE)   # Residual sum of squares


DLMRMV documentation built on April 12, 2025, 1:25 a.m.

Related to PPLS in DLMRMV...