P seq spikes

47 views
Skip to first unread message

Kate

unread,
Mar 24, 2025, 7:12:00 PMMar 24
to OxCal
Hello-
I am working on P_sequences for a paleoseismic site; the sedimentation rate is expected to be quite variable (mm to m), so I have started off with the suggested variable k 
P_Sequence("PC Trad R4", 1, 2, U(-2,2))

This produces strange spikes in the posteriors (see attached), which visually look like the MCMC is getting stuck in a local optima. Increasing Kiterations did not effect results. Suggestions? 

I've tested with a straight P_Sequence(1), which quickly and produces acceptable results so I don't think its in the body of the code.

Kate


Screenshot 2025-03-24 at 3.51.53 PM.png

Christopher Ramsey

unread,
Mar 25, 2025, 7:19:25 AMMar 25
to OxCal group
Dear Kate

I think given the spikes are only in the lower elements it is probably the very unconstrained solutions which are causing the issue (low k). Given this the first think to try might be to raise the lower limit on this with U(-1,2) or U(-0.5,2) - you can check the marginal posterior for this k distribution to see what is going on.

Best wishes

Christopher
> --
> You received this message because you are subscribed to the Google Groups "OxCal" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to oxcal+un...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/oxcal/3e5cb3aa-f724-4a2d-aa9a-1cc2790f8892n%40googlegroups.com.
> <Screenshot 2025-03-24 at 3.51.53 PM.png>

Kate

unread,
Mar 27, 2025, 1:26:59 PMMar 27
to OxCal
Hi Christopher-
Thanks for your suggestion.  The k distribution is still spikey (attached) - the posteriors often sit at the low probability edges of the priors.  

I have not used interior boundaries, under premise that the variable k will allow for it, but wonder if this is demanded given the significant rate changes.   

Happy Weekend,
Kate
Screenshot 2025-03-27 at 10.17.46 AM.png
Screenshot 2025-03-27 at 10.11.07 AM.png

Christopher Ramsey

unread,
Mar 27, 2025, 2:09:07 PMMar 27
to OxCal group
Dear Kate

Ok- unless you want to post the full code here you could contact me directly to see if I can see why this is happening - it looks as if you have poor covergence for some reason. The plot suggests that you have some internal structure in the sequence though which I don't quite understand - as you should not have Phases in a P_Sequence?

Best wishes

Christopher
> To view this discussion visit https://groups.google.com/d/msgid/oxcal/1d5d3fed-27f7-46b8-afbf-9d5b2d898743n%40googlegroups.com.
> <Screenshot 2025-03-27 at 10.17.46 AM.png><Screenshot 2025-03-27 at 10.11.07 AM.png>

Kate

unread,
Apr 1, 2025, 1:39:47 PMApr 1
to OxCal
Christopher,
I had forgotten no phases in P_Seqs!  Thanks for that reminder.  I removed, and also reconsidered my choice in k.  The depth values have fractions (eg 100.5 cm), so I understand k=0.1 would be more appropriate (or converting all depths to mm and using k=1000).  I ran both using the stable k (it runs a lot quicker) and this did reduce the spikiness, but some strange splits in the posteriors remain.  The variable k approach,  P_Sequence("", 0.1, 1, U(-0.5,2)) was problematic, similar  to the previous (k distro below).  
Screenshot 2025-04-01 at 10.22.09 AM.png
I note that there are a handful of high precision dates with very low uncertainties (~15 yrs)- notably one at the very bottom- and wonder if that sets up the split?

For context, the dates currently included produce an acceptable Sequence, dates that were stratigraphically too old have been removed, as we know there is significant charcoal inheritance at the site.  A few parts of the section are still rather ugly; I had planned to gain insight by using the P_Sequence. 

The code is below, I look forward to your insight!
Kate

Plot()

 {

  P_Sequence("PCR4c", 0.1, 1, U(-0.5,2))

  {

   Boundary("Bottom")

   {

    z=620;

   };

   R_Date("26.1-QL-1967",1410.0,14.1)

   {

    z=618;

   };

   R_Date("A-2150",1524,112)

   {

    z=609.5;

   };

   R_Date("A-2153",1519,88)

   {

    z=609.5;

   };

   R_Date("USGS-902",1351,56)

   {

    z=599.5;

   };

   R_Date("QL-1969",1323.0,16.2)

   {

    z=599.5;

   };

   Date("EQ C")

   {

    z=597.5;

   };

   R_Date("QL-1968",1270,15.8)

   {

    z=597.5;

   };

   R_Date("31-USGS-901",1336,80)

   {

    z=579.5;

   };

   R_Date("32.1-186855",1265,35)

   {

    z=554.5;

   };

   R_Date("186853",1285,30)

   {

    z=491.5;

   };

   R_Date("33.1-143588",1280,30)

   {

    z=456.5;

   };

   R_Date("143590",1300,30)

   {

    z=450.5;

   };

   R_Date("QL-1970",1259.0,15.7)

   {

    z=450.5;

   };

   R_Date("QL-1971",1291.0,15.8)

   {

    z=444.5;

   };

   R_Date("143591",1280,30)

   {

    z=444.5;

   };

   R_Date("34.1-143531",1250,30)

   {

    z=436.5;

   };

   Date("EQ D")

   {

    z=430;

   };

   R_Date("35-143593",1260,30)

   {

    z=376.6;

   };

   R_Date("186781",1175,30)

   {

    z=373.5;

   };

   R_Date("136467",1140,55)

   {

    z=373.5;

   };

   R_Date("QL-1950",1223.0,15.8)

   {

    z=360.5;

   };

   R_Date("QL-1973",1215.0,16.7)

   {

    z=360.5;

   };

   R_Date("136463",1190,30)

   {

    z=360.5;

   };

   R_Date("140077",1185,35)

   {

    z=360.5;

   };

   R_Date("I-9590",1052,143)

   {

    z=360.5;

   };

   Date("EQ F")

   {

    z=359;

   };

   R_Date("41-USGS-139",1162,111)

   {

    z=338.5;

   };

   R_Date("43.1-136487",1090,60)

   {

    z=326;

   };

   R_Date("136489",1165,60)

   {

    z=312;

   };

   R_Date("136488",1110,60)

   {

    z=312;

   };

   R_Date("136473",1115,60)

   {

    z=310;

   };

   R_Date("143529",1085,30)

   {

    z=309.5;

   };

   R_Date("186802",1160,40)

   {

    z=306.5;

   };

   R_Date("USGS-138",1103,119)

   {

    z=305.5;

   };

   R_Date("QL-1951",1076.1,17.1)

   {

    z=305.5;

   };

   Date("EQ I")

   {

    z=303;

   };

   R_Date("QL-1952",1058.3,15.7)

   {

    z=301.5;

   };

   R_Date("QL-1976",1005,16.2)

   {

    z=301.5;

   };

   R_Date("136474",915,70)

   {

    z=301.5;

   };

   R_Date("188717",1085,40)

   {

    z=300.5;

   };

   R_Date("188641",1080,40)

   {

    z=300.5;

   };

   R_Date("143536",1090,35)

   {

    z=299.5;

   };

   R_Date("188640",1070,35)

   {

    z=299.5;

   };

   R_Date("USGS-83",1107,87)

   {

    z=292.5;

   };

   R_Date("136455",875,35)

   {

    z=292.5;

   };

   R_Date("136456",835,60)

   {

    z=292.5;

   };

   R_Date("52-140076",950,30)

   {

    z=262.5;

   };

   Date("EQ N")

   {

    z=255;

   };

   R_Date("UW-573",907,95)

   {

    z=219.5;

   };

   R_Date("55-143594",970,30)

   {

    z=211.5;

   };

   R_Date("59.2-143597",910,30)

   {

    z=196.5;

   };

   Date("EQ R")

   {

    z=196.5;

   };

   R_Date("QL-1977b",906.0,13.6)

   {

    z=196.5;

   };

   R_Date("QL-1977a",866.0,16.0)

   {

    z=196.5;

   };

   R_Date("QL-1977c",854.0,15.5)

   {

    z=196.5;

   };

   R_Date("59.4-143595",905,30)

   {

    z=174.5;

   };

   R_Date("147688",840,30)

   {

    z=169.5;

   };

   R_Date("147689",830,25)

   {

    z=169.5;

   };

   R_Date("147687",820,25)

   {

    z=169.5;

   };

   R_Date("QL-1955",816.3,14.6)

   {

    z=169.5;

   };

   R_Date("188644",815,30)

   {

    z=169.5;

   };

   R_Date("QL-1978",814.0,15.4)

   {

    z=169.5;

   };

   R_Date("USGS-84",783,111)

   {

    z=168.5;

   };

   R_Date("UW-365",663,71)

   {

    z=166.5;

   };

   R_Date("USGS-896",624,56)

   {

    z=166.5;

   };

   R_Date("188645",715,35)

   {

    z=165.5;

   };

   R_Date("186778",680,30)

   {

    z=165.5;

   };

   R_Date("114089",640,35)

   {

    z=165.5;

   };

   R_Date("140075",615,30)

   {

    z=165.5;

   };

   R_Date("QL-1953",601.4,16.9)

   {

    z=165.5;

   };

   R_Date("QL-1954",572,12.8)

   {

    z=165.5;

   };

   R_Date("QL-1979",571.0,15.2)

   {

    z=165.5;

   };

   R_Date("113998",515,40)

   {

    z=165.5;

   };

   Date("EQ T")

   {

    z=164;

   };

   R_Date("68.1-QL-1995",542,15.0)

   {

    z=153.5;

   };

   R_Date("186796",425,35)

   {

    z=151.5;

   };

   R_Date("186776",405,30)

   {

    z=151.5;

   };

   R_Date("186797",375,35)

   {

    z=151.5;

   };

   R_Date("186777",375,25)

   {

    z=151.5;

   };

   R_Date("186775",360,25)

   {

    z=151.5;

   };

   R_Date("186773",375,25)

   {

    z=147.5;

   };

   R_Date("186772",375,25)

   {

    z=147.5;

   };

   R_Date("186771",375,25)

   {

    z=147.5;

   };

   R_Date("186774",355,25)

   {

    z=147.5;

   };

   R_Date("USGS-895",302,64)

   {

    z=147.5;

   };

   R_Date("136491",370,35)

   {

    z=145.5;

   };

   R_Date("113996",355,35)

   {

    z=145.5;

   };

   R_Date("QL1956",344.5,16.6)

   {

    z=145.5;

   };

   R_Date("QL-1957",342.0,16.5)

   {

    z=145.5;

   };

   R_Date("113997",285,35)

   {

    z=145.5;

   };

   Date("EQ V")

   {

    z=143;

   };

   R_Date("113995",350,35)

   {

    z=142.5;

   };

   R_Date("143533",290,30)

   {

    z=142.5;

   };

   R_Date("USGS-136",437,111)

   {

    z=140.5;

   };

   R_Date("75-QL-1992",260.0,16.3)

   {

    z=125.5;

   };

   R_Date("77-143596",220,30)

   {

    z=103.5;

   };

   R_Date("114091",195,35)

   {

    z=78.5;

   };

   R_Date("QL-1991",165.0,16.1)

   {

    z=78.5;

   };

   R_Date("USGS-144",163,95)

   {

    z=78.5;

   };

   R_Date("UW-347",83,143)

   {

    z=78.5;

   };

   R_Date("114000",220,35)

   {

    z=67.5;

   };

   R_Date("114090",210,50)

   {

    z=67.5;

   };

   R_Date("QL-1981",183.0,9.3)

   {

    z=67.5;

   };

   R_Date("QL-1980",171.5,12.8)

   {

    z=67.5;

   };

   R_Date("114001",105,40)

   {

    z=67.5;

   };

   Date("EQ X")

   {

    z=66;

   };

   R_Date("88-QL-1990",93.0,16.2)

   {

    z=47.5;

   };

   Boundary("1857", 1857)

   {

    z=46;

   };

  };

 };

Christopher Ramsey

unread,
Apr 1, 2025, 2:41:52 PMApr 1
to OxCal group
Dear Kate

Ok - the main issue here is that the P_Sequence (like the Sequence) implies the events are in order - this means that you cannot have two at the same depth as they would be at the same time. So you have to use R_Combine where there are multiple dates. For the end boundary it also helps if there is at least some uncertainty. The following code should do what you want I think:

Plot()
{
P_Sequence("PCR4c", 0.1, 1, U(-2,2))
{
Boundary("Bottom")
{
z=620;
};
R_Date("26.1-QL-1967",1410.0,14.1)
{
z=618;
};
R_Combine()
{
R_Date("A-2150",1524,112);
R_Date("A-2153",1519,88);
z=609.5;
};
R_Combine()
{
R_Date("USGS-902",1351,56);
R_Date("QL-1969",1323.0,16.2);
z=599.5;
};
Date("EQ C",R_Date("QL-1968",1270,15.8))
{
z=597.5;
};
R_Date("31-USGS-901",1336,80)
{
z=579.5;
};
R_Date("32.1-186855",1265,35)
{
z=554.5;
};
R_Date("186853",1285,30)
{
z=491.5;
};
R_Date("33.1-143588",1280,30)
{
z=456.5;
};
R_Combine()
{
R_Date("143590",1300,30);
R_Date("QL-1970",1259.0,15.7);
z=450.5;
};
R_Combine()
{
R_Date("QL-1971",1291.0,15.8);
R_Date("143591",1280,30);
z=444.5;
};
R_Date("34.1-143531",1250,30)
{
z=436.5;
};
Date("EQ D")
{
z=430;
};
R_Date("35-143593",1260,30)
{
z=376.6;
};
R_Combine()
{
R_Date("186781",1175,30);
R_Date("136467",1140,55);
z=373.5;
};
R_Combine()
{
R_Date("QL-1950",1223.0,15.8);
R_Date("QL-1973",1215.0,16.7);
R_Date("136463",1190,30);
R_Date("140077",1185,35);
R_Date("I-9590",1052,143);
z=360.5;
};
Date("EQ F")
{
z=359;
};
R_Date("41-USGS-139",1162,111)
{
z=338.5;
};
R_Date("43.1-136487",1090,60)
{
z=326;
};
R_Combine()
{
R_Date("136489",1165,60);
R_Date("136488",1110,60);
z=312;
};
R_Date("136473",1115,60)
{
z=310;
};
R_Date("143529",1085,30)
{
z=309.5;
};
R_Date("186802",1160,40)
{
z=306.5;
};
R_Combine()
{
R_Date("USGS-138",1103,119);
R_Date("QL-1951",1076.1,17.1);
z=305.5;
};
Date("EQ I")
{
z=303;
};
R_Combine()
{
R_Date("QL-1952",1058.3,15.7);
R_Date("QL-1976",1005,16.2);
R_Date("136474",915,70);
z=301.5;
};
R_Combine()
{
R_Date("188717",1085,40);
R_Date("188641",1080,40);
z=300.5;
};
R_Combine()
{
R_Date("143536",1090,35);
R_Date("188640",1070,35);
z=299.5;
};
R_Combine()
{
R_Date("USGS-83",1107,87);
R_Date("136455",875,35);
R_Date("136456",835,60);
z=292.5;
};
R_Date("52-140076",950,30)
{
z=262.5;
};
Date("EQ N")
{
z=255;
};
R_Date("UW-573",907,95)
{
z=219.5;
};
R_Date("55-143594",970,30)
{
z=211.5;
};
R_Combine("EQ R")
{
R_Date("59.2-143597",910,30);
R_Date("QL-1977b",906.0,13.6);
R_Date("QL-1977a",866.0,16.0);
R_Date("QL-1977c",854.0,15.5);
z=196.5;
};
R_Date("59.4-143595",905,30)
{
z=174.5;
};
R_Combine()
{
R_Date("147688",840,30);
R_Date("147689",830,25);
R_Date("147687",820,25);
R_Date("QL-1955",816.3,14.6);
R_Date("188644",815,30);
R_Date("QL-1978",814.0,15.4);
z=169.5;
};
R_Date("USGS-84",783,111)
{
z=168.5;
};
R_Combine()
{
R_Date("UW-365",663,71);
R_Date("USGS-896",624,56);
R_Date("188645",715,35);
R_Date("186778",680,30);
R_Date("114089",640,35);
R_Date("140075",615,30);
R_Date("QL-1953",601.4,16.9);
R_Date("QL-1954",572,12.8);
R_Date("QL-1979",571.0,15.2);
R_Date("113998",515,40);
z=165.5;
};
Date("EQ T")
{
z=164;
};
R_Date("68.1-QL-1995",542,15.0)
{
z=153.5;
};
R_Combine()
{
R_Date("186796",425,35);
R_Date("186776",405,30);
R_Date("186797",375,35);
R_Date("186777",375,25);
R_Date("186775",360,25);
z=151.5;
};
R_Combine()
{
R_Date("186773",375,25);
R_Date("186772",375,25);
R_Date("186771",375,25);
R_Date("186774",355,25);
R_Date("USGS-895",302,64);
z=147.5;
};
R_Combine()
{
R_Date("136491",370,35);
R_Date("113996",355,35);
R_Date("QL1956",344.5,16.6);
R_Date("QL-1957",342.0,16.5);
R_Date("113997",285,35);
z=145.5;
};
Date("EQ V")
{
z=143;
};
R_Combine()
{
R_Date("113995",350,35);
R_Date("143533",290,30);
z=142.5;
};
R_Date("USGS-136",437,111)
{
z=140.5;
};
R_Date("75-QL-1992",260.0,16.3)
{
z=125.5;
};
R_Date("77-143596",220,30)
{
z=103.5;
};
R_Combine()
{
R_Date("114091",195,35);
R_Date("QL-1991",165.0,16.1);
R_Date("USGS-144",163,95);
R_Date("UW-347",83,143);
z=78.5;
};
R_Combine()
{
R_Date("114000",220,35);
R_Date("114090",210,50);
R_Date("QL-1981",183.0,9.3);
R_Date("QL-1980",171.5,12.8);
R_Date("114001",105,40);
z=67.5;
};
Date("EQ X")
{
z=66;
};
R_Date("88-QL-1990",93.0,16.2)
{
z=47.5;
};
Boundary("1857",N(1857,1))
{
z=46;
};
};
};

Best wishes

Christopher

> On 1 Apr 2025, at 18:39, Kate <ksch...@gmail.com> wrote:
>
> Christopher,
> I had forgotten no phases in P_Seqs! Thanks for that reminder. I removed, and also reconsidered my choice in k. The depth values have fractions (eg 100.5 cm), so I understand k=0.1 would be more appropriate (or converting all depths to mm and using k=1000). I ran both using the stable k (it runs a lot quicker) and this did reduce the spikiness, but some strange splits in the posteriors remain. The variable k approach, P_Sequence("", 0.1, 1, U(-0.5,2)) was problematic, similar to the previous (k distro below). <Screenshot 2025-04-01 at 10.22.09 AM.png>I note that there are a handful of high precision dates with very low uncertainties (~15 yrs)- notably one at the very bottom- and wonder if that sets up the split?
> To view this discussion visit https://groups.google.com/d/msgid/oxcal/431b8c42-3172-4f38-9b20-faea1a4555d5n%40googlegroups.com.

Kate

unread,
Apr 2, 2025, 8:14:30 PMApr 2
to OxCal
Christopher-
Thank you!  
Kate

Reply all
Reply to author
Forward
0 new messages