Displaying 20 results from an estimated 734 matches for "diagonalizing".
2007 Oct 10
3
as.dist with diagonal unequal zero
Hello and sorry that I still haven?t found a solution for my problem.
I need to extract the lower and upper triangle from a square matrix
including the diagonal. This diagonal is not zero in that special case.
I tried with as.dist
w<-as.dist(w, diag = TRUE)
> w
1 2 3 4 5
1 0
2 2 0
3 3 8 0
4 4 9 14 0
5 5 10 15 20 0
but found no way to keep the diagonal that is in the
2011 Jul 19
2
Taking all "complete" diagonals of a matrix
Hi R-Help!
I am trying to find a nicer way of extracting all the "complete" diagonals
of a matrix. I am working with very large matrices that have many more rows
than columns. I want to be able to extract each of the diagonals that are
as long as the number of columns in the matrix. I have written a rather
ugly function that presently does the job. It illustrates what I am trying
to
2013 Jan 23
2
setting off-diagonals to zero
The following 1460 x 1460 matrix can be throught of as 16 distinct 365 x 365
matrices. I'm trying to set off-diaganol terms in the 16 sub-matrices with
indices more than +/- 5 (days) from each other to zero using some for loops.
This works well for some, but not all, of the for loops. The R code I"m
using follows. For some reason the third loop below zero's-out everything
in the
2007 Jun 20
1
How to extract diagonals
Hello,
I am using Mac OS X on a power book and R 2.5.0
I try to extract a diagonal from a dissimilarity matrix made with
dsvdis, with this code:
diag(DiTestRR)
But I get this error message:
Fehler in array(0, c(n, p)) : 'dim' spezifiziert ein zu großes Array
english:
Error in array(0, c(n, p)) : 'dim' specifies a too big array.
Is there a limit to extract diagonals?
I
2007 Aug 30
2
Need help putting histograms on the diagonal of a splom plot
Hello,
I am in need of help in putting histograms on the diagonal of a plot
produced with splom().
The plot matrix I am trying to produce is to have standard scatterplots
in the upper-left triangle, contour plots in the lower-right triangle,
and histograms on the diagonal. I have a function that does the first
two, but the histograms on the diagonal has been beyond my ability.
Here is my
2004 Oct 13
2
diagonal matrix construction
Hi,
I have worked long and hard and looked in the manuals and am having a hard time constructing a diagonal matrix. I can get the diagonals out of a matrix but can't construct the matrix with just the diagonals. I have been on the web site and manuals and I think that it says to use:
dsj <- diag (three = 1, nrow, ncol = 7) three is the name of my matrix and
2009 Dec 15
2
Diagonal Labels on "Beside" Bars in Barplot
My question is based on an example provided in the following:
Referencing:
Statistics with R
Vincent Zoonekynd
<zoonek at math.jussieu.fr>
6th January 2007
URL:
http://zoonek2.free.fr/UNIX/48_R/all.html
data(HairEyeColor)
a <- as.table( apply(HairEyeColor, c(1,2), sum) )
# Provided Example
barplot(a, beside = TRUE,
legend.text = attr(a, "dimnames")$Hair)
# I
2013 Apr 19
3
extracting the diagonal of an inverse matrix
Dear R-users,
I would like to know whether there is a way to extract a diagonal of an inverse matrix without computing the inverse of the matrix itself. The size of my matrices are really huge and, also using sparse matrix, computing the inverse leads to storage problems and low speed.
In other words, given a square matrix A, I aim to know diag(B), where B=solve(A), without computing solve(A).
2008 Feb 26
2
Summing up diagonals w/o for-loop
? stato filtrato un testo allegato il cui set di caratteri non era
indicato...
Nome: non disponibile
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20080226/43b3a38b/attachment.pl
2008 Nov 21
2
Extracting diagonal matrix
Dear All,
I have a correlation matrix of size 100 x 100 and would like to extract the diagonal matrix from it. I have used the for loop to store tha correlation values of the diagonal matrix. Is there a 'R way' of doing this?
Thanks in advance.
Kind regards,
Ezhil
2006 Oct 03
4
how ot replace the diagonal of a matrix
Dear useRs,
Trying to replace the diagonal of a matrix is not working for me. I
want a matrix with .6 on the diag and .4 elsewhere. The following
code looks like it should work--when I lookk at mps and idx they look
how I want them too--but it only replaces the first element, not each
element on the diagonal.
mps <- matrix(rep(.4, 3*3), nrow=n, byrow=TRUE)
idx <- diag(3)
mps
idx
mps[idx]
2011 Apr 04
1
Ordering every row of a matrix while ignoring off diagonal elements
Sorry if this is a stupid question but I've been stuck on how to code
so that I can order rows of a matrix without paying attention to the
diagonal elements.
Say, for example, I have a matrix d:
> d
[,1] [,2] [,3] [,4]
[1,] 0.000000 2.384158 2.0065682 2.2998856
[2,] 2.384158 0.000000 1.4599928 2.4333213
[3,] 2.006568 1.459993 0.0000000 0.9733285
[4,] 2.299886
2015 Oct 29
2
Extraer elementos diagonales de submatrices
El código que me olvide pegar
input
m <- structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 0, 0, 0, 0,
0, 0, 0, 5, 5, 5), .Dim = c(10L, 5L))
m
## output
output <- c(1:3, 1:5, 1:2)
output
nfilas <- nrow(m)
while(nfilas > 0) {
diagonal <- diag(m)
2003 Oct 01
4
Solving a tridiagonal system
I need to find solutions to a tridiagonal system. By
this I mean a set of linear equations Ax = d where A
is a square matrix containing elements A[i,i-1],
A[i,i] and A[i,i+1] for i in 1:nrow, and zero
elsewhere. R is probably not the ideal way to do this,
but this is part of a larger problem that requires R.
In my application it is much easier (and much faster)
to generate the diagonal and
2010 Oct 11
1
running R script on linux server
Hi R-users,
I have a problem running my R code on a Linux cluster. What I did was
write a .pbs file to instruct the cluster on what to do and how:
#!/bin/sh
#PBS -m ae
#PBS -M uqlcatta@uq.edu.au
#PBS -A uq-CSER
#PBS -N job1_lollo
#PBS -l select=1:ncpus=1:NodeType=fast:mem=8GB
#PBS -l walltime=999:00:00
cd $PBS_O_WORKDIR
source /usr/share/modules/init/bash
module
2011 Jan 20
2
splitting a square symmetric matrix
So many matrices are square symmetrical (i.e. variance-covariance matrices),
is there any way to get R to split the matrix on its diagonal and just
return one diagonal?
So if I have
mat<-matrix(c(1,4,3,4,1,2,3,2,1), nrow = 3, ncol=3, byrow=TRUE)
is there anyway to get the lower right diagonal instead of the entire
symmetric matrix?
-------------------------------------------
2009 Aug 24
1
Filling matrix secondary diagonal
Hi,
how do i fill the secondary diagonals of a matrix?
Is there an funktion like the "diag" funktion in matlab, where i can specify
the diagonal i?d like to fill?
--
View this message in context: http://www.nabble.com/Filling-matrix-secondary-diagonal-tp25121745p25121745.html
Sent from the R help mailing list archive at Nabble.com.
2008 Apr 08
2
diagonally fill a rectangle with color gradient
Hi,
Is it possible to diagonally fill a rectangle with a color gradient? I
noticed that the gradient.rect of plotrix could fill a rect either up and
down or from side to side. I am looking for something similar but fills
diagonally instead, e.g., from the upper left corner to the bottom right.
Does anyone know how to do it in R?
Thanks,
--
Tom
[[alternative HTML version deleted]]
2010 Apr 23
3
reordering of matrix rows to maximize the sum of the diagonal
Hi r-help community,
This question isn't so much a syntax/coding one, but here goes:
Let's say I have matrix of arbitrary dimensions and I'd like to
reorder the rows in such a way that I could maximize the sum of the
entries along the diagonal.
For example, for this 3x3 matrix:
[,1] [,2] [,3]
[1,] 3 4 13
[2,] 9 1 2
[3,] 2 11 1
rearranging the rows
2015 Oct 28
3
Extraer elementos diagonales de submatrices
Estimado Javier,
Gracias por tu mensaje.
No, lo unico que requiero es la lista de números (i1, 2, 3, 1, 2, 3, 4, 5,
1, 2).
Saludos cordiales,
Jorge.-
2015-10-28 14:35 GMT-05:00 Javier Rubén Marcuzzi <
javier.ruben.marcuzzi en gmail.com>:
> Estimado Jorge I Velez
>
>
>
> No comprendo un punto, dices que deseas construir sub matrices y extraer
> elementos de sub