tests/cgsolve.R

library(lfe)
options(digits=3)
set.seed(42)
B <- matrix(rnorm(40000),200)
A <- band(crossprod(B), -30,30)
tx <- rnorm(ncol(A))
b <- A %*% tx
fun <- function(x) A %*% x
sol <- cgsolve(fun,b,eps=-0.001, symmtest=TRUE)
sqrt(sum((sol-tx)^2))

A[5,6] <- 0.24
options(warn=2)
try(cgsolve(fun,b,symmtest=TRUE))

Try the lfe package in your browser

Any scripts or data that you put into this service are public.

lfe documentation built on Feb. 16, 2023, 7:32 p.m.