That is something you can't decrease as it is sort of a C-standard. However, you can manually set tol = 1e-20
as a function input for example, to override the default tolerance. But, this is purely a numerical workaround. You need to think about whether it is possible to address your rank-deficiency issue at your problem level. For example, rank-deficiency can arise due to the poor scaling between your data variables, and here is a simple example: Linear model singular because of large integer datetime in R?.
I not sure as to what to do here then? As I said I'm using a function called mp.spatt
where the solve
function is used. So I can't really (or at least I don't know how?) add the tol = blabla
argument in the solve
function?
You could write a patched version of that function and rebuild the package for your own use. This is exactly why open-source software and packages are so GREAT.
Go to https://cran.r-project.org/package=did, download the source file .tar.gz
for Linux, .tgz
for Mac or .zip
for Windows. Extract it, open the "did.R" file in the /R
director / folder. Function solve
is only used once in this file, so you can easily locate it:
W <- n*t(preatt)%*%solve(preV)%*%preatt
You can add tol = 0
for simplicity. Or, you many replace solve
by MASS::ginv
. Actually, the package authors have been using MASS::ginv
everywhere else in the script. It could be the case that he just forgot to replace this solve
as well (I am checking the latest version 1.1.0 on 2018/07/11).
After fixing it, generate a .tar.gz
, .tgz
or .zip
file again. Open your R, use install.packages
to install this specific file, and happily use it.