diff options
author | avinashlalotra | 2025-04-26 20:09:12 +0530 |
---|---|---|
committer | avinashlalotra | 2025-04-26 20:09:12 +0530 |
commit | ea7dcdba3b83696b97cc431ee050b58f9a0f3507 (patch) | |
tree | 49ea8ba898b88535c261546f4e3accbdf4c83bdf /macros/ols.sci | |
parent | 725d9ee2ddb254f57a896bb47e0e727759eb5901 (diff) | |
download | FOSSEE-Signal-Processing-Toolbox-ea7dcdba3b83696b97cc431ee050b58f9a0f3507.tar.gz FOSSEE-Signal-Processing-Toolbox-ea7dcdba3b83696b97cc431ee050b58f9a0f3507.tar.bz2 FOSSEE-Signal-Processing-Toolbox-ea7dcdba3b83696b97cc431ee050b58f9a0f3507.zip |
formated source documentation pattern for generating docs
Diffstat (limited to 'macros/ols.sci')
-rw-r--r-- | macros/ols.sci | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/macros/ols.sci b/macros/ols.sci index f2b0b35..e9a9148 100644 --- a/macros/ols.sci +++ b/macros/ols.sci @@ -1,22 +1,22 @@ -/* -Description: - Ordinary least squares estimation. - OLS applies to the multivariate model y = x*b + e with mean (e) = 0 and - cov (vec (e)) = kron (s, I). where y is a t by p matrix, x is a t by k matrix, b is a k by p matrix, and e is a t by p matrix. - Each row of y and x is an observation and each column a variable. - The return values beta, sigma, and r are defined as follows. -Calling Sequence: - [beta, sigma, r] = ols (y, x) -Arguments: - beta: - The OLS estimator for b. beta is calculated directly via inv (x'*x) * x' * y if the matrix x'*x is of full rank. Otherwise, beta = pinv (x) * y where pinv (x) denotes the pseudoinverse of x. - sigma - The OLS estimator for the matrix s, - sigma = (y-x*beta)'* (y-x*beta) / (t-rank(x)) - r - The matrix of OLS residuals, r = y - x*beta. -*/ + function [bt, sigma, r] = ols (y, x) +// Description: +// Ordinary least squares estimation. +// OLS applies to the multivariate model y = x*b + e with mean (e) = 0 and +// cov (vec (e)) = kron (s, I). where y is a t by p matrix, x is a t by k matrix, b is a k by p matrix, and e is a t by p matrix. +// Each row of y and x is an observation and each column a variable. +// The return values beta, sigma, and r are defined as follows. +// Calling Sequence: +// [beta, sigma, r] = ols (y, x) +// Arguments: +// beta: +// The OLS estimator for b. beta is calculated directly via inv (x'*x) * x' * y if the matrix x'*x is of full rank. Otherwise, beta = pinv (x) * y where pinv (x) denotes the pseudoinverse of x. +// sigma +// The OLS estimator for the matrix s, +// sigma = (y-x*beta)'* (y-x*beta) / (t-rank(x)) +// r +// The matrix of OLS residuals, r = y - x*beta. + function [u , p] = formatted_chol(z) //p flags whether the matrix A was positive definite and chol does not fail. A zero value of p indicates that matrix A is positive definite and R gives the factorization. Otherwise, p will have a positive value. ierr = execstr (" u = chol (z);",'errcatch' ) |