GDLM: Linear regression using R.

Description Usage Arguments Value Examples

Description

Linear regression by gradient descent using R.

Usage

1
GDLM(x, y, crit = 1e-08, maxiter, Intercept = T)

Arguments

x

The observed value of independent variables x should be a vector or matrix.(numeric)

y

The observed value of dependent variable and y should be a vector. (numeric)

crit

The value that controls convergence. (numeric)

maxiter

Maximum number of iteration steps. (numeric)

Intercept

if TRUE then the reslut including the intercept coefficient (logical)

Value

the regression coefficients

Examples

1
2
3
4
5
6
7
8
## Not run: 
x1=rnorm(100);x2=rnorm(100)
x=cbind(x1,x2)
theta=c(1.1,2)
y=x%*%theta+3+rnorm(100)
GDLM(x,y,crit=1e-12,500,Intercept=T)

## End(Not run)

YulieKing/StatComp18026 documentation built on May 29, 2019, 8:34 a.m.