Learn R Programming

landpred (version 2.0)

optimize_bandwidth: Optimize Bandwidth for Continuous Landpred Models

Description

Selects the optimal bandwidth by minimizing the Mean Squared Error (MSE) using cross-validation.

Usage

optimize_bandwidth(
  landpred_obj,
  t0,
  tau,
  lower = 0.05,
  upper = 5,
  transform = identity,
  reps = 50,
  train_prop = 0.66
)

Value

The optimal bandwidth.

Arguments

landpred_obj

A landpred object.

t0

The landmark time.

tau

The prediction window.

lower

Lower bound for bandwidth search.

upper

Upper bound for bandwidth search.

transform

Transformation function for the short-term event (e.g., log). Default is identity.

reps

Number of cross-validation repetitions. Default is 50.

train_prop

Proportion of data used for training in each fold. Default is 0.66.