#' Householder function
#' @export
#' @param x matrix variable
hw5_2_hh <- function(x){
s2 <- c(crossprod(x, x))
s <- sign(x[1]) * sqrt(s2)
d <- 1 / (s2 + s * x[1])
u <- x
u[1] <- x[1] + s
U <- diag(length(x)) - outer(d * u, u)
list(U = U)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.