PureBytes Links
Trading Reference Links
|
Thanks ... I'll check that out
This may help you with setting up your beta estimation workbook either as a
stand alone app or as an integrated module. I use it as an integrated module
... the data calls can access any sheet or workbook.
"... There are four possible optimization criteria: (1) sum of squared
errors, (2) weighted sum of squared errors, (3) sum of absolute errors, and
(4) minimax (minimize the maximum absolute error). The Solver performs the
appropriate optimization, based on the criterion specified. ..."
Here's the part of the code that you need. It goes "behind" the criteria
selection user form.
Best regards
Walter
==================
' Capture the method to use for optimization.
If SSEOpt Then
Method = "SSE"
' If weighted sum of squares is chosen, make sure the weight box is not
' blank and has a numerical value, which must be from 0 to 1.
ElseIf WSSEOpt Then
If Not IsNumeric(WtBox) Or WtBox = "" Then
MsgBox "Enter a numerical weight between 0 and 1.",
vbInformation, "Invalid weight"
WtBox.SetFocus
Exit Sub
ElseIf WtBox < 0 Or WtBox > 1 Then
MsgBox "Enter a weight between 0 and 1.", vbInformation,
"Invalid weight"
WtBox.SetFocus
Exit Sub
End If
Method = "WSSE"
Weight = WtBox
ElseIf SAEOpt Then
Method = "SAE"
Else
Method = "MaxAE"
End If
' Unload the userform.
Unload Me
End Sub
|