Displaying 20 results from an estimated 9000 matches similar to: "Change in 'solve' for r-patched"
2010 Sep 22
1
Newey West and Singular Matrix
dear R experts: ?I am writing my own little newey-west standard error
function, with heteroskedasticity and arbitrary x period
autocorrelation corrections. ?including my function in this post here
may help others searching for something similar. it is working quite
well, except on occasion, it complains that
Error in solve.default(crossprod(x.na.omitted, x.na.omitted)) :
system is
2010 Sep 23
1
Newey West and Singular Matrix + library(sandwich)
thank you, achim. I will try chol2inv.
sandwich is a very nice package, but let me make some short
suggestions. I am not a good econometrician, so I do not know what
prewhitening is, and the vignette did not explain it. "?coeftest" did
not work after I loaded the library. automatic bandwidth selection
can be a good thing, but is not always.
as to my own little function, I like the
2006 Apr 24
1
Handling large dataset & dataframe [Broadcast]
Here's a skeletal example. Embellish as needed:
p <- 5
n <- 300
set.seed(1)
dat <- cbind(rnorm(n), matrix(runif(n * p), n, p))
write.table(dat, file="c:/temp/big.txt", row=FALSE, col=FALSE)
xtx <- matrix(0, p + 1, p + 1)
xty <- numeric(p + 1)
f <- file("c:/temp/big.txt", open="r")
for (i in 1:3) {
x <- matrix(scan(f, nlines=100), 100,
2004 Jan 12
1
question about how summary.lm works
Hi,
While exploring how summary.lm generated its output I came across a section
that left me puzzled.
at around line 57
R <- chol2inv(Qr$qr[p1, p1, drop = FALSE])
se <- sqrt(diag(R) * resvar)
I'm hoping somebody could explain the logic of these to steps or
alternatively point me in the direction of a text that will explain these
steps.
In particular I'm puzzled
2002 Jan 15
1
MKL seems to beat ATLAS, but some problems... (was RE: linkin g R against MKL)
Hi all,
I managed to at least compile R-patched (2002-01-08) against MKL 5.1 (not
beta). The release notes for MKL said that the libraries are threaded, and
the test codes needed to be linked against the pthread library. Therefore I
added -lpthread flag in config.site for R-patched, and the compile went
through. However, when I did make check, it choked on a call to La.eigen,
complaining that
2003 Apr 28
1
qr(x,LAPACK=TRUE) (PR#2867)
Hi,
I think there is a problem with the LAPACK version of qr() in version
1.7.0. (version below).
1. The documentation states that LAPACK=TRUE is the default, but the code
has LAPACK=FALSE.
2. With LAPACK=TRUE qr() is never pivoting, even in cases where it very
clearly should be. e.g.
set.seed(0)
X<-matrix(rnorm(40),10,4);X[,1]<-X[,2]
qrx<-qr(X,LAPACK=TRUE)
qrx$pivot # note, no
2009 Jul 07
3
Error due to non-conformable arrays
Hello,
Consider this function for generalized ridge regression:
gre <- function (X,y,D){
n <- dim(X)[1]
p <- dim(X)[2]
intercept <- rep(1, n)
X <- cbind(intercept, X)
X2D <- crossprod(X,X)+ D
Xy <- crossprod(X,y)
bth <- qr.solve(X2D, Xy)
}
# suppose X is an (nxp) design matrix and y is an (nx1) response vector
p <- dim(x)[2]
D<- diag(rep(1.5,p))
bt
2012 Nov 22
2
lapack routines cannot be loaded [Help request]
Dear BioConductor and R fellow users
I apologize in advance for double posting, but I am not sure which list would actually be best fit for this message.
I am experiencing a weird error with my R installation on Ubuntu 10.04.4 (LTS) 64bit:
When I run R on the terminal everything goes smoothly:
$R
R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation
2012 Oct 29
2
lapack routines cannot be loaded
I installed R in (what I believe is) the standard way by adding the
following line to /etc/apt/sources.list
deb http://cran.us.r-project.org/bin/linux/ubuntu precise/
All was well, until I recently upgraded from 2.15.1 to 2.15.2 by running
sudo apt-get update
sudo apt-get upgrade
Now, when I try to do simple things, I get an error. e.g.
R> PP.test(rnorm(1000))
Error in
2008 Apr 03
1
Lapack error in Design:::ols
Hi,
I'm trying to use Frank Harrell's Design:::ols function to do regression
of y (numeric) on the interaction of two factors (x1 and x2), but Lapack
throws an error:
> library(Design)
...
> load(url("http://www.csse.unimelb.edu.au/~gabraham/x"))
> ols(y ~ x1 * x2, data=x)
Error in chol2inv(fit$qr$qr) : 'size' cannot exceed nrow(x) = 20
> traceback()
2005 Oct 27
0
Column names in qr() and chol() (PR#8258)
I am using 2.2.0
If the QR decomposition of an N*M matrix is such that the pivoting order
is not 1:M, Q%*%R does not result in the original matrix but in a
matrix with the columns permuted. This is clearly intentional, and
probably to be expected if pivoting is used --- chol() behaves in the
same manner (it would perhaps be nice if the qr help page made that
clear in the same way that the chol()
2009 Mar 28
1
Error in R??
Can someone explain why I am getting the following error: in the r code
below?
Error in solve.default(diag(2) + ((1/currvar) * (XX1 %*% t(XX1)))) :
system is computationally singular: reciprocal condition number = 0
In addition: There were 50 or more warnings (use warnings() to see the first
50)
The R code is part of a bigger program.
##sample from full conditional
2005 Oct 05
2
eliminate t() and %*% using crossprod() and solve(A,b)
Hi
I have a square matrix Ainv of size N-by-N where N ~ 1000
I have a rectangular matrix H of size N by n where n ~ 4.
I have a vector d of length N.
I need X = solve(t(H) %*% Ainv %*% H) %*% t(H) %*% Ainv %*% d
and
H %*% X.
It is possible to rewrite X in the recommended crossprod way:
X <- solve(quad.form(Ainv, H), crossprod(crossprod(Ainv, H), d))
where quad.form() is a little
2005 Mar 03
2
regression on a matrix
Hi -
I am doing a monte carlo experiment that requires to do a linear
regression of a matrix of vectors of dependent variables on a fixed
set of covariates (one regression per vector). I am wondering if
anyone has any idea of how to speed up the computations in R. The code
follows:
#regression function
#Linear regression code
qreg <- function(y,x) {
X=cbind(1,x)
m<-lm.fit(y=y,x=X)
2011 Jul 29
2
'breackpoints' (package 'strucchange'): 2 blocking error messages when using for multiple regression model testing
Good morning to all,
I am encountering a blocking issue when using the function 'breackpoints'
from package 'strucchange'.
*Context:*
I use a data frame, 248 observations of 5 variables, no NA.
I compute a linear model, as y~x1+...+x4
x4 is a dummy variable (0 or 1).
I want to check this model for structural changes.
*Process & issues:*
*First, I used function Fstats.* It
2007 May 15
2
QR Decompositon and qr.qty
Dear R people,
I do not have much knowledge about linear algebra but currently I need
to understand what the function qr.qty is actually doing. The
documentation states that it calculates t(Q) %*% y via a previously
performed QR matrix decomposition.
In order to do that, I tried following basic example:
m<-matrix(c(1,0,0,0,1,0,0,0,1,0,0,1),ncol=3) # 4x3 matrix
2012 Nov 23
2
R lapack routines cannot be loaded
I usually ran different statistical analysis in R with routines that
use lapack like gam() lm(), etc but after several updates of libraries
the following error appears:
library(mgcv)
This is mgcv 1.7-22. For overview type 'help("mgcv-package")'.
model <- with(chlaR,gam(ClorMAX ~ s(DegDay_NM)))
Error en eigen(St, symmetric = TRUE) :
lapack routines cannot be loaded
Adem?s:
2010 Dec 27
1
R-code to generate random rotation matrix for rotation testing
Dear list,
I am looking for an implementation of random rotation matrix generation in R to do a rotation test: I want to use the matrices to create random multivariate normal matrices with common covariance structure and mean based on an observed data matrix.
The rRotationMatrix-function in the mixAK-package is an option, but as far as I can tell I need to draw rotation matrices with determinant
2011 Aug 16
2
generalized inverse using matinv (Design)
i am trying to use matinv from the Design package
to compute the generalized inverse of the normal equations
of a 3x3 design via the sweep operator.
That is, for the linear model
y = ? + x1 + x2 + x1*x2
where x1, x2 are 3-level factors and dummy coding is being used
the matrix to be inverted is
X'X =
9 3 3 3 3 3 3 1 1 1 1 1 1 1 1 1
3 3 0 0 1 1 1 1 0 0 1 0 0 1 0 0
3 0 3 0 1 1 1 0 1 0 0 1
2007 Oct 30
1
Some matrix and sandwich questions
Dear R-help,
I have a four-part question about regression, matrices, and sandwich package.
1) In the sandwich package, I would like to better understand the
meat() function.
>From the bread() documentation, for a simple OLS regression, bread() returns
(1/n * X'X)^(-1)
That is, for a simple regression (per the documentation on bread()):
MyLM <- lm(y ~ x)
bread(MyLM)