WPSA: p-Wasserstein distance projections using simulated annealing

View source: R/WPsimulatedAnnealing.R

WPSAR Documentation

p-Wasserstein distance projections using simulated annealing

Description

p-Wasserstein distance projections using simulated annealing

Usage

WPSA(
  X,
  Y = NULL,
  theta,
  power = 2,
  force = NULL,
  model.size = 3,
  nvars = NULL,
  maxit = 1,
  temps = 1000,
  max.time = 3600,
  const = NULL,
  proposal = proposal.fun,
  options = list(method = c("selection.variable", "scale", "projection"),
    transport.method = transport_options(), energy.distribution = "boltzman",
    cooling.schedule = "Geman-Geman", proposal.method = "covariance", epsilon = 0.05,
    OTmaxit = 100),
  display.progress = FALSE,
  parallel = NULL,
  calc.theta = TRUE,
  xtx = NULL,
  xty = NULL,
  ...
)

Arguments

X

Covariate vector

Y

Predictions

theta

Optional matrix of parameters for generating predictions

power

Power of the Wasserstein distance

force

Any covariates to force into the model?

model.size

Maximum number of coefficients

nvars

The number of variables to explore. Should be an integer vector of model sizes. Default is NULL which will explore all models from 1 to model.size.

maxit

Maximum number of iterations

temps

Number of temperatures

max.time

Maximum time in seconds to run

const

Maximum value for simulated annealing distance

proposal

Proposal function. There is a default method but can provide your own with parameters xty, cur, idx, force, d, method

options

Options for simulated annealing

display.progress

Whether to display solver progress. TRUE or FALSE. Default is FALSE.

parallel

A foreach::foreach() backend

calc.theta

Should the model save the linear coefficients? TRUE or FALSE. Default is TRUE

xtx

precomputed crossproduct crossprod(X,X)

xty

precomputed crossprod(X, Y)

Value

An object of class WpProj


WpProj documentation built on May 29, 2024, 7:55 a.m.