Displaying 19 results from an estimated 19 matches for "xtx".
Did you mean:
tx
2007 Oct 03
1
inverse of matrix made by low.tri function
...X^T)X , but I keep getting
the error
message like: no b argument and no default value for sprintf(gettext(fmt,
domain = domain), ...) .
--------------------------------------------------------------------------------------------
# my code
X<-Matrix(rep(1,500),100,5)
X[lower.tri(X)]<-1-10^-7
XtX<- t(X)%*% X
XtXu<-lu(XtX)
InverseXtX<-solve(XtXu)
---------------------------------------------------------------------------------------------
The cause suggested for this error is that the lower.tri function returns a
matrix of logicals. If so, is trying to fix this by using sprintf fu...
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, p + 1, byrow=TRUE)
xtx <- xtx + crossprod(cbind(1, x[, -1]))
xty <- xty + crossprod(cbind(1, x[, -1]), x[,...
2007 Aug 16
4
Linear models over large datasets
I'd like to fit linear models on very large datasets. My data frames
are about 2000000 rows x 200 columns of doubles and I am using an 64
bit build of R. I've googled about this extensively and went over the
"R Data Import/Export" guide. My primary issue is although my data
represented in ascii form is 4Gb in size (therefore much smaller
considered in binary), R consumes about
2009 Mar 31
1
error during DPpackage compilation
...? ? ? ? ? ? ? ? ? ? ? ? ? ? ?1
LDDPdensity.f:291: (continued):
? ? ? ? ?open(unit=1,file='dppackage1.out',status='unknown',
? ? ? ? ?2
Invalid declaration of or reference to symbol `randsave' at (2) [initially
seen at (1)]
LDDPdensity.f:15:
? ? ? ? & ? ? ? ? ? ? ? ? ? ? ? ?xtx,xtx2,xty,xty2,fs,fm,worksam,workcpo)
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?1
LDDPdensity.f:291: (continued):
? ? ? ? ?open(unit=1,file='dppackage1.out',status='unknown',
? ? ? ? ?2
Invalid declaration of or reference to symbol `worksam' at (2) [initially
seen...
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
2010 May 21
2
Data reconstruction following PCA using Eigen function
...0817 0.34630946 -0.3162278
[9,] 0.24706215 -0.31886828 -0.13294196 -0.25401667 -0.42308063
-0.38135353 0.482282448 0.24225089 -0.19843310 -0.3162278
[10,] -0.62111060 -0.32779019 -0.48541562 -0.14413474 0.25188193
-0.06825162 0.012492037 -0.28278192 0.04634233 -0.3162278
I also calculate:
xtx=t(adjusted_dummyset) %*% adjusted_dummyset
> xtx
[,1] [,2] [,3] [,4] [,5] [,6]
[,7] [,8] [,9] [,10]
[1,] 9.0000000 -3.1796310 2.0417037 3.9514142 2.7275520 -1.66571377
1.5629736 -0.9104748 -4.8506341 0.68480373
[2,] -3.1...
2005 Oct 27
0
Column names in qr() and chol() (PR#8258)
...9 6.000000e+00 1
[4,] 4 16 1.200000e+01 1
[5,] 5 25 2.000000e+01 1
[6,] 6 36 3.000000e+01 1
[7,] 7 49 4.200000e+01 1
[8,] 8 64 5.600000e+01 1
[9,] 9 81 7.200000e+01 1
[10,] 10 100 9.000000e+01 1
# Note: column names of last two columns have been interchanged
> XtX <- t(X)%*%X
> U <- chol(XtX, pivot=T)
> oo <- order(attr(U, "pivot"))
> XtX
A B C D
A 385 3025 2640 55
B 3025 25333 22308 385
C 2640 22308 19668 330
D 55 385 330 10
> t(U[,oo])%*% U[,oo]
D A B C
D 385 30...
2012 Apr 23
0
linear model benchmarking
...hers. the long and short of it is
that I would recommend
ols.crossprod = function (y, x) {
x <- as.matrix(x)
ok <- (!is.na(y))&(!is.na(rowSums(x)))
y <- y[ok]; x <- subset(x, ok)
x <- cbind( 1, x)
XtX <- crossprod(x)
Xty <- crossprod(x, y)
solve(XtX, Xty)
}
for fast and stable coefficients. (yes, stable using double
precision, even though not as stable as lm(). it works just fine with
X variables that have >99.99% correlation with as few as 100...
2010 Dec 26
4
how to replace my double for loop which is little efficient!
Dear all,
My double for loop as follows, but it is little efficient, I hope all
friends can give me a "vectorized" program to replace my code. thanks
x: is a matrix 202*263, that is 202 samples, and 263 independent variables
num.compd<-nrow(x); # number of compounds
diss.all<-0
for( i in 1:num.compd)
for (j in 1:num.compd)
if (i!=j) {
S1<-sum(x[i,]*x[j,])
2011 Jul 17
1
FOMULATING TIME SERIES DATA FROM DATA FRAME
I am estimating Value at Risk using PerfomanceAnalytics package. The?variables are stored in a data frame. I formated the data variables using zoo() and as.xtx() but it is not working. The working example is below.
##########################################################?
reguire(zoo)
require(PerformanceAnalytics)
reguire(xts)
?
year<- c(1991-12-30, 1992-12-30, 1993-12-30, 1994-12-30)
R1 <- c(12, 9, 8, 13)
R2 <- c(5,2,9, 13)
d? <- data.frame...
2012 Dec 07
1
Problem with special characters
I have the following problem:
I am using igraph and entering a graph from an external (.txt) file using
read.graph("a.txt","ncol")
In a.xtx the name of the nodes contains special
characters (such Polish names, etc). In the
R console, the visualization of the names is not
correct and I am loosing some of the special characters.
Any help will be greatly appreciate.
Renato De Leone (Professor)
Universit? di Camerino Sc...
2011 Apr 15
2
Function for deleting variables with >=50% missing obs from a data frame
...work for all the data frames and I get the following message or a similar message to this:
iter imp variable
1 1 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q19 Q36 Q47 Q52 Q79 Q80 Q94 Q97 Q104 Q108 Q122 Q131 Q134 P1 P2 P3 P4 P5 P6Error in solve.default(xtx + diag(pen)) :
system is computationally singular: reciprocal condition number = 1.83044e-16
In addition: Warning messages:
1: In sqrt((sum(residuals^2))/(sum(ry) - ncol(x) - 1)) : NaNs produced
...
7: In sqrt((sum(residuals^2))/(sum(ry) - ncol(x) - 1)) : NaNs produced
Note: warnings 2 to 6 supp...
2009 Mar 12
4
stats lm() function
Hi,
Im using the lm() function where the formula is quite big (300 arguments)
and the data is a frame of 3000 values.
This is running in a loop where in each step the formula is reduced by one
argument, and the lm command is called again (to check which arguments are
useful) .
This takes 1-2 minutes.
Is there a way to speed this up?
i checked the code of the lm function and its seems that its
2009 Mar 25
3
very fast OLS regression?
Dear R experts:
I just tried some simple test that told me that hand computing the OLS
coefficients is about 3-10 times as fast as using the built-in lm()
function. (code included below.) Most of the time, I do not care,
because I like the convenience, and I presume some of the time goes
into saving a lot of stuff that I may or may not need. But when I do
want to learn the properties of an
2006 Aug 21
1
Retrieving p-values and z values from lmer output
I can't find a way to retrieve z values and p-values from the output
from lmer in the lme4 package. How is this done?
Rick B.
2011 Feb 13
0
BMS package and leading minor problems
Hello,
Could somebody please tell me what the following is about?
I try to run BMS function for quite a small dataset (400 rows and 50
columns) to get model suggestions, but I end up getting following
error message:
> bms<-bms(dat)
Error in chol.default(XtX.start) :
the leading minor of order 36 is not positive definite
I've done it before, it worked for some other data set but not this time.
I can't find any info about leading minors from anywhere.
Jukka
2006 Jul 04
1
lmer print outs without T
Hi,
I have been having a tedious issue with lmer models with lots of
factors and lots of levels. In order to get the basic information at
the beginning of the print out I also have to generate these enormous
tables as well. Is there a method command to leave off all of the
effects and correlations? Or, do I have to go to string commands?
2006 Jul 15
3
names() function and lmer()
Hello All,
I would like to retrieve some of the results from the lmer(...)
function in library lme4. If I run a model, say
fm.1 <- lmer(y ~ 1 + (1 | x), data = dog)
and try names(fm.1), I get NULL. Is there anyway to retrieve the information?
Thanks
2023 Sep 04
15
[RFC, drm-misc-next v4 0/9] PCI/VGA: Allowing the user to select the primary video adapter at boot time
...the default boot VGA, successfully override by ast2400 with
ast.modeset=10 append at the kernel cmd line.
$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation CoffeeLake-S GT2 [UHD Graphics 630]
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Caicos XTX [Radeon HD 8490 / R5 235X OEM]
04:00.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 30)
05:00.0 VGA compatible controller: NVIDIA Corporation GK208B [GeForce GT 720] (rev a1)
$ sudo dmesg | grep vgaarb
pci 0000:00:02.0: vgaarb: setting as boot VGA device
pci...