Skip to contents

Hastie, Tibshirani and Friedman (2009), The Elements of Statistical Learning, 2nd ed., Springer, Section 2.6.1, book p. 30 (PDF p. 49): h_k(x) = 1 / (1 + exp(-x' beta_k)) (2.31), the sigmoid transformation common to neural network models. With the transformed features the parameters theta of the expansion (2.30) are estimated by minimising RSS(theta) = sum_i (y_i - f_theta(x_i))^2 (2.32), which is done when y is supplied. (2.31) carries no extra bias term and none is added.

Usage

Sigbasis(X, B, y = NULL)

Arguments

X

N-by-p design.

B

p-by-K matrix whose columns are the beta_k of (2.31).

y

optional N-vector; fits theta by least squares when given.

Value

list: estimate, h, theta, fitted, rss, n, p, K, method.

Examples

Sigbasis(cbind(c(0, 1)), cbind(c(1)))$h
#>           [,1]
#> [1,] 0.5000000
#> [2,] 0.7310586