similar to: block diagonal matrix function

Displaying 20 results from an estimated 200 matches similar to: "block diagonal matrix function"

2005 Jan 28
2
Direct sum of matrices
Hi R users: How can I built a direct sum function of matrices in R? I mean A(mxn), B(pxq), C(rxs),... X<-ds(A,B,C,...) X = [ A, 0, 0 0, B, 0 0, 0, C] ((m+p+r+...) x (n+q+s+...)) Thank you for your help. Kenneth -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
2019 Feb 19
4
code for sum function
The algorithm does make a differece. You can use Kahan's summation algorithm (https://en.wikipedia.org/wiki/Kahan_summation_algorithm) to reduce the error compared to the naive summation algorithm. E.g., in R code: naiveSum <- function(x) { s <- 0.0 for(xi in x) s <- s + xi s } kahanSum <- function (x) { s <- 0.0 c <- 0.0 # running compensation for lost
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]
2007 Jan 12
2
image() and nonsquare matrices
How do I draw non-square matrices with image() and get the axes right? Try 1: a <- matrix(rnorm(100),20,5) image(1:20,1:5,a,asp=1,xlab="label here") # No good because the axes don't touch the image Try 2: image(1:20,1:5,a,asp=1,axes=F,xlab="label here") axis(side=1,pos=0) # No good because the x axis label is floating far from the x axis. Try 3:
2005 Jun 04
2
[PATCH] line endings fix
The replay gain code has dos line endings in CVS, which causes problems for the Sun compiler, among others. Attached is a patch for the lazy, but it's probably easier to fix locally and commit. -r
2019 Feb 14
5
code for sum function
Hello, I am trying to write FORTRAN code to do the same as some R code I have. I get (small) differences when using the sum function in R. I know there are numerical routines to improve precision, but I have not been able to figure out what algorithm R is using. Does anyone know this? Or where can I find the code for the sum function? Regards, Rampal Etienne
2010 Jan 28
2
color palette for points, lines, text / interactive Rcolorpicker?
I'm looking for a scheme to generate a default color palette for plotting points, lines and text (on a white or transparent background) with from 2 to say 9 colors with the following constraints: - "red" is reserved for another purpose - colors should be highly distinct - avoid light colors (like "yellow"s) In RColorBrewer, most of the schemes are designed for area fill
2007 Mar 24
1
frequency tables and sorting by rowSum
Dear list, I have some trouble generating a frequency table over a number of vectors. Creating these tables over simple numbers is no problem with table() > table(c(1,1,1,3,4,5)) 1 3 4 5 3 1 1 1 , but how can i for example turn: 0 1 0 0 0 1 0 1 0 1 0 0 0 1 0 1 0 0 into 0 0 1 1 1 0 0 2 0 1 0 3 My second problem is, sorting rows and columns of a matrix by the rowSums/colSums. I did it
2004 Apr 25
2
nonparametric multiple sample comparison
Hello all, Here goes one of my first functions. I want to make a nonparametric multiple sample comparison with unequal sample sizes (see Zar?s Biostatistical Analysis, 3rd. Ed., pg. 201 Example 10.11, pg. 288 Example 11.10). In the real world, I want to compare samples of fish length captured with different fishing gears. After using the Kruskal-Wallis test I want to check the differences
2019 Feb 20
3
code for sum function
Dear Tomas, Where do I find these files? Do they contain the code for the sum function? What do you mean exactly with your point on long doubles? Where can I find documentation on this? Cheers, Rampal On Mon, Feb 18, 2019, 15:38 Tomas Kalibera <tomas.kalibera at gmail.com wrote: > See do_summary() in summary.c, rsum() for doubles. R uses long double > type as accumulator on systems
2002 Feb 26
3
a trick ??
Dear R users, Suppose i have an A square matrix rxr. I want to obtain a block matrix B (pxr,pxr) where the p diagonal blocks are A and the others values are 0. I would like to do something like : diag(A,ncol=pr, nrow=pr) How can i do it ?? Thanks in advance, Olivier. -- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- Olivier MARTIN PhD student phone: (33) 04
2008 Jul 23
3
sum each row and output results
Hello, I have the following data frame (DF): V5 V5.1 V5.2 V5.3 V5.4 V5.5 2 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 3 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 4 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 5 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677
2019 Feb 21
1
code for sum function
Specifically: https://svn.r-project.org/R/trunk/src/main/summary.c And if you don't want to deal with Subversion, you can look at the read-only github mirror: https://github.com/wch/r-source/blob/e5b21d0397c607883ff25cca379687b86933d730/src/main/summary.c#L115-L131 On Thu, Feb 21, 2019 at 11:57 AM David Winsemius <dwinsemius at comcast.net> wrote: > > > On 2/20/19 2:55 PM,
2010 Aug 23
1
Speeding up sum and prod
Looking for more ways to speed up R, I've found that large improvements are possible in the speed of "sum" and "prod" for long real vectors. Here is a little test with R version 2.11.1 on an Intel Linux system > a <- seq(0,1,length=1000) > system.time({for (i in 1:1000000) b <- sum(a)}) user system elapsed 4.800 0.010 4.817 > system.time({for (i
2008 Nov 08
3
Fitting a modified logistic with glm?
Hi all, Where f(x) is a logistic function, I have data that follow: g(x) = f(x)*.5 + .5 How would you suggest I modify the standard glm(..., family='binomial') function to fit this? Here's an example of a clearly ill-advised attempt to simply use the standard glm(..., family='binomial') approach: ######## # First generate some data ######## #define the scale and location of
2003 Apr 30
1
pnorm conditional (PR#2883)
--=-YFjXKq8/D/t1qWmIzQ9D Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I was going over the source in src/nmath/pnorm.c and noticed a little bug in pnorm_both (in R 1.7.0). The else-if on line 205 covers the entire real line. Seems you want an &&, not an ||. Doesn't make a big difference (you still get a 0 or 1 from extreme starting values) but your log
2007 May 02
3
ED50 from logistic model with interactions
Hi, I was wondering if someone could please help me. I am doing a logistic regression to compare size at maturity between 3 seasons. My model is: fit <- glm(Mature ~ Season * Size - 1, family = binomial, data=dat) where Mature is a binary response, 0 for immature, 1 for mature. There are 3 Seasons. The Season * Size interaction is significant. I would like to compare the size at 50%
2004 Dec 06
1
I need very fast quick info how to setup ISDN card
I am sitting on thos problem whole day I have never ISDN card in my life. Now I have to runn asterisk with 4 cards very quickly. I have installed chapi_chan and now I pached and recompiled kernel 2.8.1 for mISDN but I don't know how to check that cards are working and should look next step Thanks again for any help I'm Asterisk newbie. Kind regards, Corvin.
2005 Mar 28
1
Kernel panic loading second fritz card
Hi Everyone, Long time reader, first time poster. FINALLY got my First AVM Fritz Card up and running under Centos 3.4 Installed the second....modified the drivers etc as per the instructions found at the wiki System boots Modprobe capi all good modprobe fcpci all good modprobe f2pci the kernel then goes into Panic If Modprobe f2pci before fcpci the kernel still goes into panic.
2013 Mar 20
1
double in summary.c : isum
Hi, Please consider the following : > x = as.integer(2^30-1) [1] 1073741823 > sum(c(rep(x, 10000000), rep(-x,9999999))) [1] 1073741824 Tested on 2.15.2 and a recent R-devel (r62132). I'm wondering if s in isum could be LDOUBLE instead of double, like rsum, to fix this edge case? https://svn.r-project.org/R/trunk/src/main/summary.c Thanks, Matthew