<s>
Probabilistic	B-General_Concept
context	I-General_Concept
free	I-General_Concept
grammars	I-General_Concept
(	O
PCFGs	B-General_Concept
)	O
have	O
been	O
applied	O
in	O
probabilistic	O
modeling	O
of	O
RNA	O
structures	O
almost	O
40	O
years	O
after	O
they	O
were	O
introduced	O
in	O
computational	O
linguistics	O
.	O
</s>
<s>
PCFGs	B-General_Concept
extend	O
context-free	O
grammars	O
similar	O
to	O
how	O
hidden	O
Markov	O
models	O
extend	O
regular	O
grammars	O
.	O
</s>
<s>
The	O
probability	O
of	O
a	O
derivation	O
(	O
parse	B-Language
)	O
is	O
the	O
product	O
of	O
the	O
probabilities	O
of	O
the	O
productions	O
used	O
in	O
that	O
derivation	O
.	O
</s>
<s>
PCFGs	B-General_Concept
have	O
application	O
in	O
areas	O
as	O
diverse	O
as	O
natural	B-Language
language	I-Language
processing	I-Language
to	O
the	O
study	O
the	O
structure	O
of	O
RNA	O
molecules	O
and	O
design	O
of	O
programming	O
languages	O
.	O
</s>
<s>
Designing	O
efficient	O
PCFGs	B-General_Concept
has	O
to	O
weigh	O
factors	O
of	O
scalability	O
and	O
generality	O
.	O
</s>
<s>
Grammar	O
parsing	B-Language
algorithms	O
have	O
various	O
time	O
and	O
memory	O
requirements	O
.	O
</s>
<s>
Parsing	B-Language
:	O
Finding	O
a	O
valid	O
derivation	O
using	O
an	O
automaton	O
.	O
</s>
<s>
Parse	B-Language
Tree	O
:	O
The	O
alignment	O
of	O
the	O
grammar	O
to	O
a	O
sequence	O
.	O
</s>
<s>
An	O
example	O
of	O
a	O
parser	O
for	O
PCFG	B-General_Concept
grammars	O
is	O
the	O
pushdown	B-Application
automaton	I-Application
.	O
</s>
<s>
The	O
algorithm	O
parses	B-Language
grammar	O
nonterminals	O
from	O
left	O
to	O
right	O
in	O
a	O
stack-like	O
manner	O
.	O
</s>
<s>
This	O
brute-force	B-Algorithm
approach	O
is	O
not	O
very	O
efficient	O
.	O
</s>
<s>
In	O
RNA	O
secondary	O
structure	O
prediction	O
variants	O
of	O
the	O
Cocke	O
–	O
Younger	O
–	O
Kasami	O
(	O
CYK	B-Application
)	O
algorithm	O
provide	O
more	O
efficient	O
alternatives	O
to	O
grammar	O
parsing	B-Language
than	O
pushdown	B-Application
automata	I-Application
.	O
</s>
<s>
Another	O
example	O
of	O
a	O
PCFG	B-General_Concept
parser	O
is	O
the	O
Stanford	O
Statistical	O
Parser	O
which	O
has	O
been	O
trained	O
using	O
Treebank	O
.	O
</s>
<s>
Similar	O
to	O
a	O
CFG	O
,	O
a	O
probabilistic	B-General_Concept
context-free	I-General_Concept
grammar	I-General_Concept
can	O
be	O
defined	O
by	O
a	O
quintuple	O
:	O
</s>
<s>
PCFGs	B-General_Concept
models	O
extend	O
context-free	O
grammars	O
the	O
same	O
way	O
as	O
hidden	O
Markov	O
models	O
extend	O
regular	O
grammars	O
.	O
</s>
<s>
The	O
Inside-Outside	B-Application
algorithm	I-Application
is	O
an	O
analogue	O
of	O
the	O
Forward-Backward	B-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
It	O
computes	O
the	O
total	O
probability	O
of	O
all	O
derivations	O
that	O
are	O
consistent	O
with	O
a	O
given	O
sequence	O
,	O
based	O
on	O
some	O
PCFG	B-General_Concept
.	O
</s>
<s>
This	O
is	O
equivalent	O
to	O
the	O
probability	O
of	O
the	O
PCFG	B-General_Concept
generating	O
the	O
sequence	O
,	O
and	O
is	O
intuitively	O
a	O
measure	O
of	O
how	O
consistent	O
the	O
sequence	O
is	O
with	O
the	O
given	O
grammar	O
.	O
</s>
<s>
The	O
Inside-Outside	B-Application
algorithm	I-Application
is	O
used	O
in	O
model	O
parametrization	O
to	O
estimate	O
prior	O
frequencies	O
observed	O
from	O
training	O
sequences	O
in	O
the	O
case	O
of	O
RNAs	O
.	O
</s>
<s>
Dynamic	B-Algorithm
programming	I-Algorithm
variants	O
of	O
the	O
CYK	B-Application
algorithm	I-Application
find	O
the	O
Viterbi	B-Algorithm
parse	I-Algorithm
of	O
a	O
RNA	O
sequence	O
for	O
a	O
PCFG	B-General_Concept
model	O
.	O
</s>
<s>
This	O
parse	B-Language
is	O
the	O
most	O
likely	O
derivation	O
of	O
the	O
sequence	O
by	O
the	O
given	O
PCFG	B-General_Concept
.	O
</s>
<s>
In	O
the	O
production	O
rules	O
of	O
CFG	O
and	O
PCFG	B-General_Concept
the	O
left	O
side	O
has	O
only	O
one	O
nonterminal	O
whereas	O
the	O
right	O
side	O
can	O
be	O
any	O
string	O
of	O
terminal	O
or	O
nonterminals	O
.	O
</s>
<s>
In	O
PCFG	B-General_Concept
nulls	O
are	O
excluded	O
.	O
</s>
<s>
Ambiguous	O
grammar	O
may	O
result	O
in	O
ambiguous	O
parsing	B-Language
if	O
applied	O
on	O
homographs	O
since	O
the	O
same	O
word	O
sequence	O
can	O
have	O
more	O
than	O
one	O
interpretation	O
.	O
</s>
<s>
Pun	B-Application
sentences	I-Application
such	O
as	O
the	O
newspaper	O
headline	O
"	O
Iraqi	O
Head	O
Seeks	O
Arms	O
"	O
are	O
an	O
example	O
of	O
ambiguous	O
parses	B-Language
.	O
</s>
<s>
One	O
strategy	O
of	O
dealing	O
with	O
ambiguous	O
parses	B-Language
(	O
originating	O
with	O
grammarians	O
as	O
early	O
as	O
Pāṇini	O
)	O
is	O
to	O
add	O
yet	O
more	O
rules	O
,	O
or	O
prioritize	O
them	O
so	O
that	O
one	O
rule	O
takes	O
precedence	O
over	O
others	O
.	O
</s>
<s>
Assigning	O
probability	O
to	O
production	O
rules	O
makes	O
a	O
PCFG	B-General_Concept
.	O
</s>
<s>
The	O
weight	O
of	O
a	O
specific	O
parse	B-Language
tree	O
in	O
a	O
WCFG	O
is	O
the	O
product	O
(	O
or	O
sum	O
)	O
of	O
all	O
rule	O
weights	O
in	O
the	O
tree	O
.	O
</s>
<s>
A	O
special	O
case	O
of	O
WCFGs	O
are	O
PCFGs	B-General_Concept
,	O
where	O
the	O
weights	O
are	O
(	O
logarithms	O
of	O
)	O
probabilities	O
.	O
</s>
<s>
An	O
extended	O
version	O
of	O
the	O
CYK	B-Application
algorithm	I-Application
can	O
be	O
used	O
to	O
find	O
the	O
"	O
lightest	O
"	O
(	O
least-weight	O
)	O
derivation	O
of	O
a	O
string	O
given	O
some	O
WCFG	O
.	O
</s>
<s>
When	O
the	O
tree	O
weight	O
is	O
the	O
product	O
of	O
the	O
rule	O
weights	O
,	O
WCFGs	O
and	O
PCFGs	B-General_Concept
can	O
express	O
the	O
same	O
set	O
of	O
probability	O
distributions	O
.	O
</s>
<s>
Energy	O
minimization	O
and	O
PCFG	B-General_Concept
provide	O
ways	O
of	O
predicting	O
RNA	O
secondary	O
structure	O
with	O
comparable	O
performance	O
.	O
</s>
<s>
However	O
structure	O
prediction	O
by	O
PCFGs	B-General_Concept
is	O
scored	O
probabilistically	O
rather	O
than	O
by	O
minimum	O
free	O
energy	O
calculation	O
.	O
</s>
<s>
The	O
types	O
of	O
various	O
structure	O
that	O
can	O
be	O
modeled	O
by	O
a	O
PCFG	B-General_Concept
include	O
long	O
range	O
interactions	O
,	O
pairwise	O
structure	O
and	O
other	O
nested	O
structures	O
.	O
</s>
<s>
PCFGs	B-General_Concept
extend	O
CFG	O
by	O
assigning	O
probabilities	O
to	O
each	O
production	O
rule	O
.	O
</s>
<s>
A	O
maximum	O
probability	O
parse	B-Language
tree	O
from	O
the	O
grammar	O
implies	O
a	O
maximum	O
probability	O
structure	O
.	O
</s>
<s>
Also	O
search	O
results	O
for	O
structural	O
homologs	O
using	O
PCFG	B-General_Concept
rules	O
are	O
scored	O
according	O
to	O
PCFG	B-General_Concept
derivations	O
probabilities	O
.	O
</s>
<s>
A	O
PCFG	B-General_Concept
model	O
extendibility	O
allows	O
constraining	O
structure	O
prediction	O
by	O
incorporating	O
expectations	O
about	O
different	O
features	O
of	O
an	O
RNA	O
.	O
</s>
<s>
However	O
incorporation	O
of	O
too	O
much	O
information	O
may	O
increase	O
PCFG	B-General_Concept
space	O
and	O
memory	O
complexity	O
and	O
it	O
is	O
desirable	O
that	O
a	O
PCFG-based	O
model	O
be	O
as	O
simple	O
as	O
possible	O
.	O
</s>
<s>
Every	O
possible	O
string	O
a	O
grammar	O
generates	O
is	O
assigned	O
a	O
probability	O
weight	O
given	O
the	O
PCFG	B-General_Concept
model	O
.	O
</s>
<s>
RNA	O
secondary	O
structure	O
implementations	O
based	O
on	O
PCFG	B-General_Concept
approaches	O
can	O
be	O
utilized	O
in	O
:	O
</s>
<s>
PCFG	B-General_Concept
design	O
impacts	O
the	O
secondary	O
structure	O
prediction	O
accuracy	O
.	O
</s>
<s>
Any	O
useful	O
structure	O
prediction	O
probabilistic	O
model	O
based	O
on	O
PCFG	B-General_Concept
has	O
to	O
maintain	O
simplicity	O
without	O
much	O
compromise	O
to	O
prediction	O
accuracy	O
.	O
</s>
<s>
Find	O
the	O
optimal	O
alignment	O
between	O
a	O
sequence	O
and	O
the	O
PCFG	B-General_Concept
.	O
</s>
<s>
Find	O
the	O
optimal	O
grammar	O
parse	B-Language
tree	O
(	O
CYK	B-Application
algorithm	I-Application
)	O
.	O
</s>
<s>
The	O
resulting	O
of	O
multiple	O
parse	B-Language
trees	O
per	O
grammar	O
denotes	O
grammar	O
ambiguity	O
.	O
</s>
<s>
However	O
an	O
optimal	O
structure	O
is	O
the	O
one	O
where	O
there	O
is	O
one	O
and	O
only	O
one	O
correspondence	O
between	O
the	O
parse	B-Language
tree	O
and	O
the	O
secondary	O
structure	O
.	O
</s>
<s>
Parse	B-Language
tree	O
ambiguity	O
and	O
structural	O
ambiguity	O
.	O
</s>
<s>
Parse	B-Language
tree	O
ambiguity	O
concerns	O
the	O
existence	O
of	O
multiple	O
parse	B-Language
trees	O
per	O
sequence	O
.	O
</s>
<s>
Such	O
an	O
ambiguity	O
can	O
reveal	O
all	O
possible	O
base-paired	O
structures	O
for	O
the	O
sequence	O
by	O
generating	O
all	O
possible	O
parse	B-Language
trees	O
then	O
finding	O
the	O
optimal	O
one	O
.	O
</s>
<s>
In	O
the	O
case	O
of	O
structural	O
ambiguity	O
multiple	O
parse	B-Language
trees	O
describe	O
the	O
same	O
secondary	O
structure	O
.	O
</s>
<s>
This	O
obscures	O
the	O
CYK	B-Application
algorithm	I-Application
decision	O
on	O
finding	O
an	O
optimal	O
structure	O
as	O
the	O
correspondence	O
between	O
the	O
parse	B-Language
tree	O
and	O
the	O
structure	O
is	O
not	O
unique	O
.	O
</s>
<s>
A	O
probabilistic	B-General_Concept
context	I-General_Concept
free	I-General_Concept
grammar	I-General_Concept
consists	O
of	O
terminal	O
and	O
nonterminal	O
variables	O
.	O
</s>
<s>
The	O
formalism	O
of	O
this	O
simple	O
PCFG	B-General_Concept
looks	O
like	O
:	O
</s>
<s>
The	O
application	O
of	O
PCFGs	B-General_Concept
in	O
predicting	O
structures	O
is	O
a	O
multi-step	O
process	O
.	O
</s>
<s>
In	O
addition	O
,	O
the	O
PCFG	B-General_Concept
itself	O
can	O
be	O
incorporated	O
into	O
probabilistic	O
models	O
that	O
consider	O
RNA	O
evolutionary	O
history	O
or	O
search	O
homologous	O
sequences	O
in	O
databases	O
.	O
</s>
<s>
In	O
an	O
evolutionary	O
history	O
context	O
inclusion	O
of	O
prior	O
distributions	O
of	O
RNA	O
structures	O
of	O
a	O
structural	O
alignment	O
in	O
the	O
production	O
rules	O
of	O
the	O
PCFG	B-General_Concept
facilitates	O
good	O
prediction	O
accuracy	O
.	O
</s>
<s>
A	O
summary	O
of	O
general	O
steps	O
for	O
utilizing	O
PCFGs	B-General_Concept
in	O
various	O
scenarios	O
:	O
</s>
<s>
Recursively	O
generate	O
parse	B-Language
trees	O
of	O
the	O
possible	O
structures	O
using	O
the	O
grammar	O
.	O
</s>
<s>
Rank	O
and	O
score	O
the	O
parse	B-Language
trees	O
for	O
the	O
most	O
plausible	O
sequence	O
.	O
</s>
<s>
Several	O
algorithms	O
dealing	O
with	O
aspects	O
of	O
PCFG	B-General_Concept
based	O
probabilistic	O
models	O
in	O
RNA	O
structure	O
prediction	O
exist	O
.	O
</s>
<s>
For	O
instance	O
the	O
inside-outside	B-Application
algorithm	I-Application
and	O
the	O
CYK	B-Application
algorithm	I-Application
.	O
</s>
<s>
The	O
inside-outside	B-Application
algorithm	I-Application
is	O
a	O
recursive	O
dynamic	B-Algorithm
programming	I-Algorithm
scoring	O
algorithm	O
that	O
can	O
follow	O
expectation-maximization	B-Algorithm
paradigms	O
.	O
</s>
<s>
It	O
computes	O
the	O
total	O
probability	O
of	O
all	O
derivations	O
that	O
are	O
consistent	O
with	O
a	O
given	O
sequence	O
,	O
based	O
on	O
some	O
PCFG	B-General_Concept
.	O
</s>
<s>
The	O
inside	O
part	O
scores	O
the	O
subtrees	O
from	O
a	O
parse	B-Language
tree	O
and	O
therefore	O
subsequences	O
probabilities	O
given	O
an	O
PCFG	B-General_Concept
.	O
</s>
<s>
The	O
outside	O
part	O
scores	O
the	O
probability	O
of	O
the	O
complete	O
parse	B-Language
tree	O
for	O
a	O
full	O
sequence	O
.	O
</s>
<s>
CYK	B-Application
modifies	O
the	O
inside-outside	O
scoring	O
.	O
</s>
<s>
Note	O
that	O
the	O
term	O
'	O
CYK	B-Application
algorithm	I-Application
 '	O
describes	O
the	O
CYK	B-Application
variant	O
of	O
the	O
inside	O
algorithm	O
that	O
finds	O
an	O
optimal	O
parse	B-Language
tree	O
for	O
a	O
sequence	O
using	O
a	O
PCFG	B-General_Concept
.	O
</s>
<s>
It	O
extends	O
the	O
actual	O
CYK	B-Application
algorithm	I-Application
used	O
in	O
non-probabilistic	O
CFGs	O
.	O
</s>
<s>
The	O
inside	O
algorithm	O
calculates	O
probabilities	O
for	O
all	O
of	O
a	O
parse	B-Language
subtree	O
rooted	O
at	O
for	O
subsequence	O
.	O
</s>
<s>
Outside	O
algorithm	O
calculates	O
probabilities	O
of	O
a	O
complete	O
parse	B-Language
tree	O
for	O
sequence	O
from	O
root	O
excluding	O
the	O
calculation	O
of	O
.	O
</s>
<s>
The	O
variables	O
and	O
refine	O
the	O
estimation	O
of	O
probability	O
parameters	O
of	O
an	O
PCFG	B-General_Concept
.	O
</s>
<s>
It	O
is	O
possible	O
to	O
reestimate	O
the	O
PCFG	B-General_Concept
algorithm	O
by	O
finding	O
the	O
expected	O
number	O
of	O
times	O
a	O
state	O
is	O
used	O
in	O
a	O
derivation	O
through	O
summing	O
all	O
the	O
products	O
of	O
and	O
divided	O
by	O
the	O
probability	O
for	O
a	O
sequence	O
given	O
the	O
model	O
.	O
</s>
<s>
It	O
is	O
also	O
possible	O
to	O
find	O
the	O
expected	O
number	O
of	O
times	O
a	O
production	O
rule	O
is	O
used	O
by	O
an	O
expectation-maximization	B-Algorithm
that	O
utilizes	O
the	O
values	O
of	O
and	O
.	O
</s>
<s>
The	O
CYK	B-Application
algorithm	I-Application
calculates	O
to	O
find	O
the	O
most	O
probable	O
parse	B-Language
tree	O
and	O
yields	O
.	O
</s>
<s>
Memory	O
and	O
time	O
complexity	O
for	O
general	O
PCFG	B-General_Concept
algorithms	O
in	O
RNA	O
structure	O
predictions	O
are	O
and	O
respectively	O
.	O
</s>
<s>
Restricting	O
a	O
PCFG	B-General_Concept
may	O
alter	O
this	O
requirement	O
as	O
is	O
the	O
case	O
with	O
database	O
searches	O
methods	O
.	O
</s>
<s>
Covariance	O
models	O
(	O
CMs	O
)	O
are	O
a	O
special	O
type	O
of	O
PCFGs	B-General_Concept
with	O
applications	O
in	O
database	O
searches	O
for	O
homologs	O
,	O
annotation	O
and	O
RNA	O
classification	O
.	O
</s>
<s>
Through	O
CMs	O
it	O
is	O
possible	O
to	O
build	O
PCFG-based	O
RNA	O
profiles	O
where	O
related	O
RNAs	O
can	O
be	O
represented	O
by	O
a	O
consensus	O
secondary	O
structure	O
.	O
</s>
<s>
In	O
order	O
to	O
score	O
a	O
CM	O
model	O
the	O
inside-outside	B-Application
algorithms	I-Application
are	O
used	O
.	O
</s>
<s>
CMs	O
use	O
a	O
slightly	O
different	O
implementation	O
of	O
CYK	B-Application
.	O
</s>
<s>
Log-odds	O
emission	O
scores	O
for	O
the	O
optimum	O
parse	B-Language
tree	O
-	O
-	O
are	O
calculated	O
out	O
of	O
the	O
emitting	O
states	O
.	O
</s>
<s>
Since	O
these	O
scores	O
are	O
a	O
function	O
of	O
sequence	O
length	O
a	O
more	O
discriminative	O
measure	O
to	O
recover	O
an	O
optimum	O
parse	B-Language
tree	O
probability	O
score	O
-	O
-	O
is	O
reached	O
by	O
limiting	O
the	O
maximum	O
length	O
of	O
the	O
sequence	O
to	O
be	O
aligned	O
and	O
calculating	O
the	O
log-odds	O
relative	O
to	O
a	O
null	O
.	O
</s>
<s>
The	O
PCFG	B-General_Concept
is	O
used	O
to	O
predict	O
the	O
prior	O
probability	O
distribution	O
of	O
the	O
structure	O
whereas	O
posterior	O
probabilities	O
are	O
estimated	O
by	O
the	O
inside-outside	B-Application
algorithm	I-Application
and	O
the	O
most	O
likely	O
structure	O
is	O
found	O
by	O
the	O
CYK	B-Application
algorithm	I-Application
.	O
</s>
<s>
The	O
prior	O
distribution	O
given	O
by	O
the	O
PCFG	B-General_Concept
is	O
.	O
</s>
<s>
Note	O
that	O
gaps	O
are	O
treated	O
as	O
unknown	O
bases	O
and	O
the	O
summation	O
can	O
be	O
done	O
through	O
dynamic	B-Algorithm
programming	I-Algorithm
.	O
</s>
<s>
Given	O
the	O
prior	O
alignment	O
frequencies	O
of	O
the	O
data	O
the	O
most	O
likely	O
structure	O
from	O
the	O
ensemble	O
predicted	O
by	O
the	O
grammar	O
can	O
then	O
be	O
computed	O
by	O
maximizing	O
through	O
the	O
CYK	B-Application
algorithm	I-Application
.	O
</s>
<s>
PCFG	B-General_Concept
based	O
approaches	O
are	O
desired	O
to	O
be	O
scalable	O
and	O
general	O
enough	O
.	O
</s>
<s>
In	O
Pfold	O
the	O
tree	O
is	O
calculated	O
prior	O
to	O
structure	O
prediction	O
through	O
neighbor	O
joining	O
and	O
not	O
by	O
maximum	O
likelihood	O
through	O
the	O
PCFG	B-General_Concept
grammar	O
.	O
</s>
<s>
Whereas	O
PCFGs	B-General_Concept
have	O
proved	O
powerful	O
tools	O
for	O
predicting	O
RNA	O
secondary	O
structure	O
,	O
usage	O
in	O
the	O
field	O
of	O
protein	O
sequence	O
analysis	O
has	O
been	O
limited	O
.	O
</s>
<s>
Still	O
,	O
development	O
of	O
PCFGs	B-General_Concept
allows	O
expressing	O
some	O
of	O
those	O
dependencies	O
and	O
providing	O
the	O
ability	O
to	O
model	O
a	O
wider	O
range	O
of	O
protein	O
patterns	O
.	O
</s>
