Fifth matlab learning

================================================== =============================================
analysis 1. hierarchy process

target, rule, scheme layer,
the consistency check
arithmetic averaging, geometric averaging, the characteristic value, for stable, three are used together.
Normalized column, row summation, columns normalization. excel lock f4
proposed limitations (n not more than 15; experts subjectivity too max).
Variable area can copy data directly excel 1

2. The merits of the solution from the law topsis

forward, standardization (to eliminate the influence dimension), normalization (equation deformation). d + d-
give different weight values in the column can be combined with the analytic hierarchy process
variability Weights entropy correction index lower, the lower the amount of information
the amount of information measured by the probability (Tsinghua)
nature of the information entropy is for information the expected value H (x) = - Σ ( p (xi) * ln (p (xi)))
the size of I (p) the amount of information = -ln (p (x)) // may be mis when there is no good to listen to it now suddenly
features: weight index determined by the index itself, to avoid the subjectivity of experts, but some obviously important right big indicators may be very low variability
modeling available, do not use paper entropy law

3. interpolation algorithm (Newton, Lagrange, Hermite, spline interpolation)

are fewer data, add some reliable data mathematically
principle: n + 1 mutually different points, the presence of a unique polynomial, so that the Ln (xi) = yi
Lagrange interpolation
n becomes large, n-th order interpolation Runge phenomenon occurs edge
of piecewise quadratic interpolation, parabolic interpolation is also called segment, with the closest x 3 quadratic interpolation points
Newton interpolation difference quotient is literally Divided difference largest denominator coefficient difference, reducing the number of large numbers of molecules principle; K the same order
of the two drawbacks: the interpolation point is satisfied, but the reaction can not function form, the derivative of e.g.
Hermite
F (XI) = Yi; F '(XI) = Yi'
function [A] = lianxi ()% plus function is recorded in the command line without leaving the work area; a is returned value, the variable name in the command line ANS
X = -pi: PI;
Y = SiN (X);
newx = -pi:. 1: PI;
P = pchip (X, Y, newx);
A = P;
Plot ( x, y, 'o', newx, p, 'p-')
cubic spline interpolation is smoother
function [a] = lianxi () % plus function is recorded in the command line without leaving the work area; a is the return value , the variable name in the command line ANS
X = -pi: PI;
Y = SiN (X);
newx = -pi: 0.1: PI;
P1 = pchip (X, Y, NE wx);
spline = P2 (X, Y, newx);
% A = P;
Plot (X, Y, 'O', newx, P1, 'P -', newx, P2, 'B-')
Legend ( 'sample points' 'Hermite cubic interpolation', 'cubic spline interpolation', 'location', 'north ')
interpolation algorithm can be used for short-term forecasts (population, try not to use, with a special fitting or prediction algorithm);
/ / Do not know where the wrong line of code
Population = [133126,133770,134413,135069,135738,136427,137122,137866,138639,139538];
year 2009: 2018;
p1 = pchip (year, Population, 2019: 2021) % piecewise cubic Hermite interpolation prediction
p2 = spline (year, population, 2019: 2021)% cubic spline interpolation prediction
plot (year, population, 'o ', 2019: 2021, p1, 'r * -', 2019: 2021, P2, 'BX-')
Legend ( 'sample points', 'Hermite cubic interpolation prediction', 'cubic spline interpolation prediction', 'the Location', 'SouthEast')
the subplot can be used in the same simultaneously drawing multiple images are displayed

4. fitting algorithm
when the sample point n> 30, Runge phenomenon too serious,It is a plot of a curve fitted to determine a
straight line: the least squares method
can be added directly to the path failed attempts :( added environment variable)
, for example:
fid = fopen ( 'C: \ Users \ Desktop \ HowNet .txt');% single quotes have to have
fidf06 = fopen ( 'pathname \ filename ');
Fitting Toolbox use cftool;
Clear; CLC
year = 1790 : 10: 2000;
Population = [3.9,5.3,7.2,9.6,12.9,17.1,23.2,31.4,38.6,50.2,62.9,76.0,92.0,106.5,123.2,131.7,150.7,179.3,204.0,226.5,251.4, 281.4];
Plot (year, Population, 'O')
cftool% fitting Toolbox
% (1) X data selected year
% (2) select the Y Data Population
% (. 3) fit Options: custom equation (equation custom )
% (4) is modified box below: X = F (T) = XM / (1+ (XM / 3.9-1) * exp (-R & lt * (T-1790)))
% (. 5) on the left result top bar displays: fit computation did not converge: that is not found convergence solution, fit the graphic to the right also shows the fitting result is not ideal
% (6) click fit Options, modified nonlinear least squares estimation method of fitting the initial value (StartPoint), r modify 0.02, xm modified 500
% (7) at this time result in the left list fitting results obtained: r = 0.02735, xm = 342.4
% (8) Click to fit the leftmost file toolbox menu bar -Generate Code (Code to export when you can put your paper appendix), you can get an unnamed script file
% (9) of this open script shortcut keys Ctrl + S, save this file to the current folder.
% (10) call function is now obtained this document and the fitted values of the predicted effect parameter
[fitresult, GOF] = createFit (year, Population)
T = 2001: 2030;
XM = 342.4;
R & lt = 0.02735;
Predictions = xm./(1+(xm./3.9-1).*exp(-r.*(t-1790)));% calculated predicted value (Note the dot to be written and the other points, which can ensure in a corresponding element calculation)
Figure (2)
Plot (year, Population, 'O', T, Predictions, '.')% predicted results plotted in FIG.




Guess you like

Origin www.cnblogs.com/zlr585/p/12396961.html