Extracting realisations

165 views
Skip to first unread message

Graham Rush

unread,
Sep 29, 2021, 1:26:32 PM9/29/21
to ox...@googlegroups.com
Hi,

Is there a way to extract each completed run/iterations of the p_sequence? I'd like to export the age at x1, x2, x3...... for each iteration

Graham

--
Graham Rush
PhD student and Associate Lecturer
Department of Environment and Geography
University of York
YO10 5NG
Telephone: 01904 323701

MILLARD, ANDREW R.

unread,
Sep 30, 2021, 3:39:18 AM9/30/21
to ox...@googlegroups.com

Dear Graham

 

You can enclose your model within an MCMC_Sample command to get this. The manual says

 

MCMC_Sample([Name], [Interval], [Max]){ … };

allows all of the MCMC samples to be saved to a file (default is MCMC_Sample.csv) at defined intervals and with a maximum number of samples taken (default 1000); the file can be found as a Document

 

 

Best wishes

Andrew

--

Dr. Andrew Millard

Associate Professor of Archaeology,

Durham University, UK

Email: A.R.M...@durham.ac.uk 

Personal page: https://www.dur.ac.uk/directory/profile/?id=160

Scottish Soldiers Project: https://www.dur.ac.uk/scottishsoldiers

Dunbar 1650 MOOC: https://www.futurelearn.com/courses/battle-of-dunbar-1650

 

 

From: 'Graham Rush' via OxCal <ox...@googlegroups.com>
Sent: 29 September 2021 18:26
To: ox...@googlegroups.com
Subject: Extracting realisations

 

[EXTERNAL EMAIL]

--
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 on the web visit https://groups.google.com/d/msgid/oxcal/CAD5JqtFru7wDXLT-Z3R0wCD%2BAxhfY7z6ncGk7VfbiyagkXxxsA%40mail.gmail.com.

Christopher Ramsey

unread,
Sep 30, 2021, 4:52:48 AM9/30/21
to OxCal group
Yes - or you can just put the command:

MCMC_Sample([Name], [Interval], [Max]);

within the P_Sequence for just those elements.

Note though that this has the capacity of generating really massive files. Our server is set up to limit file sizes and so this may fail if you for example select an interval of 1 and a high maximum. If you want to do this with larger files you should download the program and run it on your own machine.

Christopher
> To view this discussion on the web visit https://groups.google.com/d/msgid/oxcal/LO2P265MB3852188FB7FAA1F000A6DD6B81AA9%40LO2P265MB3852.GBRP265.PROD.OUTLOOK.COM.

Graham Rush

unread,
Oct 12, 2021, 6:04:17 AM10/12/21
to OxCal
Thank you very much, this is really helpful.

I have tried running the command within the P_sequence (e.g "MCMC_Sample("Sample_mcmc", 1, 2000);" shown below)
My understanding was that this would give me the age at 1 cm intervals for 2000 passes?
However, the output only contains ages for the defined dates and boundaries. Am I doing something incorrectly?

Thanks.
Graham

Plot()
 {
  Outlier_Model("General",T(5),U(0,4),"t");
  Curve("Atmospheric","IntCal20.14c");
  P_Sequence("",100,100,U(-2,2))
  {
   MCMC_Sample("Ythan_mcmc", 1, 2000);
   Boundary("bottom")
   {
   };
   R_Date("Yt001",7917,40)
   {
    Outlier("general",0.05);
    z=5.17;
   };
   R_Date("Yt002",7980,39)
   {
    Outlier("general",0.05);
    z=5.14;
   };
   Boundary("peat-marsh")
   {
    z=5.13;
   };
   Boundary("marsh-peat")
   {
    z=5.03;
   };
   R_Date("Yt003",7774,40)
   {
    Outlier("general",0.05);
    z=5.02;
   };
   R_Combine("Peat-top")
   {
    R_Date("Yt004", 7768, 40);
    R_Date("Yt013", 7767, 39);
    Outlier("general",0.05);
    z=4.97;
   };
   Boundary("peat-saltmarsh")
   {
    z=4.96;
   };
   R_Date("Yt005", 7880, 56)
   {
    Outlier("general",0.5);
    z=4.59;
   };
   R_Date("Yt006", 7658, 38)
   {
    Outlier("general",0.05);
    z=3.71;
   };
   R_Date("Yt007", 7651, 37)
   {
    Outlier("general",0.05);
    z=3.62;
   };
   Boundary("saltmarsh-mudflat")
   {
    z=3.60;
   };
   R_Date("Yt008", 7696, 39)
   {
    Outlier("general",0.05);
    z=3.57;
   };
   R_Date("Yt009", 7559, 37)
   {
    Outlier("general",0.35);
    z=2.59;
   };
   Boundary("mudflat-marine")
   {
    z=2.56;
   };
   Curve("Marine","Marine20.14c");
   Delta_R(-136, 44);
   R_Date("Yt010",7780,37)
   {
    Outlier("general",0.05);
    z=2.4;
   };
    C_Date("Bondevik", calBP(8129), 25)
    {z=2.35;
   };
   Boundary("top")
   {
   };
  };
 };

Graham Rush

unread,
Oct 13, 2021, 3:26:30 AM10/13/21
to ox...@googlegroups.com
Hello,

I now realise that the 'Interval' command defines the interval at which to output the pass, rather than the depth interval. 
I see that I need to add 'Date(0){z=...}' to extract the dates at those depths for each pass.

Thanks for your help and making so much information accessible.

You received this message because you are subscribed to a topic in the Google Groups "OxCal" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/oxcal/cNaMwASVqoY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to oxcal+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oxcal/ccd173cd-0b33-4536-86cc-1804ee3d77a2n%40googlegroups.com.

Christopher Ramsey

unread,
Oct 13, 2021, 5:48:39 AM10/13/21
to OxCal group
Yes - that is right. In general most of the relevant information is in the dated points and the interpolations could be generated separately. Adding lots of points for interpolation this way will slow the program down considerably and also puts a lower limit on k (which the normal interpolation model does not).

You may be better using the realisation outputs of the age depth model. As a default 30 of these are output at 1000 iteration intervals but you can increase the number using the option block:

Options()
{
Ensembles=100;
};

The outputs can be plotted: go to [Format > Adjust] and enter the number of age depth realisations you want to show on the plot. If you go to the raw view for the P_Sequence you can extract these ensembles at whatever resolution you want.

Alternatively you can delve into the .js output file. In here you will find the depths in a .age_depth_z array and the ages for all ensembles in an age_depth_ensembles array.

At some point you will run out of browser memory if you try to do thousands of ensembles at very high resolution and your browser will crash - but most browser can handle pretty large data quantities now.

Best wishes

Christopher
> To view this discussion on the web visit https://groups.google.com/d/msgid/oxcal/CAD5JqtFcfHvTqi_w5M3-oOwcLHWU5iMpSYfzmpo2ck05m_RZtw%40mail.gmail.com.

Graham Rush

unread,
Oct 13, 2021, 10:34:28 AM10/13/21
to OxCal
Great, thanks again. This works nicely
Reply all
Reply to author
Forward
0 new messages