Research Article

An Algorithm for Optimally Fitting a Wiener Model

Algorithm 4

Nelder-Mead algorithm used. (Taken from [6, 12]).
Choose 𝑁 = number of iterations to be run based on starting value of 𝑅 2 and 𝑖 = 1 .
Generate a simplex around the starting parameters Μ‚ πœƒ ; denote them ( Μƒ πœƒ 1 , Μƒ πœƒ 2 Μƒ πœƒ , … , 𝑛 + 1 ) .
While 𝑖 ≀ 𝑁
 Reorder the points of the simplex such that Μƒ πœƒ 𝐹 ( 𝐱 | 1 Μƒ πœƒ ) ≀ 𝐹 ( 𝐱 | 2 Μƒ πœƒ ) ≀ β‹― ≀ 𝐹 ( 𝐱 | 𝑛 + 1 ) .
  βˆ‘ πœƒ = 𝑛 𝑖 = 1 Μƒ πœƒ 𝑖
  Μƒ πœƒ βˆ— = 2 Μƒ πœƒ πœƒ βˆ’ 𝑛 + 1
 if   Μƒ πœƒ 𝐹 ( 𝐱 ∣ 1 Μƒ πœƒ ) ≀ 𝐹 ( 𝐱 ∣ βˆ— Μƒ πœƒ ) < 𝐹 ( 𝐱 ∣ 𝑛 )   then
   Μƒ πœƒ 𝑛 + 1 = Μƒ πœƒ βˆ—
   𝑖 = 𝑖 + 1 ; next
 else if   Μƒ πœƒ 𝐹 ( 𝐱 ∣ βˆ— Μƒ πœƒ ) < 𝐹 ( 𝐱 ∣ 1 ) then
   Μƒ πœƒ βˆ— βˆ— = 3 Μƒ πœƒ πœƒ βˆ’ 2 𝑛 + 1
  if   Μƒ πœƒ 𝐹 ( 𝐱 ∣ βˆ— βˆ— Μƒ πœƒ ) < 𝐹 ( 𝐱 ∣ βˆ— )   then
    Μƒ πœƒ 𝑛 + 1 = Μƒ πœƒ βˆ— βˆ—
  else
    Μƒ πœƒ 𝑛 + 1 = Μƒ πœƒ βˆ—
  end if
   𝑖 = 𝑖 + 1 ; next
 else
  if   Μƒ πœƒ 𝐹 ( 𝐱 ∣ 𝑛 Μƒ πœƒ ) ≀ 𝐹 ( 𝐱 ∣ βˆ— Μƒ πœƒ ) < 𝐹 ( 𝐱 ∣ 𝑛 + 1 )   then
    Μƒ πœƒ βˆ— βˆ— = 3 2 1 πœƒ βˆ’ 2 Μƒ πœƒ 𝑛 + 1
   if   Μƒ πœƒ 𝐹 ( 𝐱 ∣ βˆ— βˆ— Μƒ πœƒ ≀ 𝐹 ( 𝐱 ∣ βˆ— )   then
     Μƒ πœƒ 𝑛 + 1 = Μƒ πœƒ βˆ— βˆ—
     𝑖 = 𝑖 + 1 ; next
   end if
  else
    Μƒ πœƒ βˆ— βˆ— = 1 2 1 πœƒ + 2 Μƒ πœƒ 𝑛 + 1
   if   Μƒ πœƒ 𝐹 ( 𝐱 ∣ βˆ— βˆ— Μƒ πœƒ < 𝐹 ( 𝐱 ∣ 𝑛 + 1 )   then
     Μƒ πœƒ 𝑛 + 1 = Μƒ πœƒ βˆ— βˆ—
     𝑖 = 𝑖 + 1 ; next
   end if
  end if
  for   𝑖 = 2 , 3 , … , 𝑛 + 1   do
    Μƒ πœƒ 𝑖 = 1 2 ( Μƒ πœƒ 1 + Μƒ πœƒ 𝑖 )
  end for
   𝑖 = 𝑖 + 1
  end if
end while