Directory of Open Source for Quantitative Finance and Trading
Username: Password: Not registered?
 
Quick Search:    (AJAX based: No need to press button)

Main : Excel : 


Category: Excel View Full Details
Download Now!Standard error for coefficients in OLS Least Sqaures Regression in VBA
Submitter: vanna Date: 2008/1/9
Description:
Std. error for OLS Least sequares is an important statistic used for data analysis.

The function OLSError in this file demonstrated calculation of standard error for the coefficients of OLS

The fucntion is :
OLSError(xMat As Variant, yArr As Variant, beta As Variant) As Variant


xMat : matrix of independent variables
yMat : array of observed variables
beta : estimated coefficeints of regression model obtained by OLS

It returns an array of std. error values.

Algorithm is:
1.Get array of residuals
ResidualsVec = yArr - xMat*beta
2. Calcualte residual sum of sqaures (RSS)
rss = ResidualsVec'*ResidualsVec
3.Calculate degrees of freedom
df = no. of observed variables - no. of parameters in xMat
4.Calculate variance of residuals
Residualsvariance = rss / df
5.Calculate std. error vector

Got a question or problem with this link? Just enter your message and click on submit. No registration is required.

Note: A copy of this message will also be emailed to the submitter of this link
Downloaded 943 times  943  File Size 1000 bytes  Supported Platforms Excel VBA  Home Page http://www.quantcode.com/
Rating: 0.00 (0 votes)
Rate this File | Modify | Delete | Report Broken File | Tell a Friend | Comments (38)

Discuss this file. Just enter your message and click on submit. No registration is required.
Similar Links:
standard error in regression : R vs. matlab (Forum)
Efficient frontier for portfolio (Software)
Applications of Least-Squares Regressions to Pricing and Hedging of Financial Derivatives (Paper)
An efficient convergent lattice algorithm for European Asian options (Paper)
USD Interest rates current and historical (Link)

Subscribe to RSS or daily email updates of latest quantitative finance code listings
Email address :
Copyright © 2011 QuantCode Inc. All rights reserved.