<s>
Least-squares	B-General_Concept
spectral	I-General_Concept
analysis	I-General_Concept
(	O
LSSA	B-General_Concept
)	O
is	O
a	O
method	O
of	O
estimating	O
a	O
frequency	O
spectrum	O
based	O
on	O
a	O
least-squares	B-Algorithm
fit	I-Algorithm
of	O
sinusoids	O
to	O
data	O
samples	O
,	O
similar	O
to	O
Fourier	O
analysis	O
.	O
</s>
<s>
Fourier	O
analysis	O
,	O
the	O
most	O
used	O
spectral	O
method	O
in	O
science	O
,	O
generally	O
boosts	O
long-periodic	O
noise	O
in	O
the	O
long	O
and	O
gapped	O
records	O
;	O
LSSA	B-General_Concept
mitigates	O
such	O
problems	O
.	O
</s>
<s>
Unlike	O
in	O
Fourier	O
analysis	O
,	O
data	O
need	O
not	O
be	O
equally	O
spaced	O
to	O
use	O
LSSA	B-General_Concept
.	O
</s>
<s>
Developed	O
in	O
1969	O
and	O
1971	O
,	O
LSSA	B-General_Concept
is	O
also	O
known	O
as	O
the	O
Vaníček	B-General_Concept
method	I-General_Concept
and	O
the	O
Gauss-Vaniček	O
method	O
after	O
Petr	O
Vaníček	O
,	O
and	O
as	O
the	O
Lomb	O
method	O
or	O
the	O
Lomb	O
–	O
Scargle	O
periodogram	O
,	O
based	O
on	O
the	O
simplifications	O
first	O
by	O
Nicholas	O
R	O
.	O
Lomb	O
and	O
then	O
by	O
Jeffrey	O
D	O
.	O
Scargle	O
.	O
</s>
<s>
The	O
close	O
connections	O
between	O
Fourier	O
analysis	O
,	O
the	O
periodogram	O
,	O
and	O
the	O
least-squares	B-Algorithm
fitting	I-Algorithm
of	O
sinusoids	O
have	O
been	O
known	O
for	O
a	O
long	O
time	O
.	O
</s>
<s>
In	O
1963	O
,	O
Freek	O
J	O
.	O
M	O
.	O
Barning	O
of	O
Mathematisch	O
Centrum	O
,	O
Amsterdam	O
,	O
handled	O
unequally	O
spaced	O
data	O
by	O
similar	O
techniques	O
,	O
including	O
both	O
a	O
periodogram	O
analysis	O
equivalent	O
to	O
what	O
nowadays	O
is	O
called	O
the	O
Lomb	O
method	O
and	O
least-squares	B-Algorithm
fitting	I-Algorithm
of	O
selected	O
frequencies	O
of	O
sinusoids	O
determined	O
from	O
such	O
periodograms	O
—	O
and	O
connected	O
by	O
a	O
procedure	O
known	O
today	O
as	O
the	O
matching	B-General_Concept
pursuit	I-General_Concept
with	O
post-back	O
fitting	O
or	O
the	O
orthogonal	O
matching	B-General_Concept
pursuit	I-General_Concept
.	O
</s>
<s>
Petr	O
Vaníček	O
,	O
a	O
Canadian	O
geophysicist	O
and	O
geodesist	O
of	O
the	O
University	O
of	O
New	O
Brunswick	O
,	O
proposed	O
in	O
1969	O
also	O
the	O
matching-pursuit	O
approach	O
for	O
equally	O
and	O
unequally	O
spaced	O
data	O
,	O
which	O
he	O
called	O
"	O
successive	O
spectral	O
analysis	O
"	O
and	O
the	O
result	O
a	O
"	O
least-squares	B-Algorithm
periodogram	O
"	O
.	O
</s>
<s>
Vaníček	O
's	O
strictly	O
least-squares	B-Algorithm
method	I-Algorithm
was	O
then	O
simplified	O
in	O
1976	O
by	O
Nicholas	O
R	O
.	O
Lomb	O
of	O
the	O
University	O
of	O
Sydney	O
,	O
who	O
pointed	O
out	O
its	O
close	O
connection	O
to	O
periodogram	O
analysis	O
.	O
</s>
<s>
Subsequently	O
,	O
the	O
definition	O
of	O
a	O
periodogram	O
of	O
unequally	O
spaced	O
data	O
was	O
modified	O
and	O
analyzed	O
by	O
Jeffrey	O
D	O
.	O
Scargle	O
of	O
NASA	O
Ames	O
Research	O
Center	O
,	O
who	O
showed	O
that	O
,	O
with	O
minor	O
changes	O
,	O
it	O
becomes	O
identical	O
to	O
Lomb	O
's	O
least-squares	B-Algorithm
formula	O
for	O
fitting	O
individual	O
sinusoid	O
frequencies	O
.	O
</s>
<s>
Scargle	O
states	O
that	O
his	O
paper	O
"	O
does	O
not	O
introduce	O
a	O
new	O
detection	O
technique	O
,	O
but	O
instead	O
studies	O
the	O
reliability	O
and	O
efficiency	O
of	O
detection	O
with	O
the	O
most	O
commonly	O
used	O
technique	O
,	O
the	O
periodogram	O
,	O
in	O
the	O
case	O
where	O
the	O
observation	O
times	O
are	O
unevenly	O
spaced	O
,	O
"	O
and	O
further	O
points	O
out	O
regarding	O
least-squares	B-Algorithm
fitting	I-Algorithm
of	O
sinusoids	O
compared	O
to	O
periodogram	O
analysis	O
,	O
that	O
his	O
paper	O
"	O
establishes	O
,	O
apparently	O
for	O
the	O
first	O
time	O
,	O
that	O
(	O
with	O
the	O
proposed	O
modifications	O
)	O
these	O
two	O
methods	O
are	O
exactly	O
equivalent.	O
"	O
</s>
<s>
In	O
1989	O
,	O
Michael	O
J	O
.	O
Korenberg	O
of	O
Queen	O
's	O
University	O
in	O
Kingston	O
,	O
Ontario	O
,	O
developed	O
the	O
"	O
fast	O
orthogonal	O
search	O
"	O
method	O
of	O
more	O
quickly	O
finding	O
a	O
near-optimal	O
decomposition	O
of	O
spectra	O
or	O
other	O
problems	O
,	O
similar	O
to	O
the	O
technique	O
that	O
later	O
became	O
known	O
as	O
the	O
orthogonal	O
matching	B-General_Concept
pursuit	I-General_Concept
.	O
</s>
<s>
In	O
the	O
Vaníček	B-General_Concept
method	I-General_Concept
,	O
a	O
discrete	O
data	O
set	O
is	O
approximated	O
by	O
a	O
weighted	O
sum	O
of	O
sinusoids	O
of	O
progressively	O
determined	O
frequencies	O
using	O
a	O
standard	O
linear	B-General_Concept
regression	I-General_Concept
or	O
least-squares	B-Algorithm
fit	I-Algorithm
.	O
</s>
<s>
The	O
frequencies	O
are	O
chosen	O
using	O
a	O
method	O
similar	O
to	O
Barning	O
's	O
,	O
but	O
going	O
further	O
in	O
optimizing	O
the	O
choice	O
of	O
each	O
successive	O
new	O
frequency	O
by	O
picking	O
the	O
frequency	O
that	O
minimizes	O
the	O
residual	O
after	O
least-squares	B-Algorithm
fitting	I-Algorithm
(	O
equivalent	O
to	O
the	O
fitting	O
technique	O
now	O
known	O
as	O
matching	B-General_Concept
pursuit	I-General_Concept
with	O
pre-backfitting	O
)	O
.	O
</s>
<s>
The	O
solution	O
for	O
x	O
is	O
closed-form	O
,	O
using	O
standard	O
linear	B-General_Concept
regression	I-General_Concept
:	O
</s>
<s>
When	O
the	O
basis	O
functions	O
in	O
A	O
are	O
orthogonal	O
(	O
that	O
is	O
,	O
not	O
correlated	O
,	O
meaning	O
the	O
columns	O
have	O
zero	O
pair-wise	O
dot	O
products	O
)	O
,	O
the	O
matrix	O
ATA	O
is	O
diagonal	O
;	O
when	O
the	O
columns	O
all	O
have	O
the	O
same	O
power	O
(	O
sum	O
of	O
squares	O
of	O
elements	O
)	O
,	O
then	O
that	O
matrix	O
is	O
an	O
identity	B-Algorithm
matrix	I-Algorithm
times	O
a	O
constant	O
,	O
so	O
the	O
inversion	O
is	O
trivial	O
.	O
</s>
<s>
This	O
case	O
is	O
known	O
as	O
the	O
discrete	B-Algorithm
Fourier	I-Algorithm
transform	I-Algorithm
,	O
slightly	O
rewritten	O
in	O
terms	O
of	O
measurements	O
and	O
coefficients	O
.	O
</s>
<s>
Trying	O
to	O
lower	O
the	O
computational	O
burden	O
of	O
the	O
Vaníček	B-General_Concept
method	I-General_Concept
in	O
1976	O
(	O
no	O
longer	O
an	O
issue	O
)	O
,	O
Lomb	O
proposed	O
using	O
the	O
above	O
simplification	O
in	O
general	O
,	O
except	O
for	O
pair-wise	O
correlations	O
between	O
sine	O
and	O
cosine	O
bases	O
of	O
the	O
same	O
frequency	O
,	O
since	O
the	O
correlations	O
between	O
pairs	O
of	O
sinusoids	O
are	O
often	O
small	O
,	O
at	O
least	O
when	O
they	O
are	O
not	O
tightly	O
spaced	O
.	O
</s>
<s>
The	O
vector	O
x	O
is	O
a	O
reasonably	O
good	O
estimate	O
of	O
an	O
underlying	O
spectrum	O
,	O
but	O
since	O
we	O
ignore	O
any	O
correlations	O
,	O
Ax	O
is	O
no	O
longer	O
a	O
good	O
approximation	O
to	O
the	O
signal	O
,	O
and	O
the	O
method	O
is	O
no	O
longer	O
a	O
least-squares	B-Algorithm
method	I-Algorithm
—	O
yet	O
in	O
the	O
literature	O
continues	O
to	O
be	O
referred	O
to	O
as	O
such	O
.	O
</s>
<s>
At	O
any	O
individual	O
frequency	O
,	O
this	O
method	O
gives	O
the	O
same	O
power	O
as	O
does	O
a	O
least-squares	B-Algorithm
fit	I-Algorithm
to	O
sinusoids	O
of	O
that	O
frequency	O
and	O
of	O
the	O
form	O
:	O
</s>
<s>
In	O
practice	O
,	O
it	O
is	O
always	O
difficult	O
to	O
judge	O
if	O
a	O
given	O
Lomb	O
peak	O
is	O
significant	O
or	O
not	O
,	O
especially	O
when	O
the	O
nature	O
of	O
the	O
noise	O
is	O
unknown	O
,	O
so	O
for	O
example	O
a	O
false-alarm	O
spectral	O
peak	O
in	O
the	O
Lomb	B-General_Concept
periodogram	I-General_Concept
analysis	O
of	O
noisy	O
periodic	O
signal	O
may	O
result	O
from	O
noise	O
in	O
turbulence	O
data	O
.	O
</s>
<s>
Mathematically	O
,	O
FOS	O
uses	O
a	O
slightly	O
modified	O
Cholesky	O
decomposition	O
in	O
a	O
mean-square	O
error	O
reduction	O
(	O
MSER	O
)	O
process	O
,	O
implemented	O
as	O
a	O
sparse	B-Algorithm
matrix	I-Algorithm
inversion	O
.	O
</s>
<s>
As	O
with	O
the	O
other	O
LSSA	B-General_Concept
methods	O
,	O
FOS	O
avoids	O
the	O
major	O
shortcoming	O
of	O
discrete	O
Fourier	O
analysis	O
,	O
so	O
it	O
can	O
accurately	O
identify	O
embedded	O
periodicities	O
and	O
excel	O
with	O
unequally	O
spaced	O
data	O
.	O
</s>
<s>
His	O
is	O
a	O
fast	O
(	O
FFT-based	O
)	O
technique	O
for	O
weighted	O
least-squares	B-Algorithm
analysis	I-Algorithm
on	O
arbitrarily	O
spaced	O
data	O
with	O
non-uniform	O
standard	O
errors	O
.	O
</s>
<s>
The	O
most	O
useful	O
feature	O
of	O
LSSA	B-General_Concept
is	O
enabling	O
incomplete	O
records	O
to	O
be	O
spectrally	O
analyzed	O
—	O
without	O
the	O
need	O
to	O
manipulate	O
data	O
or	O
to	O
invent	O
otherwise	O
non-existent	O
data	O
.	O
</s>
<s>
Magnitudes	O
in	O
the	O
LSSA	B-General_Concept
spectrum	O
depict	O
the	O
contribution	O
of	O
a	O
frequency	O
or	O
period	O
to	O
the	O
variance	O
of	O
the	O
time	O
series	O
.	O
</s>
<s>
Generally	O
,	O
spectral	O
magnitudes	O
thus	O
defined	O
enable	O
the	O
output	O
's	O
straightforward	O
significance	B-General_Concept
level	I-General_Concept
regime	O
.	O
</s>
<s>
Inverse	O
transformation	O
of	O
Vaníček	O
's	O
LSSA	B-General_Concept
is	O
possible	O
,	O
as	O
is	O
most	O
easily	O
seen	O
by	O
writing	O
the	O
forward	O
transform	O
as	O
a	O
matrix	O
;	O
the	O
matrix	O
inverse	O
(	O
when	O
the	O
matrix	O
is	O
not	O
singular	O
)	O
or	O
pseudo-inverse	O
will	O
then	O
be	O
an	O
inverse	O
transformation	O
;	O
the	O
inverse	O
will	O
exactly	O
match	O
the	O
original	O
data	O
if	O
the	O
chosen	O
sinusoids	O
are	O
mutually	O
independent	O
at	O
the	O
sample	O
points	O
and	O
their	O
number	O
is	O
equal	O
to	O
the	O
number	O
of	O
data	O
points	O
.	O
</s>
<s>
The	O
LSSA	B-General_Concept
can	O
be	O
implemented	O
in	O
less	O
than	O
a	O
page	O
of	O
MATLAB	B-Language
code	O
.	O
</s>
<s>
I.e.	O
,	O
for	O
each	O
frequency	O
in	O
a	O
desired	O
set	O
of	O
frequencies	O
,	O
sine	O
and	O
cosine	O
functions	O
are	O
evaluated	O
at	O
the	O
times	O
corresponding	O
to	O
the	O
data	O
samples	O
,	O
and	O
dot	O
products	O
of	O
the	O
data	O
vector	O
with	O
the	O
sinusoid	O
vectors	O
are	O
taken	O
and	O
appropriately	O
normalized	O
;	O
following	O
the	O
method	O
known	O
as	O
Lomb/Scargle	O
periodogram	O
,	O
a	O
time	O
shift	O
is	O
calculated	O
for	O
each	O
frequency	O
to	O
orthogonalize	O
the	O
sine	O
and	O
cosine	O
components	O
before	O
the	O
dot	O
product	O
;	O
finally	O
,	O
a	O
power	O
is	O
computed	O
from	O
those	O
two	O
amplitude	B-Application
components	O
.	O
</s>
<s>
This	O
same	O
process	O
implements	O
a	O
discrete	B-Algorithm
Fourier	I-Algorithm
transform	I-Algorithm
when	O
the	O
data	O
are	O
uniformly	O
spaced	O
in	O
time	O
and	O
the	O
frequencies	O
chosen	O
correspond	O
to	O
integer	O
numbers	O
of	O
cycles	O
over	O
the	O
finite	O
data	O
record	O
.	O
</s>
<s>
In	O
addition	O
,	O
it	O
is	O
possible	O
to	O
perform	O
a	O
full	O
simultaneous	O
or	O
in-context	O
least-squares	B-Algorithm
fit	I-Algorithm
by	O
solving	O
a	O
matrix	O
equation	O
and	O
partitioning	O
the	O
total	O
data	O
variance	O
between	O
the	O
specified	O
sinusoid	O
frequencies	O
.	O
</s>
<s>
Such	O
a	O
matrix	O
least-squares	B-Algorithm
solution	O
is	O
natively	O
available	O
in	O
MATLAB	B-Language
as	O
the	O
backslash	O
operator	O
.	O
</s>
<s>
However	O
,	O
as	O
mentioned	O
above	O
,	O
one	O
should	O
keep	O
in	O
mind	O
that	O
Lomb	O
's	O
simplification	O
and	O
diverging	O
from	O
the	O
least	B-Algorithm
squares	I-Algorithm
criterion	O
opened	O
up	O
his	O
technique	O
to	O
grave	O
sources	O
of	O
errors	O
,	O
resulting	O
even	O
in	O
false	O
spectral	O
peaks	O
.	O
</s>
<s>
In	O
Fourier	O
analysis	O
,	O
such	O
as	O
the	O
Fourier	B-Algorithm
transform	I-Algorithm
and	O
discrete	B-Algorithm
Fourier	I-Algorithm
transform	I-Algorithm
,	O
the	O
sinusoids	O
fitted	O
to	O
data	O
are	O
all	O
mutually	O
orthogonal	O
,	O
so	O
there	O
is	O
no	O
distinction	O
between	O
the	O
simple	O
out-of-context	O
dot-product-based	O
projection	O
onto	O
basis	O
functions	O
versus	O
an	O
in-context	O
simultaneous	O
least-squares	B-Algorithm
fit	I-Algorithm
;	O
that	O
is	O
,	O
no	O
matrix	O
inversion	O
is	O
required	O
to	O
least-squares	B-Algorithm
partition	O
the	O
variance	O
between	O
orthogonal	O
sinusoids	O
of	O
different	O
frequencies	O
.	O
</s>
<s>
In	O
the	O
past	O
,	O
Fourier	O
's	O
was	O
for	O
many	O
a	O
method	O
of	O
choice	O
thanks	O
to	O
its	O
processing-efficient	O
fast	O
Fourier	B-Algorithm
transform	I-Algorithm
implementation	O
when	O
complete	O
data	O
records	O
with	O
equally	O
spaced	O
samples	O
are	O
available	O
,	O
and	O
they	O
used	O
the	O
Fourier	O
family	O
of	O
techniques	O
to	O
analyze	O
gapped	O
records	O
as	O
well	O
,	O
which	O
,	O
however	O
,	O
required	O
manipulating	O
and	O
even	O
inventing	O
non-existent	O
data	O
just	O
so	O
to	O
be	O
able	O
to	O
run	O
a	O
Fourier-based	O
algorithm	O
.	O
</s>
