![]() ![]() ![]() |
|
10.1 Architecture of nonlinear regression software
10.2 Sample of iterative regression
10.4 Sample of regression with loading selection at once. Determination of 6D position of 3D object by photos
This software solves the problem of nonlinear regression using the least squares method. Nonlinear regression in statistics is the problem of fitting a model
![]()
to multidimensional x,y data, where f is a nonlinear function of x with regression parameters θ.
Nonlinear regression operates with selections. This sofware implements two methods of manipulation with selections. First method loads selection iteratively, i. e. step by step. Second one loads selection at once.
The architecture of nonlinear regression software that uses interative regression is presented on the following scheme
![]()
Let us describe components of this scheme. The iterator povides data-in selections x and y . The y is a Left part of fitting equations. The Transformation corresponds to nonlinear function f and generates Left part of fitting model. Processor coordinates all actions and corrects Regression parameters.
The architeture of software with loading selection at once is presened on the following scheme
![]()
The processor compares Calculated parameters with Selection, calculates residuals and then corrects Regression parameters. In these two schemas the Iterator, Selection and others are not concrete components. They are components those implements interfaces of Iterator, Selection etc. For example a Camera component may implement the Selection interface.
Let us exhibit an example of nonlinear regression. Suppose that we should define regression parameters
of equations
![]()
by seclection of
.
For this purpose we shall construct following scenario:
In this scenario a Query component performs a following SQL query:
=============================
SELECT f1.f1, f2.f2, x.x, y.y, z.z FROM f1, f2, x, y, z WHERE x.Id = f1.Idx AND y.Id = f1.Idy AND z.Id = f1.Idz AND f1.Idx = f2.Idx AND f1.Idy = f2.Idy AND f1.Idz = f2.Idz AND x.x IS NOT NULL AND x.x < 1000
============================= .
In this query parameters
those correspond to x.x, y.y, z.z, f1.f1, f2.f2 respecively. Regression equations are presented in Formula component
![]()
Regression parameters are marked in this component as constants
![]()
Other variables of equations are linked to columns of the query
.
A Processor
editor of properties is presented on the following picture:
![]()
Using this editor we link equation and regression parameters to the variables of Formula and table objects.
Click here to dowload database and additional files of the sample. Click here to download this sample.
This example is devoded to the situation when we have a control system with following transfer function
![]()
Parameters
are unknown but we have an experimental gain-frequency characteristic. We wish to define unknown parameters. Then we shall construct the following scheme
![]()
In this scheme the series component Graph implements the selection interface. The Formula implements regression parameters and transformation. The Graph property editor is presened on the following picture
![]()
The Graph presents the experimental gain-frequency characteristic. The Formula contains a formula of gain-frequency characteristic
. In this formula we use a, b, c instead
The series component Graph also implements a vector parameters interface. It contains two vectors. First one is a vector of abscisses of series, second one is a vector of ordinates. These vectors are represented in the Formula component property editor
![]()
The existence of these vectors on the Formula component property editor is caused by the information link
between Graph and Formula. At the above picture we have linked vector of abscisses with variable p of the formula
. It means that this formula calculates componentvise vector. Each component is calculation of this formula by substituting comonent of absciss instead p. To provide regression parameters k, a, b, c we have marked corresponding formula parameters as "Constants, aliases"
. The property editor of the processor comopnent is represented at the following picture
![]()
At the right part of this editor we have a set of regression parameters. At the middle part we have a set of calculated parameters. The index "-1" of Formula_2 and Formula_3 means that these parameters are omitted. We can say the same about "Y" of Graph. Shortly middle and right part ot the editor means that we try to solve the following equation
Formula_1 of Formula = Y of Graph.
The left part means that sought quantities are k, a, b, c of the Formula. If we have fulfilled controls of this editor and pressed the Accept button at the left bottom side of the editor then the Processor is ready to perform regression. After pressing Iterate button Processor performs an iteration. In result Processor will show parameter Sigma0 that characterize residues. To perform following iteration press the Iterate button once again. We can find corrected values of regression parameters at Formula property editor
. We can use these parameters for comparation results of regression with experimental data. To do this we should chagne argument p of the Formula. Before changing the data-in of the Formula looks like:
![]()
After changing it should looks like:
![]()
Before this changing parameter p was a vector of abscisses of Graph. After it become a Time. The Graph component also implements interface graph function. As a graph function it is connected by
to Formula. You can find it at the right part of Formula propery editor. After this chanfing you should click Accept input parameters and Accept values buutons and then the Refresh
button on toolbar of main menu.
![]()
The index "0" means that the Graph is used as
in the Formula. We have three formulas
![]()
First one calculates theoretic gain-frequency characteristic, second one calculates phase-response characteristic. Third one calculates experimental gain-frequency characteristic represened in Graph. If you open property editor of Indication you can indicate this functions (see picture below)
![]()
At this picture the red curve is a theoretic gain-frequency characteristic and green curve is an experimental one.
Let us consider the following problem. We have a set of photos of 3D object, obtained by a set of cameras. The 6D position of cameras are known and we have a 3D model of this object. We wish to find a 6D position of the object. This situation is presented in the following picture
![]()
At this picture we have 3D object
. Its property editor
![]()
enables us to set file name of 3D model of the object. We also have three cameras
. The property editor of camera is presented on the foloowing picture
![]()
This camera is connected by the
arrow with the Plane. It means that Plane is visible by this camera. These cameras have different 6D positions. So images of Plane are different. In the following picture another image is presented
![]()
We also have three components
those performs navigation by contours of figures. Property editor of this component is presented in the following picutre
![]()
At this editor a red contour corresponds to the bitmap downloaded by this component. A blue contour corresponds to a figure that is seen by the camera that is connected to this component by the
. In fact our task is a moving the plane for coincidence of these contours. After a set of iterations these contours looks like
![]()
The plane is set to the State Frame. This frame is moved and its property editor is presented below
![]()
The meaning of this editor is that coordinates X, Y, Z and components Q0, Q1, Q2, Q3 correspond to Formula_1, Formula_2, Formula_3, Formula_4, Formula_5, Formula_6, Formula_7 of Formula.respectively. The editor of Processor is presented on the following picture
![]()
Its left part correspond to defined parameters. The P1 on the middle panel corresponds to contour of camera image. The P1 on the right panel corresponds to image dowloaded to P1. Both of them are marked by number 0. It means that we wish to match both contours. Similarly we can say about P2 and P3.
Click here to download this sample.
![]() ![]() ![]() |