gradient_descent: Gradient descent for the 'LocationScaleRegression' model...

Description Usage Arguments Value Examples

View source: R/model.R

Description

This function optimizes the log-likelihood of the given location-scale regression model by gradient descent. It has a side effect on the model object.

Usage

1
2
3
4
5
6
7
gradient_descent(
  model,
  stepsize = 0.001,
  maxit = 1000,
  abstol = 0.001,
  verbose = FALSE
)

Arguments

model

A LocationScaleRegression object.

stepsize

The scaling factor for the gradient.

maxit

The maximum number of iterations.

abstol

The absolute convergence tolerance. The algorithm stops if the absolute value of the gradient drops below this value.

verbose

Whether to print the progress of the algorithm.

Value

The updated model, invisibly.

Examples

1
2
3
y <- rnorm(30)
model <- LocationScaleRegression$new(y ~ 1)
gradient_descent(model)

hriebl/asp20model documentation built on April 2, 2020, 12:05 a.m.