Find Docs

Astronomical Applications Department, U.S. Naval Observatory - Linear Least Squares (Page 8)

Wodocs >> Science : Astronomy >> Astronomical Applications Department, U.S. Naval Observatory Linear Least Squares Page 8
Astronomical Applications Department, U.S. Naval Observatory - Linear Least Squares
fi;

debug_print(procname,"substitution list",2,_subslist);

#----------------------
# check the solution(s)
#----------------------
if type(solset,list(list)) then #multiple solutions
debug_print(procname,"Verifying the ".(nops(solset))." solutions...",1);
goodsols := [];
for k from 1 to nops(solset) do
tmp := expand(subs(_subslist,eval(eqs,solset[k])));
if not type(tmp,list(0=0)) then
debug_print(procname,"Solution ".k." is invalid!",0,solset[k]);
debug_print(procname,"Solution ".k." substituted into normal eqs",0,eqs);
debug_print(procname,"Throwing out solution ".k,0);
else
goodsols := [op(goodsols),solset[k]];
fi;
od;
solset := goodsols;
if nops(solset)=1 then
solset := op(solset);
fi;
else #single solution
debug_print(procname,"Verifying the solution...",1);
eqs := factor(expand(subs(_subslist,eval(eqs,solset))));
if not type(eqs,list(0=0)) then
debug_print(procname,"Solution substituted into normal eqs",0,eqs);
ERROR("Invalid solution!");
fi;
fi;

if time()-time0 > 10 then
debug_print(procname,"Done!",1);
fi;
solset;
end:
4. Examples
Polynomial of degree 1
We start with simple linear regression to check the program. We set the procedure's "chattiness" to
maximum verbosity. The solution appears as the last bracketed expression.
:=
printlevel
4
(
)
leastsqrs
, , ,
=
y
+
A B t
i
t i [
]
,
A B
leastsqrs[0]: i,t,y,ispoly,chi2
, , ,
,
i t
i
y
i
true
=
i 1
N
(
)
- -
y
i
A B t
i
2
Page 8

<< Previous       1 2 3 4 5 6 7 8 9 10 11 12 13 14 15       Next >>



Other Documents:
Sensitivity Integral, 3 D plot fits, lyap2, NAO 150, Rotate Vector, lyapcalc, wedges, Scifull, Precession Memo, Precession Maple, Curves 3 D, NOVAS 2004 Overview, NOVAS 2006 Overview, thesis, Ranson,


WODocs | |
All rights reserved. wodocs.com© 2009
WODocs


New Docs

Documents Category:
Arts (Design, Movies, Music, Radio, Television)
Automotive (Cars, Marine, Motorcycle, ATV, Snowmobiles)
Business (Biotechnology and Pharmaceuticals, Chemicals, Construction and Maintenance, Materials, Real Estate, Services)
Electronics (Computers, Motion Control, Power Supply)
Games (Board, Family, Party, Card, Construction, RC Toys)
Health (Animalm, Beauty, Healthcare, Medicine, Pharmacy, Surgery, Weight Loss)
Home (Accessories, Cooking, Decor and Design, Electrical, Family, Pets)
News (Newspapers, Sports, Television)
Recreation (Collecting, Hiking, Scouting, Survival, Travel)
Reference (Education, Libraries and Archives, Museums)
Science (Agriculture, Astronomy, Biology, Chemistry)
Shopping (Antiques and Collectibles, Clothing, Flowers, Food, Home and Garden)
Sports (Bicycle, Snowboard, Skiing, Other)