亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? nist.pas

?? Delphi 的數(shù)學(xué)控件
?? PAS
字號(hào):
{ **********************************************************************
  *                          Program NIST.PAS                          *
  *                            Version 1.8d                            *
  *                     (c) J. Debord, April 2002                      *
  **********************************************************************
  This programs evaluates the regression routines in MODELS.PAS with the
  reference data sets provided by the National Institute of Standards
  and Technology (NIST). These data are available on the Internet at:
  http://www.nist.gov/itl/div898/strd/general/dataarchive.html

  The following data sets are used:

  Norris         : Linear
  Longley        : Multilinear, 6 indep. variables
  Pontius        : Polynomial, degree=2
  Wampler 1 to 5 : Polynomial, degree=5, increasing noise level
  Filippelli     : Polynomial, degree=10
  Kirby 2        : Fraction, degree num=2 + const term, denom=2
  Thurber        : Fraction, degree num=3 + const term, denom=3
  Hahn 1         : Fraction, degree num=3 + const term, denom=3
  MGH 17         : Sum of 2 exponentials + const term
  Lanczos 1 to 3 : Sum of 3 exponentials, increasing noise level
  Box BOD        : Increasing exponential
  Misra 1a       : Increasing exponential
  Daniel-Wood    : Power
  Ratkowsky 2    : Logistic

  For each model, the following data are stored in file NIST.DAT,
  with all the significant digits reported by the NIST:

  * The reference parameter values with their standard deviations
  * The residual standard deviation
  * For linear and polynomial models: R^2 and F

  The program reads the input file, fits the models and writes the
  results in the output file NIST.OUT. The relative deviations between
  the reference values and the program values are computed and stored.

  According to the NIST, a good regression program should find at least
  4-5 significant digits of the reference values.

  Notes:

  1) Be sure to run the program at the highest precision level available
     to your compiler. In particular, the Filippelli test is passed only
     at the extended precision level ($DEFINE EXTENDEDREAL)

  2) The NIST does not provide reference data for the Michaelis, Hill and
     pKa models, nor for weighted regression.
  ********************************************************************** }

program nist;

uses
  fmath,
  matrices,
  optim,
  regress,
  pastring,
  models;

const
  NDATASETS = 19;  { Max. index of data set }

  DATANAME : array[0..NDATASETS] of String =
  ('Norris',
   'Longley',
   'Pontius',
   'Wampler 1',
   'Wampler 2',
   'Wampler 3',
   'Wampler 4',
   'Wampler 5',
   'Filippelli',
   'Kirby 2',
   'Thurber',
   'Hahn 1',
   'MGH 17',
   'Lanczos 1',
   'Lanczos 2',
   'Lanczos 3',
   'Box BOD',
   'Misra 1a',
   'Daniel-Wood',
   'Ratkowsky 2');

   MAXCSTPAR = 2;      { Max. index of constant parameter }
   MAXITER   = 5000;   { Maximal number of iterations }
   TOL       = 1E-08;  { Convergence criterion }

var
  Index        : Integer;  { Index of data set }
  N            : Integer;  { Number of observations }
  X            : TVector;  { Vector of independent variable }
  U            : TMatrix;  { Matrix of independent variable }
  Y            : TVector;  { Vector of dependent variable }
  B_ref        : TVector;  { Reference values for regression parameters }
  S_ref        : TVector;  { Reference values for parameter SD's }
  Sr_ref       : Float;    { Reference values for residual SD }
  R2_ref       : Float;    { Reference values for R^2 }
  F_ref        : Float;    { Reference values for F }
  Theta        : TVector;  { Variance param. for weighted reg., not used here }
  B            : TVector;  { regression parameters }
  B_min, B_max : TVector;  { Parameter bounds }
  V            : TMatrix;  { Variance-covariance matrix }
  Ycalc, S     : TVector;  { Estimated Y values and their SD's }
  RegTest      : TRegTest; { regression tests }
  ErrCode      : Integer;  { Error code }
  OutF         : Text;     { Output file }
  
  procedure ExtractModelData(ModelLine : String; var Model : Integer;
                             CstPar : TVector);
{ ----------------------------------------------------------------------
  Extracts the model data from the ModelLine string
  ---------------------------------------------------------------------- }
  var
    L : Integer;       { Length of string }
    P : Integer;       { Position of character in string }
    C : Char;          { Character }
    S1, S2 : String;   { Substrings }
    N1, N2 : Integer;  { Numeric parameters }
    Cst : Integer;     { Presence of constant term in model }
    Code : Integer;    { Error code }
  begin
    { Identify model }
    if Pos('Linear', ModelLine) > 0 then
      Model := REG_LIN
    else if Pos('Multilinear', ModelLine) > 0 then
      Model := REG_MULT
    else if Pos('Polynomial', ModelLine) > 0 then
      Model := REG_POL
    else if Pos('Rational', ModelLine) > 0 then
      Model := REG_FRAC
    else if Pos('Exponential', ModelLine) > 0 then
      Model := REG_EXPO
    else if Pos('Increasing exponential', ModelLine) > 0 then
      Model := REG_IEXPO
    else if Pos('Power', ModelLine) > 0 then
      Model := REG_POWER
    else if Pos('Logistic', ModelLine) > 0 then
      Model := REG_LOGIS;

    { Initialize substrings }
    S1 := ''; S2 := '';

    { Find the 1st comma }
    L := Length(ModelLine);
    P := 0;
    repeat
      Inc(P);
      C := ModelLine[P];
    until (C = ',') or (P = L);

    { Extract substring between 2 commas, or from comma to slash,
      or from comma to end of string. This substring corresponds
      to the first numeric parameter }
    if P < L then
      repeat
        Inc(P);
        C := ModelLine[P];
        if (C <> ',') and (C <> '/') then
          S1 := S1 + C;
      until (C = ',') or (C = '/') or (P = L);

    { Extract substring from '/' to 2nd comma. This substring
      corresponds to the second numeric parameter }
    if C = '/' then
      repeat
        Inc(P);
        C := ModelLine[P];
        if C <> ',' then
          S2 := S2 + C;
      until (C = ',') or (P = L);

    { Convert substrings to numeric parameters }
    Val(S1, N1, Code);
    Val(S2, N2, Code);

    { Check for constant term }
    if Pos('no constant term', ModelLine) > 0 then
      Cst := 0
    else if Pos('constant term', ModelLine) > 0 then
      Cst := 1;

    { Store constant parameters in CstPar }
    case Model of
      REG_MULT  : begin
                    CstPar[0] := N1;   { Number of indep. var. }
                    CstPar[1] := Cst;  { Presence of constant term }
                  end;
      REG_POL   : CstPar[0] := N1;     { Degree of polynomial }
      REG_FRAC  : begin
                    CstPar[0] := N1;   { Degree of numerator }
                    CstPar[1] := N2;   { Degree of denominator }
                    CstPar[2] := Cst;  { Presence of constant term }
                  end;
      REG_EXPO  : begin
                    CstPar[0] := N1;   { Number of exponentials }
                    CstPar[1] := Cst;  { Presence of constant term }
                  end;
      REG_LOGIS : CstPar[0] := Cst;    { Presence of constant term }
    end;
  end;

  procedure ReadInputFile(Index : Integer; var N : Integer;
                          var X : TVector; var U : TMatrix;
                          var Y, B_ref, S_ref : TVector;
                          var Sr_ref, R2_ref, F_ref : Float);
{ ----------------------------------------------------------------------
  Reads input file and initializes model
  ---------------------------------------------------------------------- }
  var
    InF : Text;          { Input file }
    S : String;          { Line of text }
    ModelLine : String;  { Line containing the model specifications }
    Model : Integer;     { Index of regression model }
    CstPar : TVector;    { Constant parameters }
    M : Integer;         { Number of parameters }
    I, K : Integer;      { Loop variables }
  begin
    { Open input file }
    Assign(InF, 'nist.dat');
    Reset(InF);

    { Read lines until title line is found }
    repeat
      ReadLn(InF, S);
    until Pos(DATANAME[Index], S) > 0;

    { Read model line and initialize model }
    ReadLn(InF, ModelLine);
    DimVector(CstPar, MAXCSTPAR);
    ExtractModelData(ModelLine, Model, CstPar);
    InitModel(Model, VAR_CONST, CstPar);
    M := LastParam;

    { Read number of points }
    Read(InF, N);

    { Dimension new arrays }
    DimVector(X, N);
    DimMatrix(U, M, N);
    DimVector(Y, N);
    DimVector(B_ref, M);
    DimVector(S_ref, M);

    { Read observations }
    if Model = REG_MULT then
      for K := 1 to N do
        begin
          for I := 1 to M do
            Read(InF, U[I,K]);
          Read(InF, Y[K]);
        end
    else
      for K := 1 to N do
        Read(InF, X[K], Y[K]);

    { Read reference parameters and their SD's }
    for K := FirstParam to LastParam do
      Read(InF, B_ref[K], S_ref[K]);

    { Read reference values for regression tests }
    Read(InF, Sr_ref);
    if Model in [REG_LIN, REG_MULT, REG_POL] then
      Read(InF, R2_ref, F_ref);

    { Close input file }
    Close(InF);
  end;

  procedure DimArrays(N : Integer; var Theta, B, B_min, B_max : TVector;
                      var V : TMatrix; var Ycalc, S : TVector);
{ ----------------------------------------------------------------------
  Dimensions new arrays
  ---------------------------------------------------------------------- }
  begin
    DimVector(Theta, LastVarParam);
    DimVector(B, LastParam);
    DimVector(B_min, LastParam);
    DimVector(B_max, LastParam);
    DimMatrix(V, LastParam, LastParam);
    DimVector(Ycalc, N);
    DimVector(S, N);
  end;

  procedure SetParamBounds(B_min, B_max : TVector);
{ ----------------------------------------------------------------------
  Sets parameter bounds
  ---------------------------------------------------------------------- }
  var
    I : Integer;
  begin
    for I := FirstParam to LastParam do
      begin
        B_min[I] := - 1.0E+1;
        B_max[I] :=   1.0E+4;
      end;
  end;

  procedure WriteResults(Index, ErrCode : Integer; B_ref, S_ref, B : TVector;
                         V : TMatrix; Sr_ref, R2_ref, F_ref : Float;
                         var RegTest : TRegTest);
{ ----------------------------------------------------------------------
  Writes results to output file
  ---------------------------------------------------------------------- }
  const
    HEADER    = '           Value                     Reference             Rel.error';
    LINEWIDTH = 73;
  var
    Line1, Line2 : String;  { Separating lines }
    S : Float;              { Standard deviation of a parameter }
    Sr : Float;             { Residual error }
    I : Integer;            { Loop variable }
    Err : Float;            { Relative error }
  begin
    Line1 := StrChar(LINEWIDTH, '-');
    Line2 := StrChar(LINEWIDTH, '=');

    WriteLn(OutF, Line2);
    WriteLn(OutF, 'Data set: ', DATANAME[Index]);
    WriteLn(OutF, 'Function: ', FuncName);
    WriteLn(OutF, Line1);

    case ErrCode of
      MAT_OK :
        begin
          WriteLn(OutF, 'Param', HEADER);
          WriteLn(OutF, Line1);

          for I := FirstParam to LastParam do
            begin
              Err := (B[I] - B_ref[I]) / B_ref[I];
              WriteLn(OutF, RFill(ParamName(I), 7),
                      B[I], '     ', B_ref[I], '     ', Err:10);
            end;

          WriteLn(OutF, Line1);
          WriteLn(OutF, 'SD   ', HEADER);
          WriteLn(OutF, Line1);

          for I := FirstParam to LastParam do
            begin
              S := Sqrt(V[I,I]);
              Write(OutF, RFill(ParamName(I), 7), S, '     ', S_ref[I]);
              if S_ref[I] > 0.0 then
                Write(OutF, '     ', ((S - S_ref[I]) / S_ref[I]):10);
              WriteLn(OutF);
            end;

          WriteLn(OutF, Line1);
          WriteLn(OutF, 'Test ', HEADER);
          WriteLn(OutF, Line1);

          with RegTest do
            begin
              Sr := Sqrt(Vr);
              Write(OutF, 's      ', Sr, '     ', Sr_ref);
              if Sr_ref > 0.0 then
                Write(OutF, '     ', ((Sr - Sr_ref) / Sr_ref):10);
              WriteLn(OutF);
              if Index < 9 then
                WriteLn(OutF, 'R^2    ', R2, '     ', R2_ref,
                  '     ', ((R2 - R2_ref) / R2_ref):10);
              if (Index < 9) and (F_ref < 1E38) then
                WriteLn(OutF, 'F      ', F, '     ', F_ref,
                  '     ', ((F - F_ref) / F_ref):10);
            end;
        end;
      OPT_SING       : WriteLn(OutF, 'Singular matrix');
      OPT_BIG_LAMBDA : WriteLn(OutF, 'Too high Marquardt''s parameter');
      OPT_NON_CONV   : WriteLn(OutF, 'Non - convergence');
    end;
    WriteLn(OutF, Line2);
  end;

begin
  Assign(OutF, 'nist.out');
  Rewrite(OutF);
  
{ ---------------------------------------------------------------
  With linear regression models, the best results are obtained
  with the Singular Value Decomposition algorithm.
  --------------------------------------------------------------- }
  SetRegAlgo(SVD);

  for Index := 0 to NDATASETS do
    begin
      WriteLn('Data set: ', DATANAME[Index], ' - Please wait...');

      { Read data set and dimension arrays }
      ReadInputFile(Index, N, X, U, Y, B_ref, S_ref, Sr_ref, R2_ref, F_ref);
      DimArrays(N, Theta, B, B_min, B_max, V, Ycalc, S);
      SetParamBounds(B_min, B_max);

    { ---------------------------------------------------------------
      With nonlinear regression models, Marquardt's method gives the
      best results except for data set 11 (Hahn 1), for which it does
      not converge. In this case, simplex or Metropolis-Hastings may
      be used to obtain an approximation to the parameters, which is
      further refined by Marquardt's method.
      --------------------------------------------------------------- }
      if Index = 11 then
        begin
          { Start with simplex }
          SetOptAlgo(NL_SIMP);
          ErrCode := WLSFit(X, U, Y, N, True, MAXITER, TOL, Theta,
                            B, B_min, B_max, V, Ycalc, S, RegTest);
          { Then switch to Marquardt }
          SetOptAlgo(NL_MARQ);
          ErrCode := WLSFit(X, U, Y, N, False, MAXITER, TOL, Theta,
                            B, B_min, B_max, V, Ycalc, S, RegTest);
        end
      else
        begin
          SetOptAlgo(NL_MARQ);
          ErrCode := WLSFit(X, U, Y, N, True, MAXITER, TOL, Theta,
                            B, B_min, B_max, V, Ycalc, S, RegTest);
        end;

      WriteResults(Index, ErrCode, B_ref, S_ref, B, V,
                   Sr_ref, R2_ref, F_ref, RegTest);
    end;

  Close(OutF);
  WriteLn('Results written in file nist.out');
end.

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧洲精品一区二区精品久久久 | 国产精品三级视频| 欧美中文一区二区三区| 高清免费成人av| 另类小说一区二区三区| 亚洲国产视频直播| 中文字幕视频一区二区三区久| 日韩一级片网站| 欧美在线观看视频一区二区三区 | 免费人成黄页网站在线一区二区| 国产精品成人网| 精品少妇一区二区三区| 欧美日韩一区二区在线观看视频| 99麻豆久久久国产精品免费 | 国产一区在线观看视频| 香港成人在线视频| 亚洲欧美日本在线| 久久久噜噜噜久久人人看 | 亚洲第一主播视频| 国产精品国产馆在线真实露脸| 91精品久久久久久久91蜜桃| 欧美tickling挠脚心丨vk| 亚洲乱码一区二区三区在线观看| 日韩美女在线视频| 91精品国产色综合久久| 在线观看日韩毛片| 在线亚洲精品福利网址导航| 91亚洲精品一区二区乱码| 国产精品69毛片高清亚洲| 美女一区二区在线观看| 午夜精品久久久久久| 亚洲高清中文字幕| 亚洲一区二区偷拍精品| 亚洲一区二区在线免费观看视频| 一区二区三区不卡视频| 亚洲天堂成人网| 亚洲精品免费在线观看| 亚洲精品自拍动漫在线| 一区二区三区在线免费| 一区二区免费在线| 亚洲一区二区精品3399| 婷婷亚洲久悠悠色悠在线播放| 亚洲电影一区二区| 日韩一区欧美二区| 男女性色大片免费观看一区二区 | 国产精品毛片a∨一区二区三区| 国产亚洲综合av| 国产精品高潮久久久久无| 亚洲欧洲国产日本综合| 亚洲一级二级在线| 视频一区在线播放| 国内精品免费**视频| 风间由美一区二区av101| jizz一区二区| 欧美日韩一二三区| 日韩一二在线观看| 国产午夜精品理论片a级大结局| 国产精品你懂的| 一区二区成人在线视频| 日韩av成人高清| 国产美女精品一区二区三区| 成人av网站大全| 精品视频色一区| 精品国产麻豆免费人成网站| 中文字幕欧美激情一区| 18成人在线观看| 日韩和的一区二区| 国产精品一二三在| 色婷婷久久久亚洲一区二区三区| 91 com成人网| 国产精品久久久久四虎| 亚洲成人动漫精品| 国产久卡久卡久卡久卡视频精品| 99精品久久只有精品| 欧美日本韩国一区二区三区视频| 欧美精品一区二区三区久久久| 综合久久国产九一剧情麻豆| 丝袜a∨在线一区二区三区不卡| 国产一区欧美日韩| 色欧美乱欧美15图片| 日韩片之四级片| 1024成人网| 久久国产精品第一页| 日本道精品一区二区三区| 欧美一区二区在线观看| 国产精品国模大尺度视频| 美女一区二区视频| 色哟哟日韩精品| 国产无一区二区| 日韩黄色在线观看| av成人免费在线| 欧美成人官网二区| 一区二区三区毛片| 成人黄页毛片网站| 欧美一区二区三区不卡| 日本视频一区二区三区| 北条麻妃一区二区三区| 欧美v日韩v国产v| 亚洲一区二区三区国产| 成人黄色综合网站| 久久久久久免费毛片精品| 午夜欧美2019年伦理| 99精品桃花视频在线观看| 精品少妇一区二区三区| 视频在线观看一区二区三区| 色又黄又爽网站www久久| 国产日韩精品一区| 九九**精品视频免费播放| 欧美视频一区二区三区四区| 亚洲欧洲av另类| 色婷婷综合久久久| 国产亚洲成年网址在线观看| 美女免费视频一区二区| 欧美欧美欧美欧美| 亚洲一区二区三区自拍| 96av麻豆蜜桃一区二区| 中文字幕不卡在线观看| 国产一区二区导航在线播放| 日韩欧美一区二区三区在线| 亚洲成人免费视频| 欧美日韩一区二区三区四区五区 | 婷婷综合五月天| 色美美综合视频| 亚洲视频在线观看一区| 99热国产精品| 亚洲图片另类小说| 成人精品亚洲人成在线| 欧美国产日产图区| 成人av在线网| 欧美经典一区二区| 国产成人一级电影| 中文久久乱码一区二区| 成人的网站免费观看| 国产精品超碰97尤物18| 91在线看国产| 亚洲精品免费在线| 欧美色窝79yyyycom| 亚洲曰韩产成在线| 欧美疯狂做受xxxx富婆| 免费高清成人在线| 精品国内二区三区| 国产福利一区二区三区在线视频| 久久久91精品国产一区二区精品 | 粉嫩一区二区三区性色av| 久久精品亚洲乱码伦伦中文| 成人精品一区二区三区四区| 中文字幕在线观看一区二区| 日本精品一级二级| 亚洲成人av一区二区三区| 日韩一区二区高清| 狠狠色综合日日| 国产精品天干天干在线综合| 91丨porny丨蝌蚪视频| 一区二区三区在线播放| 6080国产精品一区二区| 国产一区二区三区四| 中文字幕中文在线不卡住| 欧美亚洲动漫精品| 轻轻草成人在线| 国产精品嫩草影院com| 欧美午夜精品久久久| 久久国产精品99久久人人澡| 中文字幕高清不卡| 欧美视频一区二区三区| 狠狠色丁香九九婷婷综合五月 | 日本成人中文字幕| 国产欧美一区二区精品忘忧草 | 国产毛片一区二区| 中文字幕亚洲电影| 欧美一级理论性理论a| 国产精品亚洲第一| 亚洲成人免费av| 国产日产欧美一区| 欧美日韩免费高清一区色橹橹| 久久精品国产在热久久| 国产精品二三区| 日韩三级视频在线看| 东方欧美亚洲色图在线| 午夜精品久久久久久久久久| 精品对白一区国产伦| 91麻豆产精品久久久久久 | 国产成人av一区二区| 亚洲综合一区二区三区| 久久久一区二区| 欧美二区在线观看| 91在线视频网址| 成人毛片在线观看| 免费在线观看一区| 亚洲乱码中文字幕| 国产偷v国产偷v亚洲高清| 欧美人成免费网站| 99综合电影在线视频| 久久99久久精品| 亚洲成人一区二区在线观看| 国产精品少妇自拍| 亚洲精品在线一区二区| 欧美日韩视频一区二区| 9l国产精品久久久久麻豆| 国产乱子轮精品视频| 日韩成人免费电影|