Displaying 3 results from an estimated 3 matches for "bistochastic".
2006 Oct 16
2
Generate a random bistochastic matrix
Please, I would like to generate a random bistochastic matrix, that is a squared matrix of non-negative numbers with each row and each column sum to 1, for example :
.2 .3 .5
.6 .3 .1
.2 .4 .4
I don't know of to code this. Do you have any idea ?
Thanks
Florent Bresson
__________________________________________...
2006 Oct 16
2
Re : Re : Generate a random bistochastic matrix
Yes, you're right. In fact, it's just an adaptation of a matlab command and the author advises using N^4 replications that's why it's the default in the function. The bistochastic matrix is not my subject of interest, but I need it to perform some random tranformation of a vector of incomes.
Florent Bresson
----- Message d'origine ----
De : Richard M. Heiberger <rmh at temple.edu>
? : Florent Bresson <f_bresson at yahoo.fr>; r-help at stat.math.ethz.ch
Envo...
2006 Oct 16
5
Re : Generate a random bistochastic matrix
...erform a mean-preserving transformation of a vector.
----- Message d'origine ----
De : Richard M. Heiberger <rmh at temple.edu>
? : Florent Bresson <f_bresson at yahoo.fr>; r-help at stat.math.ethz.ch
Envoy? le : Lundi, 16 Octobre 2006, 14h58mn 13s
Objet : Re: [R] Generate a random bistochastic matrix
bistochastic.3x3 <- function() {
B <- matrix(0, 3, 3)
## 2 df
tmp.1 <- runif(3)
B[1,] <- tmp.1/sum(tmp.1)
## 1 df
tmp.2 <- runif(2)
B[2:3, 1] <- (1-B[1,1]) * tmp.2/sum(tmp.2)
## 1 df
B[2, 2] <- runif(1, max=min(1-B[1,2], 1-B[2,1]))
## Fil...