Skip to main content
Explained why I was comparing these two distributions, after reading the comments.
Source Link
Lokdal
  • 405
  • 2
  • 8

I'm sampling a DirichletDistribution like so:

n = 5000;
par1 = Table[1./n,n];
data1 = RandomVariate[DirichletDistribution[par1],50];  
(* This takes about 1.5 seconds *)
par2 = Table[1.,n];
data2 = RandomVariate[DirichletDistribution[par2],50];  
(* This takes about 0.10 seconds *)

If I play with the value of the parameters, I find that giving values > 1 radically improves the performance. Any clues on how to circumvent this?

EDIT : The reason why I'm comparing par1 and par2 is that I was hoping for a shortcut following this kind of reasoning (although I know that this is false): DirichletDistribution[n*par] / n

I'm sampling a DirichletDistribution like so:

n = 5000;
par1 = Table[1./n,n];
data1 = RandomVariate[DirichletDistribution[par1],50];  
(* This takes about 1.5 seconds *)
par2 = Table[1.,n];
data2 = RandomVariate[DirichletDistribution[par2],50];  
(* This takes about 0.10 seconds *)

If I play with the value of the parameters, I find that giving values > 1 radically improves the performance. Any clues on how to circumvent this?

I'm sampling a DirichletDistribution like so:

n = 5000;
par1 = Table[1./n,n];
data1 = RandomVariate[DirichletDistribution[par1],50];  
(* This takes about 1.5 seconds *)
par2 = Table[1.,n];
data2 = RandomVariate[DirichletDistribution[par2],50];  
(* This takes about 0.10 seconds *)

If I play with the value of the parameters, I find that giving values > 1 radically improves the performance. Any clues on how to circumvent this?

EDIT : The reason why I'm comparing par1 and par2 is that I was hoping for a shortcut following this kind of reasoning (although I know that this is false): DirichletDistribution[n*par] / n

edited tags
Link
added 4 characters in body
Source Link
dr.blochwave
  • 8.8k
  • 3
  • 43
  • 76

I'm sampling a DirichletDistributionDirichletDistribution like so:

n = 5 000;

par1 = Table[1./n,n];

data1 = RandomVariate[DirichletDistribution[par1],50]; (* This takes about 1.5 seconds *)

par2 = Table[1.,n];

data2 = RandomVariate[DirichletDistribution[par2],50]; (* This takes about 0.10 seconds *)

n = 5000;
par1 = Table[1./n,n];
data1 = RandomVariate[DirichletDistribution[par1],50];  
(* This takes about 1.5 seconds *)
par2 = Table[1.,n];
data2 = RandomVariate[DirichletDistribution[par2],50];  
(* This takes about 0.10 seconds *)

If I play with the value of the parameters, I find that giving values > 1 radically improves the performance.

  Any clues on how to circumvent this? Thanks!

I'm sampling a DirichletDistribution like so:

n = 5 000;

par1 = Table[1./n,n];

data1 = RandomVariate[DirichletDistribution[par1],50]; (* This takes about 1.5 seconds *)

par2 = Table[1.,n];

data2 = RandomVariate[DirichletDistribution[par2],50]; (* This takes about 0.10 seconds *)

If I play with the value of the parameters, I find that giving values > 1 radically improves the performance.

  Any clues on how to circumvent this? Thanks!

I'm sampling a DirichletDistribution like so:

n = 5000;
par1 = Table[1./n,n];
data1 = RandomVariate[DirichletDistribution[par1],50];  
(* This takes about 1.5 seconds *)
par2 = Table[1.,n];
data2 = RandomVariate[DirichletDistribution[par2],50];  
(* This takes about 0.10 seconds *)

If I play with the value of the parameters, I find that giving values > 1 radically improves the performance. Any clues on how to circumvent this?

Source Link
Lokdal
  • 405
  • 2
  • 8
Loading