Displaying 20 results from an estimated 1100 matches similar to: "How do I write a sum of matrixes??"
2008 Apr 22
2
nth step transition matrices
Hello,
I have a question in regards to markov chains and transition
probabilities.
I am trying to figure out a way to calculate the "kth-step transition
matrix" of a given matrix.
Say for example I have a single step 2x2 matrix:
1 2
P= 1 .95 .05
2 .01. 99
If I were to convert this matrix to a 2-step transition probability
matrix I would get:
2008 Apr 27
2
Raising a matrix to the (-1/2) power.
Hi, I need to raise a correlation matrix; R; to the negative one half power.
i.e. I need to find R^(-1/2)
eg: if R=[{1,.4},{.4,1}], then R^(-1/2)=[{1.0681,-.2229},
{-.2229,1.0681}]where matrix=[{row1},{row2}]
And are there any built in functions to do this? mtx.exp doesn't work
because it's not raised to a positive integer
Thank you so much.
--
View this message in context:
2012 Feb 20
3
How to determine a subset of a binary strings?
Hi,
I need some neat ways of determing a subset of binary strings. For example,
x=c(0,0,1), y=c(0,1,1), z=c(0,1,0). So x is a subset of y and z is also a
subset of y, but x is not a subset of z.
I tried to search R functions and packages but no hits. Any ideas?
Best,
Jing
--
Jing Tang, PhD
Senior Researcher
Finnish Institute of Molecular Medicine (FIMM)
FI-00014 University of
2011 Jun 21
2
function to undo the DIFF command in ARIMA command
Hi users.
I'm new user in R.
I'm workiing with Time series and I would like to know how can I do to undo
the command DIFF(X), for exemple:
If I have the model: m=arima(X, order=c(0,1,1),
seasonal=list(order=c(0,0,1))) (note that have d=1 one difference), to find,
in the same scale, the original numbers (like one "unDiff"), after the
forecast, I need to develop some function or in
2010 Sep 08
2
Matrixes inside matrixes
Hello everyone,
Could you please help me find out if R supports matrixes inside matrixes?
This is what I would like to do
I have an area map of humidity per km. I would like at every cell to keep also
information about the height of this area, the current temperature etc.
Is something like that supported?
I would like to thank you in advance for your help
Best Regards
Alex
2003 Mar 12
1
apply with two matrixes
Hi,
I have a function which does a certain task with two vectors,
f1 <- function(a,b){body}
I also have a list of matrixes (all with the same dim's), and for each
column of each matrix in the list I want to use "f1", in such way that
it gives the vector "a" in the first argument of "f1". The second argument
of the function "b" also comes form a
2009 Nov 17
0
Marginal Homogeneity tests for sparse matrixes ?
Hello people,
I am in need for testing Marginal Homogeneity for sparse (more then 2X2)
matrixes.
After searching, what I found by now is that for more then 2 by 2 matrixes,
one turns to "stuart maxwell tests" that are available in two packages:
irr - see: stuart.maxwell.mh
coin - see: mh_test
But I couldn't find in the documentation how valid the results are for
sparse matrixes,
2009 Sep 21
2
Combine vectors in order to form matrixes with combn
Hello!
I've a problem with the combn function and a set of vector. I
would like to make a simple combination where, instead of scalars, i
would like to combine vector, in order to form matrixes.
In other
words, i have nineteen 6-items vectors (for example coef1-coef19), that
i would like to combine in n!/k!(n-k)! 6x6 matrixes.
I tried with a
code like this
mma <-
2011 Mar 04
4
How two compare two matrixes
Dear all I have two 10*10 matrixes and I would like to compare theirs contents. By the word content I mean to check visually (not with any mathematical formulation) how similar are the contents.
I also know edit that prints my matrix in the scree but still one edit blocks the prompt to launch a second edit() screen.
What is the best way to compare these two matrices?
I would like to thank you
2006 Oct 13
3
multiply two matrixes with the different dimension column by column
Dear all,
I would like to multiply two matrixes with the different dimension column
by column. Let make an example:
If I have two matrixes "X" and "Y"as follow:
X<- matrix(1:12, nrow=4, ncol=3, dimnames=list(c("A","B","C","D"),
c("stage1","stage2","stage3")))
Y<- matrix(1:28, nrow=4, ncol=7,
2009 Oct 16
2
Matrixes as data
Hola!
I am working on a problem where data points are (square) matrices. Is
there a way to make a
"vector" of matrices, such that it can be stored in a data.frame? Can
that be done with S3?
or do I have to learn S4 objects & methods?
Kjetil
2014 Apr 17
2
[PATCH v9 03/19] qspinlock: Add pending bit
On Thu, Apr 17, 2014 at 11:03:55AM -0400, Waiman Long wrote:
> +/**
> + * trylock_pending - try to acquire queue spinlock using the pending bit
> + * @lock : Pointer to queue spinlock structure
> + * @pval : Pointer to value of the queue spinlock 32-bit word
> + * Return: 1 if lock acquired, 0 otherwise
> + */
> +static inline int trylock_pending(struct qspinlock *lock, u32
2014 Apr 17
2
[PATCH v9 03/19] qspinlock: Add pending bit
On Thu, Apr 17, 2014 at 11:03:55AM -0400, Waiman Long wrote:
> +/**
> + * trylock_pending - try to acquire queue spinlock using the pending bit
> + * @lock : Pointer to queue spinlock structure
> + * @pval : Pointer to value of the queue spinlock 32-bit word
> + * Return: 1 if lock acquired, 0 otherwise
> + */
> +static inline int trylock_pending(struct qspinlock *lock, u32
2002 Apr 09
1
Problem handling NA indexes for character matrixes (PR#1447)
In a package I've been developing for manipulating genetic data I discovered
a problem when indexing into character arrays using NA's:
Create a character matrix and a numeric matrix
> cmat <- matrix( letters[1:4], ncol=2, nrow=2)
> nmat <- matrix( 1:4, ncol=2, nrow=2)
Create an index vector containing an NA value
> indvec <- c(1,2,NA)
Indexing works fine for both
2004 Mar 26
4
cbind/rbind fail on matrixes containing lists (PR#6702)
Today's R 1.9.0 beta:
> m1
[,1] [,2] [,3] [,4]
[1,] NA NA NA NA
[2,] NA NA NA NA
[3,] NA NA NA NA
[4,] NA NA NA NA
> class(m1[1,1])
[1] "list"
> cbind(m1,m1)
Error in cbind(...) : cannot create a matrix from these types
> rbind(m1,m1)
Error in rbind(...) : cannot create a matrix from these types
> version
_
2010 Jan 18
1
Sub-matrixes that are linked to the "Base matrix"
Hello,
I'm am in the process of trying to port a RATS functions to R and have
the problem, that RATS allows for the creation of submatrixes that are
linked to their basematrix.
Basically it should work like this:
a = matrix(1:(4*3),4,3)
a
# [,1] [,2] [,3]
# [1,] 1 5 9
# [2,] 2 6 10
# [3,] 3 7 11
# [4,] 4 8 12
# This of course doesnt work :)
b =
2012 Aug 20
1
Colour gradients and colour fill between points
Hello,
Can somebody help me on a colour question?
I have a levelplot made with the following syntax:
library(lattice)
inp <- read.csv("hoenne1", header = TRUE)
levelplot(z~x*y, data = inp, region = TRUE, pretty = TRUE, col.regions
= terrain.colours)
The file "hoenne1" contains the data. I'll give a short example:
x,y,z
0,0,1
0,1,1
0,2,1
1,0,2
1,2,2
0,2,2
1,2,3
2,2,2
2014 Jun 12
2
[PATCH v11 06/16] qspinlock: prolong the stay in the pending bit path
On Wed, Jun 11, 2014 at 05:22:28PM -0400, Long, Wai Man wrote:
> >>@@ -233,11 +233,25 @@ void queue_spin_lock_slowpath(struct qspinlock *lock, u32 val)
> >> */
> >> for (;;) {
> >> /*
> >>- * If we observe any contention; queue.
> >>+ * If we observe that the queue is not empty or both
> >>+ * the pending and lock bits
2014 Jun 12
2
[PATCH v11 06/16] qspinlock: prolong the stay in the pending bit path
On Wed, Jun 11, 2014 at 05:22:28PM -0400, Long, Wai Man wrote:
> >>@@ -233,11 +233,25 @@ void queue_spin_lock_slowpath(struct qspinlock *lock, u32 val)
> >> */
> >> for (;;) {
> >> /*
> >>- * If we observe any contention; queue.
> >>+ * If we observe that the queue is not empty or both
> >>+ * the pending and lock bits
2014 Jun 17
5
[PATCH 03/11] qspinlock: Add pending bit
On Sun, Jun 15, 2014 at 02:47:00PM +0200, Peter Zijlstra wrote:
> Because the qspinlock needs to touch a second cacheline; add a pending
> bit and allow a single in-word spinner before we punt to the second
> cacheline.
Could you add this in the description please:
And by second cacheline we mean the local 'node'. That is the:
mcs_nodes[0] and mcs_nodes[idx]
Perhaps it might be