similar to: Row-wise kronecker product with Matrix package

Displaying 20 results from an estimated 2000 matches similar to: "Row-wise kronecker product with Matrix package"

2013 Feb 23
1
how to calculate left kronecker product?
For an application, I have formulas defined in terms of a left Kronecker product of matrices, A,B, meaning A \otimes_L B = {A * B[i,j]} -- matrix on the left multiplies each element on the right. The standard kronecker() function is the right Kronecker product, A \otimes_R B = {A[i,j] * B} -- matrix on the right multiplies each element on the left. The example below shows the result of
2005 Jul 13
2
Kronecker matrix product
Hi I want to write a little function that takes a matrix X of size m-by-n, and a list L of length "m", whose elements are matrices all of which have the same number of columns but possibly a different number of rows. I then want to get a sort of dumbed-down kronecker product in which X[i,j] is replaced by X[i,j]*L[[j]] where L[[j]] is the j-th of the "m" matrices. For
2010 Nov 25
1
Request: kronecker to get a sep= argument
kronecker, with make.dimnames=TRUE uses a hardwired sep=":" in the line tmp <- outer(dnx[[i]], dny[[i]], FUN = "paste", sep = ":") For an application in which dimnames arise from an n-way array, where different dimensions have different roles, and I would like to be able to use kronecker in the form kronecker(A, B, make.dimnames=TRUE,
2005 Dec 08
1
kronecker(... , make.dimnames=TRUE)
Hi I'm using kronecker() with a matrix and a vector. I'm interested in the column names that kronecker() returns: > a <- matrix(1:9,3,3) > rownames(a) <- letters[1:3] > colnames(a) <- LETTERS[1:3] > b <- c(x=1,y=2) > kronecker(a,b,make.dimnames=TRUE) A: B: C: a:x 1 4 7 a:y 2 8 14 b:x 2 5 8 b:y 4 10 16 c:x 3 6 9 c:y 6 12 18 > The
2012 Jun 09
2
Matrix package loading problem "Error : object ‘kronecker’ is not exported by 'namespace:methods'"
Hi R users all , I have a clean install of R-2.15.0 in a win32 machine and a problem loading Matrix 1.0-6 that looks like this: > library(Matrix) Loading required package: lattice Error : object ?kronecker? is not exported by 'namespace:methods' Error: package/namespace load failed for ?Matrix? > I understand that kronecker() now has an S4 generic in package methods. Is that a
2011 Jun 05
2
kronecker sum
Dear All, Could someone please suggest how to find the Kronecker sum of two 2x2 matrices, i.e. given two matrices: -A A a -a and -B B b -b I need: -A-B A B 0 a -a-B 0 B b 0 -A-b A 0 b a -a-b Many thanks, Lara [[alternative HTML version deleted]]
2008 Nov 12
2
Outer, kronecker, etc.
`outer` (and related functions like kronecker) require that their functional argument operate elementwise on arrays. This means for example that outer( 1:2, 3:4, list) or outer(1:2,3:4,function(a,b){1}) gives an error. Is there a version of `outer`/`kronecker`/etc. that takes arbitrary functions and does its own elementwise mapping? In the first example above, I'd expect the
2010 Jan 11
2
sparseM and kronecker product_R latest version
Dear all, I just installed the new version of R, 2.10.1, and I am currently using the package sparseM. (I also use a 64 bit windows version) I got a problem that I never had: when I try to multiply with a kronecker product (%x%) two sparse matrixes I get the following message: Error in dim(x) <- length(x) : invalid first argument I never had this problem with previous versions of R. May
2009 Feb 23
1
trade-off between speed and storage in matrix multiplications
Dear R-users, I coded two equivalent ways to perform (in a simplified version) some matrix multiplications I would like to use in a more general framework. In the first case I used Kronecker product and vectorization of a certain matrix. This approach takes less time, but, as you may guess, I run out of memory when dimensions are large. In the second approach, I profited of sparseness and
2006 Aug 25
2
horizontal direct product
II am translating some gauss code into R, and gauss has a matrix product function called the horizontal direct product (*~), which is some sort of variant on the Kronecker product. For example if x is 2x2 and y is 2x2 the horizontal direct product, z, of x and y is defined (in the Gauss manual) as: row 1 = x11*y11 x11*y12 x12*y11 x12*y12 row 2 = x21*y21 x21*y22 x22*y21 x22*y22 Or in R
2005 Oct 13
3
Help with Matrix package
Hello all, A colleague at work set me the challenge to convert some MATLAB code into R, to see which is faster. We'd seen that benchmark comparing MATLAB 6.5 to R1.90 (and others), and so I thought that I should be able to get roughly comparable speeds. The code has lots of multiplications of matrixes, transposes, and MATLAB's "repmat". I did the code conversion, and R was about
2009 May 30
1
Spatiotemporal correlation function
Hi, I'm trying to compute  the spatiotemporal correlation matrix by using Delta Kronecker products of spatial and temporal correlation matrix  in R, but didn't find any delta Kronecker's operator in R. The operators in matrix such as multiplication, addition, eigen values/vector and etc is easily to find and used. Could someone help me, please? Cheers. Firdaus
2012 Nov 30
1
Fw: quantreg installation and conflicts with R 2.15.2
Just noticed that I get a similar error about object 'kronecker' in "Matrix" package when trying to load "lme4". So this is a more pervasive problem. Brian Brian S. Cade, PhD U. S. Geological Survey Fort Collins Science Center 2150 Centre Ave., Bldg. C Fort Collins, CO 80526-8818 email: brian_cade@usgs.gov tel: 970 226-9326 ----- Forwarded by Brian S
2010 Jul 23
4
how to calculate the product of every two elements in two vectors
Thanks in advance! A=c(1, 2,3) B=c (9, 10, 11, 12) I want to get C=c(1*9, 1*10, 1*11, 1*12, ....., 3*9, 3*10, 3*11, 3*12)? C is still a vector with 12 elements Is there a way to do that? -- View this message in context: http://r.789695.n4.nabble.com/how-to-calculate-the-product-of-every-two-elements-in-two-vectors-tp2300299p2300299.html Sent from the R help mailing list archive at Nabble.com.
2012 Nov 30
1
quantreg installation and conflicts with R 2.15.2
I recently lost the partitions on my hard drive (second time in 6 months) so I had to have our IT folks image all my files over to a new drive. I completely reinstalled R (now 2.15.2) and all my libraries to my computer (Dell Latitude running Windows 7). A few of my previous workspaces (created with R 2.14.1) can't be restored, reporting an error similar to the one I get when I try to
2010 Jan 07
1
faster GLS code
Dear helpers, I wrote a code which estimates a multi-equation model with generalized least squares (GLS). I can use GLS because I know the covariance matrix of the residuals a priori. However, it is a bit slow and I wonder if anybody would be able to point out a way to make it faster (it is part of a bigger code and needs to run several times). Any suggestion would be greatly appreciated. Carlo
2004 Jul 28
6
elegant matrix creation
Hello everybody. I am trying to reproduce a particular matrix in an elegant way. If I have jj1 <- structure(c(1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2, 3,1,2,3,1,2,3,1,2,3,2,3,1,2,3,1,2,3,1,2,3, 1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,3,1,2,3,1, 2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1, 2),.Dim = as.integer(c(9,9))) [ image(jj1) is good here ] then I can get this with
2004 Sep 28
2
S4 method selection based on second argument
I'm translating some Matlab code and need some help figuring out how to change this call into an S4 generic method. In matlab, there's a function called 'repmat' with three calling sequences (all I have to deal with anyway): 1) B = repmat(A, m, n) 2) B = repmat(A, [m n]) 3) B = repmat(A, n) In all cases, A is the fill value, m is number of rows, and n is number of
2017 Nov 08
2
Ggplot error
Hello, I've an error recently. ggplot(data = mtcars, aes(x= wt, y= mpg)) + geom_line() Error: Found object is not a stat. > sessionInfo() R version 3.4.2 (2017-09-28) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.3 LTS Matrix products: default BLAS: /usr/lib/openblas-base/libblas.so.3 LAPACK: /usr/lib/libopenblasp-r0.2.18.so locale: [1] LC_CTYPE=tr_TR.UTF-8
1999 Mar 11
3
R and kron
I note that the CRAN at .at land still refers to 0.63.2. Is this just a typo? I don't want to download a whole lot only to find I still have it! Does 0.63.3 live elsewhere? And I note the new function kronecker - very useful but can it be applied to non-numerics as in factors, data frames etc preserving the class, levels and names? John