Astronomical Applications Department, U.S. Naval Observatory Linear Least Squares Page 18
:=
[ ]
tmp 2
(
)
+
+
(
)
-
t4
/
1 2 t6 t1
(
)
-
+
2 t14 2 t17
/
1 2 N t8
t7 t10 t27;
tmp
end
Logarithm
(
)
leastsqrs
, , ,
=
Y
+
A B
( )
log t
i
t i [
]
,
A B
leastsqrs[0]: normal equations
=
-
+
+
2 S
0
2 A N 2 B T
1
0
=
-
+
+
2 S
1
2 A T
1
2 B T
0
0
leastsqrs[0]: Solving the normal equations...
leastsqrs[0]: substitution list
=
-
+
=
i 1
N
( )
ln t
i
2
=
i 1
N
( )
ln t
i
2
N
=
S
0
=
i 1
N
Y
i
=
T
0
=
i 1
N
( )
ln t
i
2
=
T
1
=
i 1
N
( )
ln t
i
,
,
,
,
=
S
1
=
i 1
N
( )
ln t
i
Y
i
leastsqrs[0]: Verifying the solution...
,
=
A
-
S
0
T
0
T
1
S
1
=
B
-
S
1
N T
1
S
0
(
)
eval
,
% _subslist
=
A
-
=
i 1
N
Y
i
=
i 1
N
( )
ln t
i
2
=
i 1
N
( )
ln t
i
=
i 1
N
( )
ln t
i
Y
i
-
+
=
i 1
N
( )
ln t
i
2
=
i 1
N
( )
ln t
i
2
N
,
=
B
-
=
i 1
N
( )
ln t
i
Y
i
N
=
i 1
N
( )
ln t
i
=
i 1
N
Y
i
-
+
=
i 1
N
( )
ln t
i
2
=
i 1
N
( )
ln t
i
2
N
:=
tmp
(
)
array
(
)
map
,
x
( )
rhs x
(
)
eval
,
%% _subslist
(
)
optimize
(
)
makeproc
,
tmp
=
parameters [
]
, ,
N Y t
, ,
N Y t
proc
(
)
local
;
, ,
, , , ,
tmp t5 t11 t4 t8 t1 t2
:=
tmp
(
)
array ..
1 2 ;
Page 18