Click here to Skip to main content
15,891,136 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Get a polygons from edges Pin
Member 41945936-Nov-08 8:22
Member 41945936-Nov-08 8:22 
GeneralRe: Get a polygons from edges Pin
73Zeppelin6-Nov-08 8:29
73Zeppelin6-Nov-08 8:29 
GeneralRe: Get a polygons from edges Pin
furqan_sindhu9-Nov-08 19:01
furqan_sindhu9-Nov-08 19:01 
GeneralRe: Get a polygons from edges Pin
Member 419459310-Nov-08 3:08
Member 419459310-Nov-08 3:08 
GeneralRe: Get a polygons from edges Pin
furqan_sindhu9-Nov-08 18:56
furqan_sindhu9-Nov-08 18:56 
AnswerRe: Get a polygons from edges Pin
darrellp28-Nov-08 19:38
darrellp28-Nov-08 19:38 
QuestionRandom Number Generation Pin
BobInNJ5-Nov-08 13:47
BobInNJ5-Nov-08 13:47 
AnswerRe: Random Number Generation Pin
73Zeppelin5-Nov-08 21:36
73Zeppelin5-Nov-08 21:36 
Do you mean a single random variable with a fixed autocorrelation structure, or are you taking about multiple random variables with a given correlation matrix?

In any event, there are two main ways of doing this; either by Cholesky decomposition or eigenvector decomposition. Cholesky decomposition is probably more conceptually simple.

For normal variables, the basic idea is to find a matrix U such that U'U = C (where U' is the transpose of U) and C is the given correlation matrix. You can then generate correlated random numbers, N' from random numbers N by multiplying by U. That is:

N' = NU

So, how to find U? Like I said, either by Cholesky decomposition or eigenvector decomposition. Until I know what you really want to do, I'll give you the case for pairs of r.v.'s.

For pairs of normal variables, you can generate two sequences of normal r.v.'s, say X1 and X2. Given correlation, p, the new sequence, Y is calculated as:

Y = p*X1 + sqrt(1-p^2) * X2

This will give you a sequence Y that has correlation p with sequence X1. If you want a fixed correlation structure between more than two sequences, we'll have to get into matrix calculations.
GeneralRe: Random Number Generation Pin
BobInNJ6-Nov-08 6:29
BobInNJ6-Nov-08 6:29 
GeneralRe: Random Number Generation Pin
73Zeppelin6-Nov-08 8:28
73Zeppelin6-Nov-08 8:28 
GeneralRe: Random Number Generation Pin
BobInNJ6-Nov-08 9:56
BobInNJ6-Nov-08 9:56 
GeneralRe: Random Number Generation Pin
73Zeppelin6-Nov-08 10:21
73Zeppelin6-Nov-08 10:21 
GeneralRe: Random Number Generation Pin
BobInNJ6-Nov-08 12:51
BobInNJ6-Nov-08 12:51 
GeneralRe: Random Number Generation [modified] Pin
73Zeppelin6-Nov-08 20:50
73Zeppelin6-Nov-08 20:50 
QuestionRecords and Clusters [modified] Pin
DQNOK5-Nov-08 4:40
professionalDQNOK5-Nov-08 4:40 
AnswerRe: Records and Clusters Pin
Member 41945935-Nov-08 6:28
Member 41945935-Nov-08 6:28 
GeneralRe: Records and Clusters Pin
DQNOK5-Nov-08 6:56
professionalDQNOK5-Nov-08 6:56 
GeneralRe: Records and Clusters Pin
Member 41945935-Nov-08 7:44
Member 41945935-Nov-08 7:44 
GeneralRe: Records and Clusters Pin
DQNOK6-Nov-08 4:54
professionalDQNOK6-Nov-08 4:54 
GeneralRe: Records and Clusters Pin
Member 41945936-Nov-08 7:57
Member 41945936-Nov-08 7:57 
GeneralRe: Records and Clusters Pin
Member 419459325-Apr-09 4:28
Member 419459325-Apr-09 4:28 
GeneralRe: Records and Clusters Pin
DQNOK27-Apr-09 3:13
professionalDQNOK27-Apr-09 3:13 
GeneralRe: Records and Clusters Pin
DQNOK27-Apr-09 5:57
professionalDQNOK27-Apr-09 5:57 
GeneralRe: Records and Clusters Pin
Member 419459327-Apr-09 11:22
Member 419459327-Apr-09 11:22 
QuestionRePosted from C# Forums: A Job Exam Question Pin
Bulky Fellow4-Nov-08 20:31
Bulky Fellow4-Nov-08 20:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.