linreg_optim: Linear Regression (Optimization).

Description Usage Arguments Value Author(s)

View source: R/linreg.R

Description

Estimates parameters of a linear regression model using optimization.

Usage

1
linreg_optim(X, y, FUN, start_values, optim = TRUE, ...)

Arguments

X

The data matrix, that is an n \times k matrix of n observations of k regressors, which includes a regressor whose value is 1 for each observation.

y

n \times 1 vector of observations on the regressand variable.

FUN

Objective function. The options are linreg_optim_rss using residual sums of squares as the loss function, linreg_optim_negll using the negative log-likelihood of $y$ as the loss function.

start_values

A vector of starting values corresponding to the number of parameters to be estimated.

optim

Logical. If TRUE, the optim function is used. If FALSE, the nlminb function is used.

...

Arguments to be passed to the optimization function specified. This is only used when optim is TRUE

Value

Returns the output of optim or nlminb.

Author(s)

Ivan Jacob Agaloos Pesigan


jeksterslabds/jeksterslabRds documentation built on July 16, 2020, 3:41 p.m.