Sent: Tuesday, October 17, 2006 3:31 PM
To: Ravi Varadhan
Cc: R-help@stat.math.ethz.ch; 'Florent Bresson'
Subject: Re: [R] Re : Generate a random bistochastic matrix
Thank you, Ravi,
>>>>> "Ravi" == Ravi Varadhan <[EMAIL PROTECTED]>
>>>>
Thank you, Ravi,
> "Ravi" == Ravi Varadhan <[EMAIL PROTECTED]>
> on Mon, 16 Oct 2006 18:54:16 -0400 writes:
Ravi> Martin, I don't think that a doubly stochastic matrix
Ravi> can be obtained from an arbitrary positive rectangular
Ravi> matrix. There is a theorem by Sinkhor
---
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Martin Maechler
Sent: Monday, October 16, 2006 10:30 AM
To: Florent Bresson
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Re : Generate a
On 10/16/2006 11:50 AM, Rolf Turner wrote:
> I don't think this idea has been suggested yet:
>
> (1) Form all n! n x n permutation matrices,
> say M_1, ..., M_K, K = n!.
>
> (2) Generate K independent uniform variates
> x_1, ..., x_k.
>
> (3) Renormalize these to su
I don't think this idea has been suggested yet:
(1) Form all n! n x n permutation matrices,
say M_1, ..., M_K, K = n!.
(2) Generate K independent uniform variates
x_1, ..., x_k.
(3) Renormalize these to sum to 1,
x <- x/sum(x)
(4)
Thanks, I think it's a shrewd solution, but the problem is that it cannot
generate every N*N bistochastic matrix and every cell tends to 1/N as B tends
to infinity
Florent Bresson
- Message d'origine
De : Dimitris Rizopoulos <[EMAIL PROTECTED]>
À : Florent Bresson <[EMAIL PROTECTED]>
C
A simpler approach --- as in similar problems ---
is to use an iterative solution which works quite fast for any 'n'.
Interestingly, the number of necessary iterations seems to
*decrease* for increasing 'n' :
bistochMat <- function(n, tol = 1e-7, maxit = 1000)
{
## Purpose: Random bistochasti
I am sorry, I can't figure out what your function is doing.
Why do you have N^4 in the argument? A matrix should have
N rows and N columns, that is, it should have length N^2.
The function returns a vector, not a matrix.
There is no example of its use.
I am guessing that your function somewhere
Thanks, I tried someting like this, but computation takes times for large
matrices
btransf<-function(y,X=length(y)^4){
N<-length(y)
bm<-matrix(rep(1/N,N^2),N,N)
for(j in 1:X){
coord<-sample(1:N,4,replace=T)