grid_ridge_lambda: Computes grid of predictions for ridge regression for a...

Description Usage Arguments Value

View source: R/grid_ridge_lambda.R

Description

Computes prediction errors for a grid of ridge regression models for a specified value of lambda

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
grid_ridge_lambda(
  x,
  z,
  y,
  yz,
  var_order = NULL,
  lambda,
  x1x1inv = NULL,
  grid.size = p,
  errors_mean = TRUE
)

Arguments

x

design matrix for training

z

design matrix for testing

y

response for training

yz

response for testing

var_order

For user-specified ordering of variables. Indices start at 0, start with least important variable and end with most. By default order will be induced from scaling of columns in design matrix

lambda

Value of lambda to be used for the calculation

x1x1inv

If this is already computed then it can be passed here. Only for use within grid_ridge

grid.size

Number of subsets of variables for which a solution path will be computed for

errors_mean

Controls whether MSPE or SPE (without dividing by sample size) is returned. Used only for within cv_grid_ridge

Value

A vector of errors of length grid.size


bgs25/SubsetGridRegression documentation built on Dec. 19, 2021, 8:50 a.m.