Re: coorelating randomly generated data
- From: "John Herbster" <herb-sci1_AT_sbcglobal.net>
- Date: Tue, 18 Dec 2007 06:12:04 -0600
"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
.
- References:
- coorelating randomly generated data
- From: Ed Dressel
- Re: coorelating randomly generated data
- From: John Herbster
- Re: coorelating randomly generated data
- From: Ed Dressel
- coorelating randomly generated data
- Prev by Date: Re: coorelating randomly generated data
- Next by Date: Re: Remobjects as a role model
- Previous by thread: Re: coorelating randomly generated data
- Next by thread: Re: coorelating randomly generated data
- Index(es):
Relevant Pages
|