You've already forked lazarus-ccr
LazStats: Inherit AutoCorUnit from BasicStatsReportAndChartForm. Some refactoring of output.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7926 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1,315 +1,335 @@
|
||||
object AutoCorrForm: TAutoCorrForm
|
||||
Left = 456
|
||||
Height = 459
|
||||
Top = 145
|
||||
Width = 684
|
||||
inherited AutoCorrForm: TAutoCorrForm
|
||||
Left = 767
|
||||
Height = 512
|
||||
Top = 157
|
||||
Width = 991
|
||||
HelpType = htKeyword
|
||||
HelpKeyword = 'html/Autocorrelation.htm'
|
||||
AutoSize = True
|
||||
Caption = 'Autocorrelation'
|
||||
ClientHeight = 459
|
||||
ClientWidth = 684
|
||||
OnActivate = FormActivate
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
Position = poMainFormCenter
|
||||
LCLVersion = '2.0.10.0'
|
||||
object GroupBox1: TGroupBox
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Owner
|
||||
Left = 8
|
||||
Height = 68
|
||||
Top = 8
|
||||
Width = 126
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
Caption = 'The series is code in:'
|
||||
ClientHeight = 48
|
||||
ClientWidth = 122
|
||||
TabOrder = 0
|
||||
object ColBtn: TRadioButton
|
||||
AnchorSideLeft.Control = GroupBox1
|
||||
AnchorSideTop.Control = GroupBox1
|
||||
Left = 16
|
||||
Height = 19
|
||||
Top = 0
|
||||
Width = 94
|
||||
BorderSpacing.Left = 16
|
||||
Caption = 'a grid column'
|
||||
Checked = True
|
||||
OnClick = ColBtnClick
|
||||
TabOrder = 0
|
||||
TabStop = True
|
||||
end
|
||||
object RowBtn: TRadioButton
|
||||
AnchorSideLeft.Control = ColBtn
|
||||
AnchorSideTop.Control = ColBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 16
|
||||
Height = 19
|
||||
Top = 21
|
||||
Width = 73
|
||||
BorderSpacing.Top = 2
|
||||
BorderSpacing.Right = 8
|
||||
BorderSpacing.Bottom = 8
|
||||
Caption = 'a grid row'
|
||||
OnClick = RowBtnClick
|
||||
TabOrder = 1
|
||||
end
|
||||
end
|
||||
object GroupBox2: TGroupBox
|
||||
AnchorSideLeft.Control = GroupBox1
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = Owner
|
||||
Left = 158
|
||||
Height = 68
|
||||
Top = 8
|
||||
Width = 275
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 24
|
||||
BorderSpacing.Top = 8
|
||||
Caption = 'Include Cases:'
|
||||
ClientHeight = 48
|
||||
ClientWidth = 271
|
||||
ClientHeight = 512
|
||||
ClientWidth = 991
|
||||
inherited ParamsPanel: TPanel
|
||||
Height = 496
|
||||
Width = 448
|
||||
ClientHeight = 496
|
||||
ClientWidth = 448
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
AnchorSideLeft.Control = FromCaseEdit
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = OnlyCasesBtn
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 189
|
||||
Height = 15
|
||||
Top = 23
|
||||
Width = 12
|
||||
BorderSpacing.Left = 4
|
||||
Caption = 'To'
|
||||
ParentColor = False
|
||||
inherited CloseBtn: TButton
|
||||
Left = 393
|
||||
Top = 471
|
||||
TabOrder = 14
|
||||
end
|
||||
object AllCasesBtn: TRadioButton
|
||||
AnchorSideLeft.Control = GroupBox2
|
||||
AnchorSideTop.Control = GroupBox2
|
||||
Left = 12
|
||||
Height = 19
|
||||
inherited ComputeBtn: TButton
|
||||
Left = 309
|
||||
Top = 471
|
||||
TabOrder = 13
|
||||
end
|
||||
inherited ResetBtn: TButton
|
||||
Left = 247
|
||||
Top = 471
|
||||
TabOrder = 12
|
||||
end
|
||||
inherited HelpBtn: TButton
|
||||
Tag = 104
|
||||
Left = 188
|
||||
Top = 471
|
||||
TabOrder = 11
|
||||
end
|
||||
inherited ButtonBevel: TBevel
|
||||
Top = 455
|
||||
Width = 448
|
||||
end
|
||||
object GroupBox1: TGroupBox[5]
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideTop.Control = ParamsPanel
|
||||
Left = 0
|
||||
Height = 68
|
||||
Top = 0
|
||||
Width = 67
|
||||
BorderSpacing.Left = 12
|
||||
Caption = 'All Cases'
|
||||
Width = 126
|
||||
AutoSize = True
|
||||
Caption = 'The series is code in:'
|
||||
ClientHeight = 48
|
||||
ClientWidth = 122
|
||||
TabOrder = 0
|
||||
object ColBtn: TRadioButton
|
||||
AnchorSideLeft.Control = GroupBox1
|
||||
AnchorSideTop.Control = GroupBox1
|
||||
Left = 16
|
||||
Height = 19
|
||||
Top = 0
|
||||
Width = 94
|
||||
BorderSpacing.Left = 16
|
||||
Caption = 'a grid column'
|
||||
Checked = True
|
||||
OnClick = ColBtnClick
|
||||
TabOrder = 0
|
||||
TabStop = True
|
||||
end
|
||||
object RowBtn: TRadioButton
|
||||
AnchorSideLeft.Control = ColBtn
|
||||
AnchorSideTop.Control = ColBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 16
|
||||
Height = 19
|
||||
Top = 21
|
||||
Width = 73
|
||||
BorderSpacing.Top = 2
|
||||
BorderSpacing.Right = 8
|
||||
BorderSpacing.Bottom = 8
|
||||
Caption = 'a grid row'
|
||||
OnClick = RowBtnClick
|
||||
TabOrder = 1
|
||||
end
|
||||
end
|
||||
object OnlyCasesBtn: TRadioButton
|
||||
AnchorSideLeft.Control = GroupBox2
|
||||
AnchorSideTop.Control = AllCasesBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 12
|
||||
Height = 19
|
||||
Top = 21
|
||||
Width = 112
|
||||
BorderSpacing.Left = 12
|
||||
BorderSpacing.Top = 2
|
||||
BorderSpacing.Bottom = 8
|
||||
Caption = 'Only Cases From:'
|
||||
object GroupBox2: TGroupBox[6]
|
||||
AnchorSideLeft.Control = GroupBox1
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = ParamsPanel
|
||||
AnchorSideRight.Control = ParamsPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 142
|
||||
Height = 68
|
||||
Top = 0
|
||||
Width = 306
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 16
|
||||
Caption = 'Include Cases:'
|
||||
ClientHeight = 48
|
||||
ClientWidth = 302
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
AnchorSideLeft.Control = FromCaseEdit
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = OnlyCasesBtn
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 189
|
||||
Height = 15
|
||||
Top = 23
|
||||
Width = 12
|
||||
BorderSpacing.Left = 4
|
||||
Caption = 'To'
|
||||
ParentColor = False
|
||||
end
|
||||
object AllCasesBtn: TRadioButton
|
||||
AnchorSideLeft.Control = GroupBox2
|
||||
AnchorSideTop.Control = GroupBox2
|
||||
Left = 12
|
||||
Height = 19
|
||||
Top = 0
|
||||
Width = 67
|
||||
BorderSpacing.Left = 12
|
||||
Caption = 'All Cases'
|
||||
TabOrder = 0
|
||||
end
|
||||
object OnlyCasesBtn: TRadioButton
|
||||
AnchorSideLeft.Control = GroupBox2
|
||||
AnchorSideTop.Control = AllCasesBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 12
|
||||
Height = 19
|
||||
Top = 21
|
||||
Width = 112
|
||||
BorderSpacing.Left = 12
|
||||
BorderSpacing.Top = 2
|
||||
BorderSpacing.Bottom = 8
|
||||
Caption = 'Only Cases From:'
|
||||
TabOrder = 1
|
||||
end
|
||||
object FromCaseEdit: TEdit
|
||||
AnchorSideLeft.Control = OnlyCasesBtn
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = OnlyCasesBtn
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 128
|
||||
Height = 23
|
||||
Top = 19
|
||||
Width = 57
|
||||
Alignment = taRightJustify
|
||||
BorderSpacing.Left = 4
|
||||
TabOrder = 2
|
||||
Text = 'FromCaseEdit'
|
||||
end
|
||||
object ToCaseEdit: TEdit
|
||||
AnchorSideLeft.Control = Label1
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = OnlyCasesBtn
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 205
|
||||
Height = 23
|
||||
Top = 19
|
||||
Width = 58
|
||||
Alignment = taRightJustify
|
||||
BorderSpacing.Left = 4
|
||||
BorderSpacing.Right = 8
|
||||
TabOrder = 3
|
||||
Text = 'ToCaseEdit'
|
||||
end
|
||||
end
|
||||
object FromCaseEdit: TEdit
|
||||
AnchorSideLeft.Control = OnlyCasesBtn
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = OnlyCasesBtn
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 128
|
||||
Height = 23
|
||||
Top = 19
|
||||
Width = 57
|
||||
Alignment = taRightJustify
|
||||
BorderSpacing.Left = 4
|
||||
TabOrder = 2
|
||||
Text = 'FromCaseEdit'
|
||||
end
|
||||
object ToCaseEdit: TEdit
|
||||
AnchorSideLeft.Control = Label1
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = OnlyCasesBtn
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 205
|
||||
Height = 23
|
||||
Top = 19
|
||||
Width = 58
|
||||
Alignment = taRightJustify
|
||||
BorderSpacing.Left = 4
|
||||
BorderSpacing.Right = 8
|
||||
TabOrder = 3
|
||||
Text = 'ToCaseEdit'
|
||||
end
|
||||
end
|
||||
object ResetBtn: TButton
|
||||
AnchorSideRight.Control = ComputeBtn
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 475
|
||||
Height = 25
|
||||
Top = 426
|
||||
Width = 54
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 8
|
||||
BorderSpacing.Bottom = 8
|
||||
Caption = 'Reset'
|
||||
OnClick = ResetBtnClick
|
||||
TabOrder = 5
|
||||
end
|
||||
object ComputeBtn: TButton
|
||||
AnchorSideRight.Control = CloseBtn
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 537
|
||||
Height = 25
|
||||
Top = 426
|
||||
Width = 76
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 8
|
||||
BorderSpacing.Bottom = 8
|
||||
Caption = 'Compute'
|
||||
OnClick = ComputeBtnClick
|
||||
TabOrder = 6
|
||||
end
|
||||
object CloseBtn: TButton
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 621
|
||||
Height = 25
|
||||
Top = 426
|
||||
Width = 55
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 8
|
||||
BorderSpacing.Bottom = 8
|
||||
Caption = 'Close'
|
||||
ModalResult = 11
|
||||
OnClick = CloseBtnClick
|
||||
TabOrder = 7
|
||||
end
|
||||
object HelpBtn: TButton
|
||||
Tag = 104
|
||||
AnchorSideRight.Control = ResetBtn
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 416
|
||||
Height = 25
|
||||
Top = 426
|
||||
Width = 51
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 8
|
||||
BorderSpacing.Bottom = 8
|
||||
Caption = 'Help'
|
||||
OnClick = HelpBtnClick
|
||||
TabOrder = 4
|
||||
end
|
||||
object ButtonBevel: TBevel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = CloseBtn
|
||||
Left = 0
|
||||
Height = 8
|
||||
Top = 410
|
||||
Width = 684
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
Shape = bsBottomLine
|
||||
end
|
||||
object Panel1: TPanel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = GroupBox2
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Panel2
|
||||
AnchorSideBottom.Control = ButtonBevel
|
||||
Left = 8
|
||||
Height = 326
|
||||
Top = 84
|
||||
Width = 447
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 326
|
||||
ClientWidth = 447
|
||||
TabOrder = 2
|
||||
object Label3: TLabel
|
||||
AnchorSideLeft.Control = Panel1
|
||||
AnchorSideTop.Control = Panel1
|
||||
object Label3: TLabel[7]
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideTop.Control = GroupBox1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 15
|
||||
Top = 0
|
||||
Top = 80
|
||||
Width = 100
|
||||
BorderSpacing.Top = 12
|
||||
Caption = 'Available Variables:'
|
||||
ParentColor = False
|
||||
end
|
||||
object Label4: TLabel
|
||||
object VarList: TListBox[8]
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideTop.Control = Label3
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = InBtn
|
||||
AnchorSideBottom.Control = GroupBox4
|
||||
Left = 0
|
||||
Height = 169
|
||||
Top = 97
|
||||
Width = 205
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Top = 2
|
||||
BorderSpacing.Right = 6
|
||||
BorderSpacing.Bottom = 12
|
||||
ItemHeight = 0
|
||||
OnDblClick = VarListDblClick
|
||||
OnSelectionChange = VarListSelectionChange
|
||||
TabOrder = 2
|
||||
end
|
||||
object InBtn: TBitBtn[9]
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = VarList
|
||||
Left = 211
|
||||
Height = 26
|
||||
Top = 97
|
||||
Width = 26
|
||||
Images = MainDataModule.ImageList
|
||||
ImageIndex = 1
|
||||
OnClick = InBtnClick
|
||||
Spacing = 0
|
||||
TabOrder = 3
|
||||
end
|
||||
object OutBtn: TBitBtn[10]
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = InBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 211
|
||||
Height = 26
|
||||
Top = 127
|
||||
Width = 26
|
||||
BorderSpacing.Top = 4
|
||||
Images = MainDataModule.ImageList
|
||||
ImageIndex = 0
|
||||
OnClick = OutBtnClick
|
||||
Spacing = 0
|
||||
TabOrder = 4
|
||||
end
|
||||
object Label4: TLabel[11]
|
||||
AnchorSideLeft.Control = DepVarEdit
|
||||
AnchorSideBottom.Control = DepVarEdit
|
||||
Left = 301
|
||||
Left = 243
|
||||
Height = 15
|
||||
Top = 25
|
||||
Top = 101
|
||||
Width = 88
|
||||
Anchors = [akLeft, akBottom]
|
||||
BorderSpacing.Bottom = 2
|
||||
Caption = 'Selected Variable'
|
||||
ParentColor = False
|
||||
end
|
||||
object Label5: TLabel
|
||||
object DepVarEdit: TEdit[12]
|
||||
AnchorSideLeft.Control = InBtn
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideRight.Control = ParamsPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = OutBtn
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 243
|
||||
Height = 23
|
||||
Top = 118
|
||||
Width = 205
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Bottom = 12
|
||||
ReadOnly = True
|
||||
TabOrder = 5
|
||||
Text = 'DepVarEdit'
|
||||
end
|
||||
object Label5: TLabel[13]
|
||||
AnchorSideTop.Control = AlphaEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = AlphaEdit
|
||||
Left = 311
|
||||
Left = 312
|
||||
Height = 15
|
||||
Top = 93
|
||||
Top = 161
|
||||
Width = 67
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Right = 8
|
||||
Caption = 'Alpha Level: '
|
||||
ParentColor = False
|
||||
end
|
||||
object Label6: TLabel
|
||||
object Label6: TLabel[14]
|
||||
AnchorSideTop.Control = MaxLagEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = MaxLagEdit
|
||||
Left = 295
|
||||
Left = 296
|
||||
Height = 15
|
||||
Top = 120
|
||||
Top = 188
|
||||
Width = 83
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Right = 8
|
||||
Caption = 'Maximum Lag: '
|
||||
ParentColor = False
|
||||
end
|
||||
object GroupBox3: TGroupBox
|
||||
AnchorSideLeft.Control = InBtn
|
||||
object AlphaEdit: TEdit[15]
|
||||
AnchorSideTop.Control = DepVarEdit
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = ParamsPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 387
|
||||
Height = 23
|
||||
Top = 157
|
||||
Width = 61
|
||||
Alignment = taRightJustify
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Top = 16
|
||||
TabOrder = 6
|
||||
Text = 'AlphaEdit'
|
||||
end
|
||||
object MaxLagEdit: TEdit[16]
|
||||
AnchorSideTop.Control = AlphaEdit
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = ParamsPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 387
|
||||
Height = 23
|
||||
Top = 184
|
||||
Width = 61
|
||||
Alignment = taRightJustify
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Top = 4
|
||||
TabOrder = 7
|
||||
Text = 'MaxLagEdit'
|
||||
end
|
||||
object GroupBox3: TGroupBox[17]
|
||||
AnchorSideLeft.Control = GroupBox5
|
||||
AnchorSideTop.Control = MaxLagEdit
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Panel1
|
||||
AnchorSideRight.Control = ParamsPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 265
|
||||
Left = 221
|
||||
Height = 51
|
||||
Top = 163
|
||||
Width = 182
|
||||
Top = 223
|
||||
Width = 227
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 24
|
||||
Caption = 'Projection Option:'
|
||||
BorderSpacing.Top = 16
|
||||
Caption = 'Projection Option'
|
||||
ClientHeight = 31
|
||||
ClientWidth = 178
|
||||
TabOrder = 6
|
||||
ClientWidth = 223
|
||||
TabOrder = 8
|
||||
object Label2: TLabel
|
||||
AnchorSideLeft.Control = ProjPtsEdit
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
@ -352,219 +372,25 @@ object AutoCorrForm: TAutoCorrForm
|
||||
TabOrder = 1
|
||||
end
|
||||
end
|
||||
object VarList: TListBox
|
||||
AnchorSideLeft.Control = Panel1
|
||||
AnchorSideTop.Control = Label3
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = InBtn
|
||||
AnchorSideBottom.Control = Panel1
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 309
|
||||
Top = 17
|
||||
Width = 257
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Top = 2
|
||||
BorderSpacing.Right = 8
|
||||
Constraints.MinHeight = 220
|
||||
ItemHeight = 0
|
||||
OnSelectionChange = VarListSelectionChange
|
||||
TabOrder = 0
|
||||
end
|
||||
object InBtn: TBitBtn
|
||||
AnchorSideLeft.Control = Bevel2
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = VarList
|
||||
Left = 265
|
||||
Height = 28
|
||||
Top = 17
|
||||
Width = 28
|
||||
Glyph.Data = {
|
||||
36040000424D3604000000000000360000002800000010000000100000000100
|
||||
2000000000000004000064000000640000000000000000000000FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE
|
||||
6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580
|
||||
3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3
|
||||
71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6
|
||||
89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7
|
||||
74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA
|
||||
90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7
|
||||
74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799
|
||||
4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
|
||||
}
|
||||
Images = MainDataModule.ImageList
|
||||
ImageIndex = 1
|
||||
OnClick = InBtnClick
|
||||
Spacing = 0
|
||||
TabOrder = 1
|
||||
end
|
||||
object OutBtn: TBitBtn
|
||||
AnchorSideLeft.Control = InBtn
|
||||
AnchorSideTop.Control = InBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 265
|
||||
Height = 28
|
||||
Top = 49
|
||||
Width = 28
|
||||
BorderSpacing.Top = 4
|
||||
Glyph.Data = {
|
||||
36040000424D3604000000000000360000002800000010000000100000000100
|
||||
2000000000000004000064000000640000000000000000000000FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580
|
||||
3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3
|
||||
71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6
|
||||
89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7
|
||||
74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA
|
||||
90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF
|
||||
FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799
|
||||
4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
|
||||
}
|
||||
Images = MainDataModule.ImageList
|
||||
ImageIndex = 0
|
||||
OnClick = OutBtnClick
|
||||
Spacing = 0
|
||||
TabOrder = 2
|
||||
end
|
||||
object DepVarEdit: TEdit
|
||||
AnchorSideLeft.Control = InBtn
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideRight.Control = Panel1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = OutBtn
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 301
|
||||
Height = 23
|
||||
Top = 42
|
||||
Width = 146
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Bottom = 12
|
||||
ReadOnly = True
|
||||
TabOrder = 3
|
||||
Text = 'DepVarEdit'
|
||||
end
|
||||
object AlphaEdit: TEdit
|
||||
AnchorSideTop.Control = DepVarEdit
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Panel1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 386
|
||||
Height = 23
|
||||
Top = 89
|
||||
Width = 61
|
||||
Alignment = taRightJustify
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Top = 24
|
||||
TabOrder = 4
|
||||
Text = 'AlphaEdit'
|
||||
end
|
||||
object MaxLagEdit: TEdit
|
||||
AnchorSideTop.Control = AlphaEdit
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Panel1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 386
|
||||
Height = 23
|
||||
Top = 116
|
||||
Width = 61
|
||||
Alignment = taRightJustify
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Top = 4
|
||||
TabOrder = 5
|
||||
Text = 'MaxLagEdit'
|
||||
end
|
||||
object Bevel2: TBevel
|
||||
AnchorSideLeft.Control = Panel1
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = Panel1
|
||||
Left = 182
|
||||
Height = 12
|
||||
Top = 0
|
||||
Width = 83
|
||||
Shape = bsSpacer
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 463
|
||||
Height = 357
|
||||
Top = 6
|
||||
Width = 213
|
||||
Anchors = [akTop, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Right = 8
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 357
|
||||
ClientWidth = 213
|
||||
TabOrder = 3
|
||||
object GroupBox4: TGroupBox
|
||||
AnchorSideLeft.Control = Panel2
|
||||
AnchorSideTop.Control = GroupBox5
|
||||
AnchorSideTop.Side = asrBottom
|
||||
object GroupBox4: TGroupBox[18]
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideRight.Control = VarList
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = ButtonBevel
|
||||
Left = 0
|
||||
Height = 177
|
||||
Top = 180
|
||||
Width = 213
|
||||
Top = 278
|
||||
Width = 205
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 16
|
||||
Caption = 'Data Smoothing:'
|
||||
ChildSizing.LeftRightSpacing = 12
|
||||
ChildSizing.TopBottomSpacing = 6
|
||||
ChildSizing.VerticalSpacing = 2
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ClientHeight = 157
|
||||
ClientWidth = 209
|
||||
TabOrder = 1
|
||||
ClientWidth = 201
|
||||
TabOrder = 9
|
||||
object MeanChk: TCheckBox
|
||||
Left = 12
|
||||
Height = 19
|
||||
@ -619,29 +445,32 @@ object AutoCorrForm: TAutoCorrForm
|
||||
Top = 132
|
||||
Width = 185
|
||||
Caption = 'Multiple Regression Smooth'
|
||||
OnChange = MRegSmoothChkChange
|
||||
TabOrder = 6
|
||||
end
|
||||
end
|
||||
object GroupBox5: TGroupBox
|
||||
AnchorSideLeft.Control = Panel2
|
||||
AnchorSideTop.Control = Panel2
|
||||
AnchorSideRight.Control = GroupBox4
|
||||
object GroupBox5: TGroupBox[19]
|
||||
AnchorSideLeft.Control = GroupBox4
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = GroupBox4
|
||||
AnchorSideRight.Control = ParamsPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 156
|
||||
Top = 8
|
||||
Width = 213
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 8
|
||||
AnchorSideBottom.Control = GroupBox4
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 221
|
||||
Height = 177
|
||||
Top = 278
|
||||
Width = 227
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Left = 16
|
||||
Caption = 'Analysis / Output Options'
|
||||
ChildSizing.LeftRightSpacing = 12
|
||||
ChildSizing.TopBottomSpacing = 6
|
||||
ChildSizing.VerticalSpacing = 2
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ClientHeight = 136
|
||||
ClientWidth = 209
|
||||
TabOrder = 0
|
||||
ClientHeight = 157
|
||||
ClientWidth = 223
|
||||
TabOrder = 10
|
||||
object PlotChk: TCheckBox
|
||||
Left = 12
|
||||
Height = 19
|
||||
@ -688,8 +517,53 @@ object AutoCorrForm: TAutoCorrForm
|
||||
Top = 111
|
||||
Width = 148
|
||||
Caption = 'Residual plot'
|
||||
Enabled = False
|
||||
TabOrder = 5
|
||||
end
|
||||
end
|
||||
end
|
||||
inherited ParamsSplitter: TSplitter
|
||||
Left = 460
|
||||
Height = 512
|
||||
end
|
||||
inherited PageControl: TPageControl
|
||||
Left = 469
|
||||
Height = 496
|
||||
Width = 514
|
||||
ActivePage = YuleWalkerPage
|
||||
MultiLine = True
|
||||
TabIndex = 4
|
||||
TabOrder = 3
|
||||
Options = [nboMultiLine]
|
||||
inherited ChartPage: TTabSheet
|
||||
Caption = 'Correlogram'
|
||||
TabVisible = False
|
||||
end
|
||||
object CorrelationMatrixPage: TTabSheet[2]
|
||||
Caption = 'Correlation matrix'
|
||||
TabVisible = False
|
||||
end
|
||||
object PartialsPage: TTabSheet[3]
|
||||
Caption = 'Partial Correlations'
|
||||
TabVisible = False
|
||||
end
|
||||
object YuleWalkerPage: TTabSheet[4]
|
||||
Caption = 'Yule-Walker'
|
||||
TabVisible = False
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel[3]
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 983
|
||||
Height = 0
|
||||
Top = 6
|
||||
Width = 0
|
||||
Anchors = [akTop, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Right = 8
|
||||
BevelOuter = bvNone
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
||||
|
@ -1,4 +1,4 @@
|
||||
// File for testing: "strkkes.tab"
|
||||
// File for testing: "strikes.tab"
|
||||
// - original file not found, but could be reconstructed from graphs.
|
||||
// --> there is no EXACT agreement of numbers with the pdf file "autocorrelation.pdf".
|
||||
|
||||
@ -9,29 +9,25 @@ unit AutoCorUnit;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls, Buttons,
|
||||
MainUnit, FunctionsLib, OutputUnit, Globals, GraphLib, DataProcs, MatrixLib,
|
||||
PointsUnit, DifferenceUnit,
|
||||
ContextHelpUnit;
|
||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
|
||||
Buttons, ComCtrls, MainUnit, FunctionsLib, Globals, GraphLib, DataProcs,
|
||||
MatrixLib, PointsUnit, DifferenceUnit, ReportFrameUnit,
|
||||
BasicStatsReportAndChartFormUnit;
|
||||
|
||||
type
|
||||
|
||||
{ TAutoCorrForm }
|
||||
|
||||
TAutoCorrForm = class(TForm)
|
||||
TAutoCorrForm = class(TBasicStatsReportAndChartForm)
|
||||
AlphaEdit: TEdit;
|
||||
ButtonBevel: TBevel;
|
||||
Bevel2: TBevel;
|
||||
HelpBtn: TButton;
|
||||
Panel1: TPanel;
|
||||
Panel2: TPanel;
|
||||
ResetBtn: TButton;
|
||||
ComputeBtn: TButton;
|
||||
CloseBtn: TButton;
|
||||
PlotChk: TCheckBox;
|
||||
StatsChk: TCheckBox;
|
||||
RMatChk: TCheckBox;
|
||||
PartialsChk: TCheckBox;
|
||||
PartialsPage: TTabSheet;
|
||||
CorrelationMatrixPage: TTabSheet;
|
||||
YuleWalkerPage: TTabSheet;
|
||||
YuleWalkerChk: TCheckBox;
|
||||
ResidChk: TCheckBox;
|
||||
GroupBox5: TGroupBox;
|
||||
@ -66,34 +62,32 @@ type
|
||||
OnlyCasesBtn: TRadioButton;
|
||||
RowBtn: TRadioButton;
|
||||
procedure ColBtnClick(Sender: TObject);
|
||||
procedure ComputeBtnClick(Sender: TObject);
|
||||
procedure FormActivate(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure HelpBtnClick(Sender: TObject);
|
||||
procedure InBtnClick(Sender: TObject);
|
||||
procedure MRegSmoothChkChange(Sender: TObject);
|
||||
procedure OutBtnClick(Sender: TObject);
|
||||
procedure ResetBtnClick(Sender: TObject);
|
||||
procedure CloseBtnClick(Sender: TObject);
|
||||
procedure RowBtnClick(Sender: TObject);
|
||||
procedure VarListDblClick(Sender: TObject);
|
||||
procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean);
|
||||
|
||||
private
|
||||
{ private declarations }
|
||||
FAutoSized: Boolean;
|
||||
procedure UpdateBtnStates;
|
||||
FCreated: Boolean;
|
||||
FStatsReportFrame: TReportFrame;
|
||||
FCorrelationMatrixReportFrame: TReportFrame;
|
||||
FPartialsReportFrame: TReportFrame;
|
||||
FYuleWalkerReportFrame: TReportFrame;
|
||||
|
||||
private
|
||||
FExpSmoothAlpha: Double;
|
||||
FMovAvgRawWeights: DblDyneVec;
|
||||
FMovAvgOrder: Integer;
|
||||
FPolyOrder: Integer;
|
||||
procedure AutoPlot(const ACorrs, APartialCorrs: DblDyneVec;
|
||||
AUpperLimit, ALowerLimit: Double);
|
||||
function CalcMean(const pts: DblDyneVec; NoPts: Integer): Double;
|
||||
procedure ExponentialSmooth(var Pts: DblDyneVec; NoPts: Integer);
|
||||
procedure Four1(var data: DblDyneVec; nn: LongWord; isign: integer);
|
||||
procedure Fourier(var data: DblDyneVec; n, npts: integer);
|
||||
procedure FourierSmooth(var Pts: DblDyneVec; NoPts: Integer);
|
||||
procedure GetPts(var pts: DblDyneVec; var NoPts: Integer; DepVar: Integer);
|
||||
procedure GetPts(var Pts: DblDyneVec; var ANumPts: Integer; DepVar: Integer);
|
||||
procedure MovingAverage(var Pts: DblDyneVec; NoPts: Integer);
|
||||
procedure PlotDifferencesForLag(var Pts: DblDyneVec; NoPts: Integer);
|
||||
procedure PolyFit(const pts: DblDyneVec; var avg: DblDyneVec; NoPts, Order: integer);
|
||||
@ -101,8 +95,15 @@ type
|
||||
procedure RealFT(var data: DblDyneVec; n: LongWord; isign: integer);
|
||||
procedure RemoveMeans(var Pts: DblDyneVec; NoPts: Integer; AMean: Double);
|
||||
|
||||
protected
|
||||
procedure AdjustConstraints; override;
|
||||
procedure Compute; override;
|
||||
procedure UpdateBtnStates; override;
|
||||
function Validate(out AMsg: String; out AControl: TWinControl): Boolean; override;
|
||||
|
||||
public
|
||||
{ public declarations }
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
procedure Reset; override;
|
||||
end;
|
||||
|
||||
var
|
||||
@ -114,21 +115,118 @@ implementation
|
||||
|
||||
uses
|
||||
Math,
|
||||
MathUnit, MoveAvgUnit, AutoPlotUnit, PolynomialUnit, ExpSmoothUnit, FFTUnit;
|
||||
TALegend,
|
||||
GridProcs, MathUnit, MatrixUnit, ChartFrameUnit,
|
||||
MoveAvgUnit, AutoPlotUnit, PolynomialUnit, ExpSmoothUnit, FFTUnit;
|
||||
|
||||
{ TAutoCorrForm }
|
||||
|
||||
procedure TAutoCorrForm.ResetBtnClick(Sender: TObject);
|
||||
constructor TAutoCorrForm.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
|
||||
FStatsReportFrame := FReportFrame;
|
||||
|
||||
FCorrelationMatrixReportFrame := TReportFrame.Create(self);
|
||||
FCorrelationMatrixReportFrame.Parent := CorrelationMatrixPage;
|
||||
FCorrelationMatrixReportFrame.Align := alClient;
|
||||
|
||||
FPartialsReportFrame := TReportFrame.Create(self);
|
||||
FPartialsReportFrame.Parent := PartialsPage;
|
||||
FPartialsReportFrame.Align := alClient;
|
||||
|
||||
FYuleWalkerReportFrame := TReportFrame.Create(self);
|
||||
FYuleWalkerReportFrame.Parent := YuleWalkerPage;
|
||||
FYuleWalkerReportFrame.Align := alClient;
|
||||
|
||||
FCreated := true;
|
||||
Reset;
|
||||
end;
|
||||
|
||||
|
||||
procedure TAutoCorrForm.AdjustConstraints;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
ParamsPanel.Constraints.MinWidth := MaxValue([
|
||||
GroupBox2.Left + GroupBox2.Width,
|
||||
4*CloseBtn.Width + 3*CloseBtn.BorderSpacing.Left{,
|
||||
GroupBox5.Width + GroupBox4.BorderSpacing.Left + GroupBox4.Width}
|
||||
]);
|
||||
ParamsPanel.Constraints.MinHeight := GroupBox3.Top + GroupBox3.Height +
|
||||
VarList.BorderSpacing.Bottom + GroupBox4.Height +
|
||||
ButtonBevel.Height + CloseBtn.BorderSpacing.Top + CloseBtn.Height;
|
||||
end;
|
||||
|
||||
|
||||
procedure TAutoCorrForm.AutoPlot(const ACorrs, APartialCorrs: DblDyneVec;
|
||||
AUpperLimit, ALowerLimit: Double);
|
||||
var
|
||||
x: Array of Double = nil;
|
||||
i: Integer;
|
||||
begin
|
||||
FChartFrame.Clear;
|
||||
|
||||
i := Length(ACorrs);
|
||||
i := Length(APartialCorrs);
|
||||
|
||||
SetLength(x, Length(ACorrs));
|
||||
for i := 0 to Length(ACorrs)-1 do x[i] := i;
|
||||
|
||||
FChartFrame.SetTitle('Autocorrelations Analysis for ' + DepVarEdit.Text);
|
||||
FChartFrame.SetXTitle('Lag value');
|
||||
FChartFrame.PlotXY(ptLinesAndSymbols, x, ACorrs, nil, nil, 'Correlations', clRed);
|
||||
FChartFrame.PlotXY(ptLinesAndSymbols, x, APartialCorrs, nil, nil, 'Partials', clBlue);
|
||||
FChartFrame.HorLine(AUpperLimit, clGreen, psDash, '95% C.I.');
|
||||
FChartFrame.HorLine(ALowerLimit, clGreen, psDash, '');
|
||||
FChartFrame.HorLine(0, clBlack, psSolid, '');
|
||||
{
|
||||
FChartFrame.Chart.Extent.YMax := 1.0;
|
||||
FChartFrame.Chart.Extent.YMin := -1.0;
|
||||
FChartFrame.Chart.Extent.UseYMin := true;
|
||||
FChartFrame.Chart.Extent.UseYMax := true;
|
||||
}
|
||||
FChartFrame.Chart.Legend.Alignment := laBottomCenter;
|
||||
FChartFrame.Chart.Legend.ColumnCount := 3;
|
||||
end;
|
||||
|
||||
|
||||
procedure TAutoCorrForm.Reset;
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if not FCreated then
|
||||
exit;
|
||||
|
||||
ReportPage.Caption := 'Reports';
|
||||
ChartPage.TabVisible := false;
|
||||
CorrelationMatrixPage.TabVisible := false;
|
||||
PartialsPage.TabVisible := false;
|
||||
YuleWalkerPage.TabVisible := false;
|
||||
FCorrelationMatrixReportFrame.Clear;
|
||||
FPartialsReportFrame.Clear;
|
||||
FYuleWalkerReportFrame.Clear;
|
||||
|
||||
VarList.Clear;
|
||||
if ColBtn.Checked then
|
||||
for i := 1 to OS3MainFrm.DataGrid.ColCount - 1 do
|
||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0])
|
||||
else
|
||||
for i := 1 to NoCases do
|
||||
begin
|
||||
if IsFiltered(OS3MainFrm.DataGrid, i) then continue;
|
||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[0,i]);
|
||||
end;
|
||||
|
||||
DepVarEdit.Text := '';
|
||||
MaxLagEdit.Text := '30';
|
||||
|
||||
StatsChk.Checked := false;
|
||||
RmatChk.Checked := false;
|
||||
PartialsChk.Checked := false;
|
||||
PlotChk.Checked := true;
|
||||
PlotChk.Checked := false;
|
||||
ResidChk.Checked := false;
|
||||
DifferenceChk.Checked := false;
|
||||
PolyChk.Checked := false;
|
||||
@ -137,20 +235,13 @@ begin
|
||||
ExpSmoothChk.Checked := false;
|
||||
FourierSmoothChk.Checked := false;
|
||||
YuleWalkerChk.Checked := false;
|
||||
ResidChk.Enabled := MRegSmoothChk.Checked;
|
||||
|
||||
FromCaseEdit.Text := '';
|
||||
ToCaseEdit.Text := '';
|
||||
AllCasesBtn.Checked := true;
|
||||
AlphaEdit.Text := FormatFloat('0.00', DEFAULT_ALPHA_LEVEL);
|
||||
ProjPtsEdit.Text := '';
|
||||
if ColBtn.Checked then
|
||||
for i := 1 to OS3MainFrm.DataGrid.ColCount - 1 do
|
||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0])
|
||||
else
|
||||
for i := 1 to NoCases do
|
||||
begin
|
||||
if IsFiltered(i) then continue;
|
||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[0,i]);
|
||||
end;
|
||||
|
||||
FMovAvgOrder := 1;
|
||||
FMovAvgRawWeights := nil;
|
||||
@ -160,10 +251,6 @@ begin
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
procedure TAutoCorrForm.CloseBtnClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TAutoCorrForm.RowBtnClick(Sender: TObject);
|
||||
var
|
||||
@ -172,220 +259,130 @@ begin
|
||||
VarList.Clear;
|
||||
for i := 1 to NoCases do
|
||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[0,i]);
|
||||
DepVarEdit.Clear;
|
||||
GroupBox2.Caption := 'Include Columns:';
|
||||
AllCasesBtn.Caption := 'All Variables';
|
||||
OnlyCasesBtn.Caption := 'Only Columns From:';
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
procedure TAutoCorrForm.FormActivate(Sender: TObject);
|
||||
var
|
||||
w: Integer;
|
||||
begin
|
||||
if FAutoSized then
|
||||
exit;
|
||||
|
||||
w := MaxValue([HelpBtn.Width, ResetBtn.Width, ComputeBtn.Width, CloseBtn.Width]);
|
||||
HelpBtn.Constraints.MinWidth := w;
|
||||
ResetBtn.Constraints.MinWidth := w;
|
||||
ComputeBtn.Constraints.MinWidth := w;
|
||||
CloseBtn.Constraints.MinWidth := w;
|
||||
|
||||
Panel1.Constraints.MinWidth := GroupBox2.Left + GroupBox2.Width - Panel1.Left;
|
||||
Panel1.Constraints.MinHeight := Panel2.Top + Panel2.Height - Panel1.Top;
|
||||
|
||||
Constraints.MinHeight := Height;
|
||||
Constraints.MinWidth := Width;
|
||||
Constraints.MaxWidth := Width;
|
||||
|
||||
FAutoSized := true;
|
||||
end;
|
||||
|
||||
procedure TAutoCorrForm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
Assert(OS3MainFrm <> nil);
|
||||
if PointsFrm = nil then Application.CreateForm(TPointsFrm, PointsFrm);
|
||||
end;
|
||||
|
||||
procedure TAutoCorrForm.FormShow(Sender: TObject);
|
||||
begin
|
||||
ResetBtnClick(nil);
|
||||
end;
|
||||
|
||||
procedure TAutoCorrForm.HelpBtnClick(Sender: TObject);
|
||||
begin
|
||||
if ContextHelpForm = nil then
|
||||
Application.CreateForm(TContextHelpForm, ContextHelpForm);
|
||||
ContextHelpForm.HelpMessage((Sender as TButton).Tag);
|
||||
end;
|
||||
|
||||
procedure TAutoCorrForm.ComputeBtnClick(Sender: TObject);
|
||||
procedure TAutoCorrForm.Compute;
|
||||
var
|
||||
X, Y, count, covzero, mean: double;
|
||||
uplimit, lowlimit, varresid, StdErr, lAlpha: double;
|
||||
NoPts, DepVar, maxlag, lag, noproj: integer;
|
||||
uplimit, lowlimit, varresid, StdErr: double;
|
||||
DepVar, maxlag, lag, noproj: integer;
|
||||
i, j, k, ncors, npoints: integer;
|
||||
Means, StdDevs, PartCors, residual, betas, rxy, pts, avg: DblDyneVec;
|
||||
correlations, a: DblDyneMat;
|
||||
RowLabels, ColLabels: StrDyneVec;
|
||||
noPts: Integer = 0;
|
||||
// Means: DblDyneVec = nil;
|
||||
// StdDevs: DblDyneVec = nil;
|
||||
PartCors: DblDyneVec = nil;
|
||||
residual: DblDyneVec = nil;
|
||||
betas: DblDyneVec = nil;
|
||||
rxy: DblDyneVec = nil;
|
||||
pts: DblDyneVec = nil;
|
||||
avg: DblDyneVec = nil;
|
||||
correlations: DblDyneMat = nil;
|
||||
a: DblDyneMat = nil;
|
||||
RowLabels: StrDyneVec = nil;
|
||||
ColLabels: StrDyneVec = nil;
|
||||
ColNoSelected: IntDyneVec = nil;
|
||||
Title: string;
|
||||
r, vx, vy, sx, sy, mx, my, UCL, LCL, Yhat, Constant: double;
|
||||
ColNoSelected: IntDyneVec;
|
||||
NoSelected: integer;
|
||||
zconf, samptrans: double;
|
||||
confidence: double;
|
||||
lReport: TStrings;
|
||||
begin
|
||||
SetLength(ColNoSelected, NoVariables);
|
||||
NoSelected := 1;
|
||||
SetLength(ColNoSelected, NoSelected);
|
||||
|
||||
if ColBtn.Checked then
|
||||
begin
|
||||
// get column of the selected variable
|
||||
DepVar := 0;
|
||||
for i := 1 to NoVariables do
|
||||
if (OS3MainFrm.DataGrid.Cells[i,0] = DepVarEdit.Text) then DepVar := i;
|
||||
if (DepVar = 0)then
|
||||
// Get column of the selected variable
|
||||
DepVar := GetVariableIndex(OS3MainFrm.DataGrid, DepVarEdit.Text);
|
||||
if (DepVar = -1)then
|
||||
begin
|
||||
MessageDlg('No variable selected to analyze.', mtError, [mbOK], 0);
|
||||
exit;
|
||||
end;
|
||||
ColNoSelected[0] := DepVar;
|
||||
NoSelected := 1;
|
||||
|
||||
// get no. of valid points
|
||||
NoPts := 0;
|
||||
for i := 1 to NoCases do
|
||||
if ValidValue(i,DepVar) then NoPts := NoPts + 1;
|
||||
end else
|
||||
begin // get row of the selected case
|
||||
DepVar := 0;
|
||||
end
|
||||
else
|
||||
begin
|
||||
// Get row of the selected case
|
||||
DepVar := -1;
|
||||
for i := 1 to NoCases do
|
||||
begin
|
||||
if not GoodRecord(i, NoSelected, ColNoSelected) then continue;
|
||||
// if not GoodRecord(OS3MainFrm.DataGrid, i, ColNoSelected) then continue;
|
||||
if (OS3MainFrm.DataGrid.Cells[0,i] = DepVarEdit.Text) then DepVar := i;
|
||||
end;
|
||||
if (DepVar = 0)then
|
||||
if (DepVar = -1)then
|
||||
begin
|
||||
MessageDlg('No variable selected to analyze.', mtError,[mbOK], 0);
|
||||
exit;
|
||||
end;
|
||||
ColNoSelected[0] := DepVar;
|
||||
NoSelected := 1;
|
||||
NoPts := NoVariables;
|
||||
end;
|
||||
ColNoSelected[0] := DepVar;
|
||||
|
||||
// Get the alpha level and the maximum lag values
|
||||
if AlphaEdit.Text = '' then
|
||||
begin
|
||||
AlphaEdit.Setfocus;
|
||||
MessageDlg('Alpha level is not specified.', mtError, [mbOK], 0);
|
||||
exit;
|
||||
end;
|
||||
if TryStrToFloat(AlphaEdit.Text, lAlpha) and (lAlpha > 0) and (lAlpha < 1) then
|
||||
lAlpha := 1.0 - lAlpha
|
||||
if ProjectChk.Checked then
|
||||
noProj := StrToInt(ProjPtsEdit.Text)
|
||||
else
|
||||
begin
|
||||
AlphaEdit.SetFocus;
|
||||
MessageDlg('Alpha level must be a valid number between 0 and 1.', mtError, [mbOK], 0);
|
||||
exit;
|
||||
end;
|
||||
noProj := 0;
|
||||
|
||||
if MaxLagEdit.Text = '' then
|
||||
// Get points to analyze
|
||||
GetPts(pts, noPts, DepVar);
|
||||
if noPts = 0 then
|
||||
begin
|
||||
MaxLagEdit.SetFocus;
|
||||
MessageDlg('Input required.', mtError, [mbOK], 0);
|
||||
MessageDlg('No data points found.', mtError, [mbOk], 0);
|
||||
exit;
|
||||
end;
|
||||
if TryStrToInt(MaxLagEdit.Text, maxlag) then
|
||||
begin
|
||||
if maxlag > NoPts div 2 then
|
||||
maxlag := NoPts div 2;
|
||||
if StrToInt(MaxLagEdit.Text) > maxlag then
|
||||
MaxLagEdit.Text := IntToStr(maxlag);
|
||||
nPoints := maxlag + 2;
|
||||
end else
|
||||
begin
|
||||
MaxLagEdit.SetFocus;
|
||||
MessageDlg('Valid number required.', mtError, [mbOK], 0);
|
||||
exit;
|
||||
end;
|
||||
{
|
||||
maxlag := StrToInt(MaxLagEdit.Text);
|
||||
count := noPts;
|
||||
|
||||
SetLength(pts, noPts+noproj+10); // why +10?
|
||||
SetLength(avg, noPts+noproj+10);
|
||||
SetLength(residual, noPts+noproj+10);
|
||||
|
||||
// Get the maximum lag value
|
||||
maxLag := StrToInt(MaxLagEdit.Text);
|
||||
if maxlag > NoPts div 2 then
|
||||
maxlag := NoPts div 2;
|
||||
if StrToInt(MaxLagEdit.Text) > maxlag then
|
||||
MaxLagEdit.Text := IntToStr(maxlag);
|
||||
npoints := maxlag + 2; }
|
||||
nPoints := maxlag + 2;
|
||||
|
||||
noProj := 0;
|
||||
if ProjectChk.Checked then
|
||||
begin
|
||||
if ProjPtsEdit.Text = '' then
|
||||
begin
|
||||
ProjPtsEdit.SetFocus;
|
||||
MessageDlg('Projection points not specified', mtError, [mbOK], 0);
|
||||
exit;
|
||||
end;
|
||||
if not TryStrToInt(ProjPtsEdit.Text, noProj) or (noProj < 0) then
|
||||
begin
|
||||
ProjPtsEdit.SetFocus;
|
||||
MessageDlg('Valid positive number required.', mtError, [mbOK], 0);
|
||||
exit;
|
||||
end;
|
||||
noproj := StrToInt(ProjPtsEdit.Text)
|
||||
end;
|
||||
|
||||
// allocate space for covariance and correlation matrices, etc.
|
||||
SetLength(correlations, npoints+1, npoints+1);
|
||||
SetLength(Means, npoints);
|
||||
SetLength(StdDevs, npoints);
|
||||
SetLength(RowLabels, npoints);
|
||||
SetLength(ColLabels, npoints);
|
||||
// Allocate space for covariance and correlation matrices, etc.
|
||||
SetLength(correlations, nPoints+1, nPoints+1);
|
||||
// SetLength(Means, npoints);
|
||||
// SetLength(StdDevs, npoints);
|
||||
SetLength(PartCors, npoints);
|
||||
SetLength(a, npoints, npoints);
|
||||
SetLength(betas, npoints);
|
||||
SetLength(rxy, npoints);
|
||||
SetLength(pts, NoPts+noproj+10);
|
||||
SetLength(avg, NoPts+noproj+10);
|
||||
SetLength(residual, NoPts+noproj+10);
|
||||
|
||||
// Initialize arrays
|
||||
SetLength(RowLabels, npoints);
|
||||
SetLength(ColLabels, npoints);
|
||||
for i := 0 to npoints-1 do
|
||||
begin
|
||||
RowLabels[i] := 'Lag ' + IntToStr(i);
|
||||
ColLabels[i] := RowLabels[i];
|
||||
end;
|
||||
|
||||
lReport := TStringList.Create;
|
||||
try
|
||||
// Initialize arrays
|
||||
for i := 0 to npoints-1 do
|
||||
begin
|
||||
for j := 0 to npoints - 1 do
|
||||
begin
|
||||
correlations[i,j] := 0.0;
|
||||
a[i,j] := 0.0;
|
||||
end;
|
||||
Means[i] := 0.0;
|
||||
StdDevs[i] := 0.0;
|
||||
RowLabels[i] := 'Lag ' + IntToStr(i);
|
||||
ColLabels[i] := RowLabels[i];
|
||||
PartCors[i] := 0.0;
|
||||
betas[i] := 0.0;
|
||||
end;
|
||||
|
||||
uplimit := 0.0;
|
||||
lowlimit := 0.0;
|
||||
covzero := 0.0;
|
||||
|
||||
// Get points to analyze
|
||||
GetPts(pts, noPts, DepVar);
|
||||
if noPts = 0 then
|
||||
begin
|
||||
MessageDlg('No data points found.', mtError, [mbOk], 0);
|
||||
exit;
|
||||
end;
|
||||
count := NoPts;
|
||||
|
||||
// Calculate mean of all values
|
||||
mean := CalcMean(pts, NoPts);
|
||||
mean := CalcMean(pts, noPts);
|
||||
|
||||
// Remove mean from all observations if elected
|
||||
if MeanChk.Checked then
|
||||
RemoveMeans(pts, noPts, mean);
|
||||
|
||||
correlations[0,0] := 1.0;
|
||||
correlations[0, 0] := 1.0;
|
||||
|
||||
// Get differences for lag specified
|
||||
if DifferenceChk.Checked then
|
||||
@ -426,8 +423,8 @@ begin
|
||||
lReport.Add('Variance: %8.3f', [covzero]);
|
||||
lReport.Add('');
|
||||
|
||||
lReport.Add(' Lag Rxy MeanX MeanY Std.Dev.X Std.Dev.Y Cases LCL UCL ');
|
||||
lReport.Add('----- -------- -------- -------- ---------- ---------- -------- -------- --------');
|
||||
lReport.Add(' Lag Rxy MeanX MeanY Std.Dev.X Std.Dev.Y Cases LCL UCL ');
|
||||
lReport.Add('----- ------------ ------------ ------------ ------------ ------------ ------- ------------ ------------');
|
||||
end;
|
||||
|
||||
confidence := StrToFloat(AlphaEdit.Text);
|
||||
@ -490,7 +487,7 @@ begin
|
||||
LCL := 1.0;
|
||||
end;
|
||||
if StatsChk.Checked then
|
||||
lReport.Add('%4d %9.4f %9.4f %9.4f %11.4f %11.4f %9.0f %9.4f %9.4f',
|
||||
lReport.Add('%5d %12.4f %12.4f %12.4f %12.4f %12.4f %7.0f %12.4f %12.4f',
|
||||
[lag, r, mx, my, sx, sy, Count, LCL, UCL]
|
||||
);
|
||||
ncors := ncors + 1;
|
||||
@ -498,6 +495,14 @@ begin
|
||||
correlations[lag,0] := r;
|
||||
end; // next lag
|
||||
|
||||
if StatsChk.Checked then
|
||||
begin
|
||||
ReportPage.caption := 'Statistics';
|
||||
FStatsReportFrame.DisplayReport(lReport);
|
||||
lReport.Clear;
|
||||
end;
|
||||
ReportPage.TabVisible := StatsChk.Checked;
|
||||
|
||||
// build correlation matrix
|
||||
for i := 0 to maxlag do
|
||||
correlations[i,i] := 1.0;
|
||||
@ -511,19 +516,16 @@ begin
|
||||
// Print the correlation matrix if elected
|
||||
if RmatChk.Checked then
|
||||
begin
|
||||
if lReport.Count > 0 then
|
||||
begin
|
||||
lReport.Add('');
|
||||
lReport.Add(DIVIDER);
|
||||
lReport.Add('');
|
||||
end;
|
||||
Title := 'Matrix of Lagged Variable: ' + DepVarEdit.Text;
|
||||
MatPrint(correlations, maxlag+1, maxlag+1, Title, RowLabels, ColLabels, NoPts, lReport);
|
||||
FCorrelationMatrixReportFrame.DisplayReport(lReport);
|
||||
lReport.Clear;
|
||||
end;
|
||||
CorrelationMatrixPage.TabVisible := RmatChk.Checked;
|
||||
|
||||
// Calculate partial correlations
|
||||
PartCors[0] := 1.0;
|
||||
for i := 1 to maxlag do // start at lag 1
|
||||
for i := 1 to maxlag do // start at lag 1
|
||||
begin
|
||||
for j := 1 to i do
|
||||
begin
|
||||
@ -579,30 +581,38 @@ begin
|
||||
PartCors[i] := betas[i-1];
|
||||
end; // next i (lag from 1 to maxlag)
|
||||
|
||||
// print partial correlations if elected
|
||||
// Print Yule-Walker coefficients
|
||||
if YuleWalkerChk.Checked then
|
||||
begin
|
||||
FYuleWalkerReportFrame.DisplayReport(lReport);
|
||||
lReport.Clear;
|
||||
end;
|
||||
YuleWalkerPage.TabVisible := YuleWalkerChk.Checked;
|
||||
|
||||
// Print partial correlations if elected
|
||||
if PartialsChk.Checked then
|
||||
begin
|
||||
if lReport.Count > 0 then
|
||||
begin
|
||||
lReport.Add('');
|
||||
lReport.Add(DIVIDER);
|
||||
lReport.Add('');
|
||||
end;
|
||||
Title := 'Partial Correlation Coefficients';
|
||||
DynVectorPrint(PartCors, maxlag, Title, ColLabels, NoPts, lReport);
|
||||
FPartialsReportFrame.DisplayReport(lReport);
|
||||
lReport.Clear;
|
||||
end;
|
||||
|
||||
DisplayReport(lReport);
|
||||
PartialsPage.TabVisible := PartialsChk.Checked;
|
||||
|
||||
// plot correlations if elected
|
||||
uplimit := 1.96 * (1.0 / sqrt(count));
|
||||
lowlimit := -1.96 * (1.0 / sqrt(count));
|
||||
if PlotChk.Checked then
|
||||
begin
|
||||
uplimit := 1.96 * (1.0 / sqrt(count));
|
||||
lowlimit := -1.96 * (1.0 / sqrt(count));
|
||||
|
||||
SetLength(rXY, maxLag+1);
|
||||
for i := 0 to maxlag do
|
||||
rxy[i] := correlations[0, i];
|
||||
|
||||
AutoPlot(rxy, partCors, upLimit, lowLimit);
|
||||
{
|
||||
if AutoPlotFrm = nil then
|
||||
Application.CreateForm(TAutoPlotFrm, AutoPlotFrm);
|
||||
for i := 0 to maxlag do
|
||||
rxy[i] := correlations[0][i];
|
||||
AutoPlotFrm.PlotPartCors := true;
|
||||
AutoPlotFrm.PlotLimits := true;
|
||||
AutoPlotFrm.correlations := rxy;
|
||||
@ -612,7 +622,9 @@ begin
|
||||
AutoPlotFrm.npoints := maxlag+1;
|
||||
AutoPlotFrm.DepVarEdit := DepVarEdit.Text;
|
||||
AutoPlotFrm.ShowModal;
|
||||
}
|
||||
end;
|
||||
ChartPage.TabVisible := PlotChk.Checked;
|
||||
|
||||
if MRegSmoothChk.Checked then
|
||||
begin
|
||||
@ -631,6 +643,8 @@ begin
|
||||
end;
|
||||
|
||||
// plot points smoothed by autoregression
|
||||
if PointsFrm = nil then
|
||||
Application.CreateForm(TPointsFrm, PointsFrm);
|
||||
avg[0] := pts[0];
|
||||
PointsFrm.pts := pts;
|
||||
PointsFrm.avg := avg;
|
||||
@ -666,20 +680,6 @@ begin
|
||||
|
||||
finally
|
||||
lReport.Free;
|
||||
|
||||
residual := nil;
|
||||
avg := nil;
|
||||
pts := nil;
|
||||
rxy := nil;
|
||||
betas := nil;
|
||||
a := nil;
|
||||
PartCors := nil;
|
||||
ColLabels := nil;
|
||||
RowLabels := nil;
|
||||
StdDevs := nil;
|
||||
Means := nil;
|
||||
correlations := nil;
|
||||
ColNoSelected := nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -690,9 +690,11 @@ begin
|
||||
VarList.Clear;
|
||||
for i := 1 to OS3MainFrm.DataGrid.ColCount - 1 do
|
||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
|
||||
DepVarEdit.Clear;
|
||||
GroupBox2.Caption := 'Include Cases:';
|
||||
AllCasesBtn.Caption := 'All Cases';
|
||||
OnlyCasesBtn.Caption := 'Only Cases From:';
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
procedure TAutoCorrForm.InBtnClick(Sender: TObject);
|
||||
@ -708,6 +710,11 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TAutoCorrForm.MRegSmoothChkChange(Sender: TObject);
|
||||
begin
|
||||
ResidChk.Enabled := MRegSmoothChk.Checked;
|
||||
end;
|
||||
|
||||
procedure TAutoCorrForm.OutBtnClick(Sender: TObject);
|
||||
begin
|
||||
if DepVarEdit.Text <> '' then
|
||||
@ -1015,17 +1022,22 @@ end;
|
||||
|
||||
procedure TAutoCorrForm.UpdateBtnStates;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if not FCreated then
|
||||
exit;
|
||||
|
||||
FCorrelationMatrixReportFrame.UpdateBtnStates;
|
||||
FPartialsReportFrame.UpdateBtnStates;
|
||||
FYuleWalkerReportFrame.UpdateBtnStates;
|
||||
|
||||
InBtn.Enabled := (VarList.ItemIndex > -1) and (DepVarEdit.Text = '');
|
||||
OutBtn.Enabled := (DepVarEdit.Text <> '');
|
||||
end;
|
||||
|
||||
procedure TAutoCorrForm.VarListSelectionChange(Sender: TObject; User: boolean);
|
||||
begin
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
|
||||
{ Routines called from ComputeBtnClick }
|
||||
{ Routines called from Compute }
|
||||
|
||||
function TAutoCorrForm.CalcMean(const Pts: DblDyneVec; NoPts: Integer): Double;
|
||||
var
|
||||
@ -1041,8 +1053,8 @@ procedure TAutoCorrForm.ExponentialSmooth(var Pts: DblDyneVec; NoPts: Integer);
|
||||
var
|
||||
F: TExpSmoothFrm;
|
||||
noProj: Integer;
|
||||
avg: DblDyneVec;
|
||||
residual: DblDyneVec;
|
||||
avg: DblDyneVec = nil;
|
||||
residual: DblDyneVec = nil;
|
||||
i: Integer;
|
||||
varRes: Double;
|
||||
stdErr: Double;
|
||||
@ -1118,6 +1130,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TAutoCorrForm.FourierSmooth(var Pts: DblDyneVec; NoPts: Integer);
|
||||
var
|
||||
F: TFFTFrm;
|
||||
@ -1195,59 +1208,67 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TAutoCorrForm.GetPts(var Pts: DblDyneVec; var NoPts: Integer;
|
||||
Depvar: Integer);
|
||||
procedure TAutoCorrForm.GetPts(var Pts: DblDyneVec; var ANumPts: Integer;
|
||||
DepVar: Integer);
|
||||
var
|
||||
i: Integer;
|
||||
i, i1, i2: Integer;
|
||||
begin
|
||||
ANumPts := 0;
|
||||
if ColBtn.Checked then
|
||||
begin
|
||||
// Column button selected
|
||||
if AllCasesBtn.Checked then
|
||||
begin
|
||||
for i := 1 to NoPts do
|
||||
if ValidValue(i, DepVar) then
|
||||
Pts[i-1] := StrToFloat(OS3MainFrm.DataGrid.Cells[DepVar, i])
|
||||
else
|
||||
Pts[i-1] := NaN; // wp: added thid for defined crash because of undefined values
|
||||
i1 := 1;
|
||||
i2 := NoCases;
|
||||
end else
|
||||
begin
|
||||
NoPts := 0;
|
||||
for i := StrToInt(FromCaseEdit.Text) to StrToInt(ToCaseEdit.Text) do
|
||||
begin
|
||||
if ValidValue(i, DepVar) then continue;
|
||||
Pts[NoPts] := StrToFloat(OS3MainFrm.DataGrid.Cells[DepVar, i]);
|
||||
NoPts := NoPts + 1;
|
||||
end;
|
||||
i1 := StrToInt(FromCaseEdit.Text);
|
||||
i2 := StrToint(ToCaseEdit.Text);
|
||||
end;
|
||||
if i1 > i2 then Exchange(i1, i2);
|
||||
if i1 < 1 then i1 := 1;
|
||||
if i2 > NoCases then i2 := NoCases;
|
||||
SetLength(Pts, i2-i1+1);
|
||||
for i := i1 to i2 do
|
||||
begin
|
||||
if not ValidValue(OS3MainFrm.DataGrid, i, DepVar) then continue;
|
||||
Pts[ANumPts] := StrToFloat(OS3MainFrm.DataGrid.Cells[DepVar, i]);
|
||||
inc(ANumPts);
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
// row button selected
|
||||
// Row button selected
|
||||
if AllCasesBtn.Checked then
|
||||
begin
|
||||
for i := 1 to NoPts do
|
||||
if ValidValue(DepVar, i) then
|
||||
Pts[i-1] := StrToFloat(OS3MainFrm.DataGrid.Cells[i, DepVar])
|
||||
else
|
||||
Pts[i-1] := NaN; // wp: added thid for defined crash because of undefined values
|
||||
i1 := 1;
|
||||
i2 := NoVariables;
|
||||
end else
|
||||
begin
|
||||
NoPts := 0;
|
||||
for i := StrToInt(FromCaseEdit.Text) to StrToInt(ToCaseEdit.Text) do
|
||||
begin
|
||||
if not ValidValue(DepVar,i) then continue;
|
||||
pts[NoPts] := StrToFloat(OS3MainFrm.DataGrid.Cells[i,DepVar]);
|
||||
NoPts := NoPts + 1;
|
||||
end;
|
||||
i1 := StrToInt(FromCaseEdit.Text);
|
||||
i2 := StrToInt(ToCaseEdit.Text);
|
||||
end;
|
||||
if i1 > i2 then Exchange(i1, i2);
|
||||
if i1 < 1 then i1 := 1;
|
||||
if i2 > NoVariables then i2 := NoVariables;
|
||||
SetLength(Pts, i2 - i1 + 1);
|
||||
for i := i1 to i2 do
|
||||
begin
|
||||
if not ValidValue(OS3MainFrm.DataGrid, DepVar, i) then Continue;
|
||||
Pts[ANumPts] := StrToFloat(OS3MainFrm.DataGrid.Cells[i, DepVar]);
|
||||
inc(ANumPts);
|
||||
end;
|
||||
end;
|
||||
SetLength(Pts, ANumPts);
|
||||
end;
|
||||
|
||||
|
||||
procedure TAutoCorrForm.MovingAverage(var Pts: DblDyneVec; NoPts: Integer);
|
||||
var
|
||||
F: TMoveAvgFrm;
|
||||
i, j: Integer;
|
||||
avg: DblDyneVec;
|
||||
residual: DblDyneVec;
|
||||
avg: DblDyneVec = nil;
|
||||
residual: DblDyneVec = nil;
|
||||
noProj: Integer;
|
||||
varRes: Double;
|
||||
stdErr: Double;
|
||||
@ -1351,8 +1372,8 @@ procedure TAutoCorrForm.PlotDifferencesForLag(var Pts: DblDyneVec; NoPts: Intege
|
||||
var
|
||||
F: TDifferenceFrm;
|
||||
lag: Integer;
|
||||
avg: DblDyneVec;
|
||||
residual: DblDyneVec;
|
||||
avg: DblDyneVec = nil;
|
||||
residual: DblDyneVec = nil;
|
||||
varRes: Double;
|
||||
stdErr: Double;
|
||||
i, j: Integer;
|
||||
@ -1421,8 +1442,8 @@ var
|
||||
F: TPolynomialFrm;
|
||||
noProj: Integer;
|
||||
i: Integer;
|
||||
avg: DblDyneVec;
|
||||
residual: DblDyneVec;
|
||||
avg: DblDyneVec = nil;
|
||||
residual: DblDyneVec = nil;
|
||||
varRes: Double;
|
||||
stdErr: Double;
|
||||
begin
|
||||
@ -1504,5 +1525,88 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
function TAutoCorrForm.Validate(out AMsg: String; out AControl: TWinControl): Boolean;
|
||||
var
|
||||
x: Double;
|
||||
n: Integer;
|
||||
begin
|
||||
Result := false;
|
||||
|
||||
if DepVarEdit.Text = '' then
|
||||
begin
|
||||
AMsg := 'No variable selected.';
|
||||
AControl := VarList;
|
||||
exit;
|
||||
end;
|
||||
|
||||
if AlphaEdit.Text = '' then
|
||||
begin
|
||||
AMsg := 'Alpha level is not specified.';
|
||||
AControl := AlphaEdit;
|
||||
exit;
|
||||
end;
|
||||
if not TryStrToFloat(AlphaEdit.Text, x) or (x <= 0) or (x >= 1) then
|
||||
begin
|
||||
AControl := AlphaEdit;
|
||||
AMsg := 'Alpha level must be a valid number between 0 and 1.';
|
||||
exit;
|
||||
end;
|
||||
|
||||
if MaxLagEdit.Text = '' then
|
||||
begin
|
||||
AControl := MaxLagEdit;
|
||||
AMsg := 'Input required.';
|
||||
exit;
|
||||
end;
|
||||
if not TryStrToInt(MaxLagEdit.Text, n) or (n < 0) then
|
||||
begin
|
||||
AControl := MaxLagEdit;
|
||||
AMsg := 'Valid positive integer required.';
|
||||
exit;
|
||||
end;
|
||||
|
||||
if ProjectChk.Checked then
|
||||
begin
|
||||
if ProjPtsEdit.Text = '' then
|
||||
begin
|
||||
AControl := ProjPtsEdit;
|
||||
AMsg := 'Projection points not specified';
|
||||
exit;
|
||||
end;
|
||||
if not TryStrToInt(ProjPtsEdit.Text, n) or (n < 0) then
|
||||
begin
|
||||
AControl := ProjPtsEdit;
|
||||
AMsg := 'Valid positive integer number required.';
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
Result := true;
|
||||
end;
|
||||
|
||||
|
||||
procedure TAutoCorrForm.VarListDblClick(Sender: TObject);
|
||||
var
|
||||
index: Integer;
|
||||
begin
|
||||
index := VarList.ItemIndex;
|
||||
if index > -1 then
|
||||
begin
|
||||
if DepVarEdit.Text = '' then
|
||||
begin
|
||||
DepVarEdit.Text := VarList.Items[index];
|
||||
VarList.Items.Delete(index);
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TAutoCorrForm.VarListSelectionChange(Sender: TObject; User: boolean);
|
||||
begin
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
||||
|
Reference in New Issue
Block a user