Re: coorelating randomly generated data



"Ed Dressel" <none@xxxxxxxx> wrote
I need to create (not just analyze) different series
with different means & standard dev. that have
correlation between them (such as small cap and large cap stocks)
But how to do that is beyond my scope of knowledge

Beyond mine too; but that does not keep me from
making some assumptions and designing some code.

Design records (or objects) to encapsulate
the basic behavior on an investment.

Types
tpItemValueDef = ^tItemValueDef;
tCorrelationRec = record
Correlation: double;
ToWhat: tpItemValueDef;
end;
tItemValueDef = record
BegValue: double;
AvgROI: double;
MonthlyVolitility: double;
DailyVolitility: double;
Correlations: array of tCorrelationRec;
end;
tItemValueDef = record
ItemDef: tpItemValueDef;
DayNbr: integer;
CurVal, MonthlyVal: double;
end;

Vars
ItemDefs: array of ...
ItemVals: array of ...

{ Loading the Item Def recs: }
...
{ Initialization of the Item Value recs: }
...
{ Scan each day: }
For iDay := 1 to NbrDays do begin
For iItem := 0 to length(ItemVals)-1 do begin
{ Update each Item Value rec: }
...
end{iItem-loop};
{ Record the day's closing values: }
...
end{iDay-loop};

But before doing the above, I would
1. consider studying the results of some Googles like
http://www.google.com/search?hl=en&q=%22simulating+the+stock+market%22
and
2. consider using historical data with the names and dates
stripped and assume that the future would look something
like the past.

HTH. Rgds, JohnH

.



Relevant Pages

  • Re: using a named cell in a fuction
    ... Josh wrote: ... > row has a different title that matches an array of cells. ... > correlation of the arrays matching its column and row, ...
    (microsoft.public.excel.worksheet.functions)
  • Re: java based supercomputer
    ... checking the correlation beteween an array of data and another array ... java psuedo remote threads will take a considerrably less time. ... Does your algorithm lend itself well to paralellization? ... the only bottleneck i can see is checking the correlation value ...
    (comp.lang.java.programmer)
  • Re: Generating a Matrix of Random values with a specified Correlation
    ... (array C), where array B is sorted so that array A and array C have a ... correlation of X. ...  Let's suppose the desired correlation x> rho (where of course x ... chances of understanding your response. ...
    (sci.math)
  • Re: Optimizing the creation of an array of correllation coefficents
    ... if (rowcount> colcount) ... largest array you have room for in your matlab memory. ... content but shifted in location within the 3D image frame, ... Your computation provides no measure of a correlation ...
    (comp.soft-sys.matlab)