Search
Code Directory
 ASP
 ASP.NET
 C/C++
 CFML
 CGI/PERL
 Delphi
 Development
 Flash
 HTML
 Java
 JavaScript
 Pascal
 PHP
 Python
 SQL
 Tools
 Visual Basic & VB.NET
 XML
New Code
HTMLPad 2018 15.5
WeBuilder 2018 15.5
SentiMask SDK Trial 2.0.0
Track Order For Magento 2 1.0.0
Calendar 365 For Dynamics CRM 4.0
Scimbo 1.2
Odoo Furnito Theme 1.0
.Net Assemblies/WSDL Import Utility for Delphi 6.0.4.0
Devart Excel Add-in for Zendesk 1.7
Excel Add-in for Marketo 1.7
GetOrgChart 2.5.3
AnyGantt JS Gantt Charts 8.6.0
AnyChart JS Charts and Dashboards 8.6.0
Multi Vendor Ecommerce Script & Apps 4.0
Magento 2 Inventory Management Extension 1.0
Top Code
HTMLPad 2018 15.5
MCU 8051 IDE 1.4.7
jQuery Slider Ken Burns 1.0
Extreme Injector 3.7
Azizi search engine script PHP 4.1.10
BedRock IDE 1.0
Email Grabber
Guest Book V. 2 V2
XML Products Showcase Slider 1.0
Free Pageant Contest Source Code 1.0
ActivePerl 5.8.4.810/5.6.1.638
Calendar 365 For Dynamics CRM 4.0
Gz Hotel Booking Script 2.0
Image Reconstruction Demo (GUI) 1.0
CardCheck COM DLL for Credit Card Processing 1.1
Top Rated
VisualNEO Web 2018.12.15
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
ADO.NET Provider for ExactTarget 1.0
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
Availability Booking Calendar PHP 1.0
PHP GZ Blog Script 1.1
Analytical solution for Orthogonal Linear Least Squares in two dimensions 1.0
File ID: 82877






Analytical solution for Orthogonal Linear Least Squares in two dimensions 1.0
Download Analytical solution for Orthogonal Linear Least Squares in two dimensions 1.0http://www.mathworks.comReport Error Link
License: Shareware
File Size: 10.0 KB
Downloads: 9
Submit Rating:
Analytical solution for Orthogonal Linear Least Squares in two dimensions 1.0 Description
Description: ORTHLLS2D returns the Orthogonal Linear Least Squares estimate for parameters of line a x + b y + c = 0

function f = OrthLLS2D(x, y)

Inputs x and y must be real vectors of equal size.
Output f is the real vector [a b c] where a, b and c are the estimated parameters of the linear equation.

Since a more general function called LINORTFITN has already been submitted to File Exchange (ID number: 16800) in October 2007 by Mr. F. Carr, my file is supposed to be used as a brief introduction to the analytical problem in an extremely simple case.

Orthogonal Least Squares Estimate on a plane, in the simple case of a linear equation, is in fact a problem that can be easily solved analytically with no approximation (see pdf file for detailed explanation). Notice that in the general multidimensional case, an analytical solution may not exist (although Mr. Carr's function is an efficient approximation of the solution).

% ====================================================
% EXAMPLE: HOW TO USE THE FUNCTION
% ====================================================
Build two series, given the linear relation y = mx + q + error
T = 1000; % number of points
m = -1; % slope
q = 1; % intercept
x = randn(T, 1); % random x values
u = randn(T, 1); % random error
y = m * x + q + u; % y = mx + q + error
f = OrthLLS2D(x, y); % estimate [a, b, c] for equation ax + by + c = 0
plot(x, y, '.') % scatter plot for empirical points
hold on
plot(x, [ones(T,1) x] * [-f(3); -f(1)], '*r');% plot orthogonal linear least squares
b1 = regress(y, [ones(T,1) x]); % parameters of the ordinary least squares (y as a function of x)
b2 = regress(x, [ones(T,1) y]); % parameters of the ordinary least squares (x as a function of y)
plot(x, [ones(T,1) x] * b1, '.g'); % plot ordinary least squares (y as a function of x)
plot([ones(T,1) y] * b2, y, '.c'); % plot ordinary least squares (x as a function of y)

% ====================================================

See also LINORTFIT2, LINORTFITN.

License: Shareware

Related: series, Build, Function, relation, slope, points, Error, efficient

O/S:BSD, Linux, Solaris, Mac OS X

File Size: 10.0 KB

Downloads: 9



More Similar Code

Constructs discrete least-squares rational approximations to data using the full-Newton algorithm for solving separable non-linear least-squares problems that was developed in:

Carlos F. Borges, A Full-Newton Approach to Separable Nonlinear Least Squares Problems and its Application to Discrete Least Squares Rational Approximation, Electronic Transactions on Numerical Analysis, Volume 35, pp. 57-68, 2009.



solves the linear least squares problem with nonnegative variables using the block principal pivoting algorithm in:
Portugal, Judice and Vicente, A comparison of block pivoting and interior point algorithms for linear least squares problems...



Solves the linear least squares problem with nonnegative variables using the newton's algorithm in:
Portugal, Judice and Vicente, A comparison of block pivoting and interior point algorithms for linear least squares problems with nonnegative...



Solves the linear least squares problem with nonnegative variables using the predictor-corrector algorithm in:
Portugal, Judice and Vicente, A comparison of block pivoting and interior point algorithms for linear least squares problems with...



For a system having multiple inputs x and outputs y, the partial coherence is the coherence computed between any individual input and the output when the effect of all other inputs is removed from the output by a linear least squares prediction....



2-D Contaminant Transport GUI (2DCT) is developed based on an existing analytical solution for two-dimensional transport of contaminants in a saturated soil layer. The computer program is given for pulse source and includes advective and...



Functions NELSONFUN and NELSONFIT evaluate and fit (with non-linear least-squares) the Nelson-Siegel function, a popular yield-curve approximation device.



This library implements a randomized algorithm for solving the least-squares equation x = arg min norm(A * x - b, 2) or the underdetermined system min(norm(x, 2)) s.t. Ax=b. With high probability the running this o(mn^2) for an m-by-n matrix.



The Braemar Framework is a lightweight solution for Rich Internet Applications development in Flash CS3/Actionscript 3.0. The Framework is based on Adobe's Framework called Cairngorm created by Steven Webster.



Often, measured data is comprised of N sampled values of z, evaluated at N locations (x,y). With this function, you can calculate the coefficients of the best-fit x,y polynomial using a linear least squares approximation.

You can use...

User Review for Analytical solution for Orthogonal Linear Least Squares in two dimensions
- required fields
     

Please enter text on the image