Relativistic Market Regression Excel Examination

Published:

Updated:

You can download our Excel sheet with the Relativistic Market Data and Regression measurements at our FTP site.

ftp://www.jadexcode.com/Excel/S&P-NAS-DOW-1971-02-05-to-Present-2.xlsm

If you don't want to run the Macro Enabled file, here are the two functions we added to get the job done.

 

______________________________________________________________________________________________________________

Function LineSlope(theRange As Range) As Double

    Dim n, y_sum, y_avg, xy_sum, xy_avg As Double
   
    n = theRange.Rows.Count: y_sum = 0: xy_sum = 0
   
    On Error GoTo errorexit
   
    If (n < 2) Or (theRange.Columns.Count > 1) Then
   
        LineSlope = -4.94065645841247E-324
       
    Else
   
        For a = 1 To n
       
            y_sum = y_sum + theRange.Cells(a, 1)
            xy_sum = xy_sum + a * theRange.Cells(a, 1)
           
        Next a
       
        y_avg = y_sum / n: xy_avg = xy_sum / n
       
        LineSlope = (12 * xy_avg - 6 * (n + 1) * y_avg) / ((n - 1) * (n + 1))
       
    End If
   
    Exit Function
   
errorexit:

LineSlope = -4.94065645841247E-324
   
End Function

______________________________________________________________________________________________________________

Function LineCorr(theRange As Range) As Double

    Dim n, y_sum, y_avg, yy_sum, yy_avg, xy_sum, xy_avg As Double
   
    n = theRange.Rows.Count: y_sum = 0: yy_sum = 0: xy_sum = 0
   
    On Error GoTo errorexit
   
    If (n < 2) Or (theRange.Columns.Count > 1) Then
   
        LineCorr = -4.94065645841247E-324
       
    Else
   
        For a = 1 To n
       
            y_sum = y_sum + theRange.Cells(a, 1)
            yy_sum = yy_sum + theRange.Cells(a, 1) * theRange.Cells(a, 1)
            xy_sum = xy_sum + a * theRange.Cells(a, 1)
           
        Next a
       
        y_avg = y_sum / n: yy_avg = yy_sum / n: xy_avg = xy_sum / n
       
        LineCorr = 3 * (2 * xy_avg - (n + 1) * y_avg) * (2 * xy_avg - (n + 1) * y_avg) / ((n - 1) * (n + 1) * (yy_avg - y_avg * y_avg))
   
    End If
   
    Exit Function
   
errorexit:

LineCorr = -4.94065645841247E-324
   
End Function
______________________________________________________________________________________________________________

Entry #3,245

Comments

This Blog entry currently has no comments.

Post a Comment

Please Log In

To use this feature you must be logged into your Lottery Post account.

Not a member yet?

If you don't yet have a Lottery Post account, it's simple and free to create one! Just tap the Register button and after a quick process you'll be part of our lottery community.

Register