similar to: Outer, kronecker, etc.

Displaying 20 results from an estimated 1000 matches similar to: "Outer, kronecker, etc."

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
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 Feb 09
1
Row-wise kronecker product with Matrix package
I'm trying to calculate the row-wise kronecker product A \Box B of two sparse matrices A and B, and am struggling to find a quick way to do this that takes advantage of sparseness. I thought a good idea would be to use "rep" to construct 2 matrices of the same dimension of the end product, and multiply these two together: library(Matrix) A<-Matrix(c(1,0,0,0,0,1,2,0), 2, 4)
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]]
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 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
2007 Dec 04
2
Wishlist: mention Vectorize in 'outer' man page (PR#10490)
Full_Name: Antonio, Fabio Di Narzo Version: 2.6.1 OS: linux Submission from: (NULL) (213.140.16.187) In 'outer' man page, there is no mention of the Vectorize function. Moreover, I think it isn't underlined enough that the FUN argument to 'outer' must be a vectorized function (doc speaks about a function which has to 'operate elementwise'). A cross-reference from
1999 Jan 15
1
Some outer() suggestions
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-342241519-916419809=:25543 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: <Pine.GSO.3.96.990115171305.25543M@laplace> I attach outer.tar.gz which contains
2001 Sep 23
1
outer
i cannot cajole outer in doing what i want it to do. i hav a function only defined for scalars fun(n,k) and i want to do outer(1:5,1:5,function(x,y) fun(x,y)) (i know this is written somewhat clumsy) to get an array with the values of fun to use it as an input for image this does not work since outer assumes then fun works on arrays elementwise. what is the easiest way of getting what i
2010 May 08
1
matrix cross product in R different from cross product in Matlab
Hi all, I have been searching all sorts of documentation, reference cards, cheat sheets but can't find why R's crossprod(A, B) which is identical to A%*%B does not produce the same as Matlabs cross(A, B) Supposedly both calculate the cross product, and say so, or where do I go wrong? R is only doing sums in the crossprod however, as indicated by (z <- crossprod(1:4)) # = sum(1 +
2008 Nov 29
2
Using grep() to subset lines of text
I have two vectors, a and b. b is a text file. I want to find in b those elements of a which occur at the beginning of the line in b. I have the following code, but it only returns a value for the first value in a, but I want both. Any ideas please. a = c(2,3) b = NULL b[1] = "aaa 2 aaa" b[2] = "2 aaa" b[3] = "3 aaa" b[4] = "aaa 3 aaa"
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
2004 Oct 01
2
multiple dimensional diag()
Hi I have two arbitrarily dimensioned arrays, "a" and "b", with length(dim(a))==length(dim(b)). I want to form a sort of "corner-to-corner" version of abind(), or a multidimensional version of blockdiag(). In the case of matrices, the function is easy to write and if a=matrix(1,3,4) and b=matrix(2,2,2), then adiag(a,b) would return: [,1] [,2] [,3] [,4] [,5]
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
2009 Feb 17
2
cumsum vs. sum
I recently traced a bug of mine to the fact that cumsum(s)[length(s)] is not always exactly equal to sum(s). For example, x<-1/(12:14) sum(x) - cumsum(x)[3] => 2.8e-17 Floating-point addition is of course not exact, and in particular is not associative, so there are various possible reasons for this. Perhaps sum uses clever summing tricks to get more accurate results? In some
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
2009 May 20
2
Class for time of day?
What is the recommended class for time of day (independent of calendar date)? And what is the recommended way to get the time of day from a POSIXct object? (Not a string representation, but a computable representation.) I have looked in the man page for DateTimeClasses, in the Time Series Analysis Task View and in Spector's Data Manipulation book but haven't found these. Clearly I can