query syntax?

65 views
Skip to first unread message

Erik

unread,
Feb 10, 2011, 8:09:30 AM2/10/11
to OxCal
Hello -

in the last thread, Christopher helped me apply multiple constraints.
Part of this same model uses "shorthand" syntax, and I don't know how
to use this syntax for queries. The model has two phases (dates A-E
and G-I). I want to query the sum of each phase, and the interval
between them. What is the syntax? thanks!

Plot()
{
A=R_Date("GaK-192",1990,100);
B=R_Date("P-532a",1956,76) & R_Date("P-532b",1847,75);
C=R_Date("GaK-193",1850,90);
D=R_Date("M-1051",1780,150);
E=R_Date("M-1050",1760,150);
G=R_Date("P-534",1866,62);
H=R_Date("GaK-195",1750,100);
I=R_Date("Hv-19",1645,80);
J=R_Date("Hv-18",1630,130);

P_Sequence("Three dates with known depths",100)
{
Date("=G") { z=2.16; };
Date("=I" ) { z=1.80; };
Date("=J") { z=1.75; };
};
Boundary() < (A|B|C|D|E) < (G|H|I) < J < Boundary();
};

Christopher Ramsey

unread,
Feb 16, 2011, 11:47:11 AM2/16/11
to ox...@googlegroups.com
Erik

In fact the (A|B|C|D|E) syntax automatically calculates the Sum.

In terms of bitwise logic

A | B

is like A or B and so gives an average of the distributions (aka Sum).

A * B

is like A and B and so gives the produce - like Combine.

Anyway - you can also put other commands within the notation so I think this should work:

(A|B|C|D|E|First()|Last())

as this translates to:

Sum()
{
Date("=A");
Date("=B");
Date("=C");
Date("=D");
Date("=E");
First();
Last();
};

Now supposing you want the Sum of all the elements between the boundaries - you can trick it into doing this by adding, for example First and Last statements which don't actually add any extra events:

Boundary() < (((A|B|C|D|E) < (G|H|I) < J)|Last()|First()) < Boundary();

This is the same as (and effectively gets translated into):

Sequence()
{
Boundary();
Sum()
{
Sequence()
{
Sum()
{
Date("=A");
Date("=B");
Date("=C");
Date("=D");
Date("=E");
};
Sum()
{
Date("=G");
Date("=H");
Date("=I");
};
Date("=J");
};
First();
Last();
};
Boundary();
};

Christopher

> --
> You received this message because you are subscribed to the Google Groups "OxCal" group.
> To post to this group, send an email to ox...@googlegroups.com.
> To unsubscribe from this group, send email to oxcal+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/oxcal?hl=en-GB.
>

Erik

unread,
Feb 18, 2011, 11:58:36 PM2/18/11
to OxCal
thanks for the help with these syntax details! slowly I am getting the
hang of it.

Seren Griffiths

unread,
Mar 3, 2011, 2:59:24 AM3/3/11
to ox...@googlegroups.com
Hi Chris

This is probably my omission apologies if so. I can't seem to be able to see the example segment of the MCMC trial sequence  on individual graphs. the options are nested thus (I turned on the 3 SD just to check the options were being calculated):

 Options()
 {
  SD3=TRUE;
  ConvergenceData=TRUE;
 };
 Plot()
 {
  Sequence()
  {
   Boundary("Start NE neo");
   Phase("north east")
   {
   };
  };
};

I opened the output of a model that had successfully shown the convergence graphs before, and this wasn't plotting the sample segment either (I've tried this on both online and stand alone versions), any tips?

Many thanks
S

Christopher Ramsey

unread,
Mar 3, 2011, 5:09:53 AM3/3/11
to ox...@googlegroups.com
Seren

The option header:

Options()
{
ConvergenceData=TRUE;
};

makes sure that the convergence data is stored in the output file. To actually show it in the plots you also have to turn on the Convergence option under [Format > Plot] in the output page. This is so you can produce plots with and without the convergence data without rerunning the analysis.

Christopher

Seren Griffiths

unread,
Mar 3, 2011, 6:06:08 AM3/3/11
to ox...@googlegroups.com
THANKS!

-----ox...@googlegroups.com wrote: -----
To: "ox...@googlegroups.com" <ox...@googlegroups.com>
From: Christopher Ramsey
Sent by: ox...@googlegroups.com
Date: 03/03/2011 10:10AM
Subject: Re: convergence data
Reply all
Reply to author
Forward
0 new messages