predict.fracridge: Predict Method for fracridge Objects

View source: R/fracridge.R

predict.fracridgeR Documentation

Predict Method for fracridge Objects

Description

Generates predictions from a fracridge model.

Usage

## S3 method for class 'fracridge'
predict(object, newdata, fracs = object$fracs, ...)

Arguments

object

An object of class fracridge.

newdata

A numeric matrix of new data with the same number of columns as the training data.

fracs

A numeric vector specifying which fractions to use for prediction. Must be a subset of the fractions used in the training. Default is object$fracs.

...

Additional arguments (currently ignored).

Value

A numeric matrix of predictions with rows corresponding to observations in newdata and columns corresponding to the specified fractions and targets.

Examples

## Not run: 
# Generate random data
set.seed(0)
X <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10)
y <- rnorm(100)

# Perform fractional ridge regression
result <- fracridge(X, y, fracs = 0.3)

# Generate new data
X_new <- matrix(rnorm(20 * 10), nrow = 20, ncol = 10)

# Make predictions
preds <- predict(result, X_new)

## End(Not run)


bbuchsbaum/fmrireg documentation built on March 1, 2025, 11:20 a.m.