Creating a prior distribution

201 views
Skip to first unread message

Ray Kidd

unread,
Feb 21, 2021, 9:52:44 AM2/21/21
to ox...@googlegroups.com
Hello Christopher,

Can you help please?  I often use a Log Normal Interval to define the waiting time distribution (WTD) between R_dates.  This often works well.  However It is sometimes possible to obtain real data, say as a csv or spreadsheet file that would be more representative of the distribution.

I've been trying, without success, to incorporate such data into my model.  I thought it may be a matter of creating a Prior file of the distribution, but I can't seem to get the data into the right format, or where I should put the original .csv file.  

I get 'Warning no data found' and and 'Warning ZERO Distribution'.  The model then just calculates the Interval as a query.

I would like the Interval(Actual Distribution) to be calculated afresh each time it is used.

Here is what I normally use:


 var(a);
 // e.g. the median value 
 var(b);
 // shape nominally 2.

 a=26;
 b=2.;

 Plot()
 {
  Phase()
  {
   Sequence("1")
   {
    R_Date("A", 3700, 28);
    Interval(LnN(ln(a),ln(b)););
    R_Date("B", 3650, 27);

   Sequence("2")
    R_Date("B1", 3650, 27);
    Interval(LnN(ln(a),ln(b)););
    R_Date("A1", 3700, 28);
   };

Best wishes

Ray Kidd

Ray Kidd

unread,
Feb 23, 2021, 3:18:55 PM2/23/21
to ox...@googlegroups.com
Hello Christopher,

I think I've managed to answer my own question, but it may be clumsy.

I put the Data into Excel and used the Data Analysis Add-in to  create a histogram, this creates a Bin/Frequency table.  Cut and paste the Bin/Frequency table into another Excel sheet and save as a tab limited .txt file, with appropriate name (say SS.txt)

Change the file extension from .txt to .prior.  Copy the file into the appropriate folder.
.
In the OxCal model use Interval(Prior(SS,SS.prior) where before I used "    Interval(LnN(ln(a),ln(b));); "

In the end the difference is so slight that it is probably easier to use the Log Normal model, provided the raw data is a reasonable fit.

Unless there is a slicker way to create the Prior file......?

Best wishes

Ray 


--
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/1141456625.465381.1613919041899%40mail.yahoo.com.

Christopher Ramsey

unread,
Feb 24, 2021, 9:56:34 AM2/24/21
to OxCal group
In general prior files have a format which is described at:

https://c14.arch.ox.ac.uk/oxcalhelp/hlp_analysis_file.html#prior

To create a Prior file, in file manager, use [File > Manager]. You will then see a section for prior files - click on "+ New" in this section which will give you space to paste in your data. This can then be saved with the appropriate name.

Note that now it is also possible to enter prior data inline in the command. This may not be ideal in this case if the resolution required is too high - but the format would be:

Interval(P(-1,11,[0,1024,512,256,128,64,32,16,8,4,2,1,0]));

There are details at:

https://c14.arch.ox.ac.uk/oxcalhelp/hlp_analysis_inform.html#param

Best wishes

Christopher
> To view this discussion on the web visit https://groups.google.com/d/msgid/oxcal/290964576.1038707.1614111528017%40mail.yahoo.com.

Ray Kidd

unread,
Feb 24, 2021, 11:05:40 AM2/24/21
to ox...@googlegroups.com
Hello Christopher,

Many thanks, that is certainly neater than my plodding.

Best wishes

Ray


> To unsubscribe from this group and stop receiving emails from it, send an email to oxcal+unsub...@googlegroups.com.

> To view this discussion on the web visit https://groups.google.com/d/msgid/oxcal/1141456625.465381.1613919041899%40mail.yahoo.com.
>
> --
> 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+unsub...@googlegroups.com.

--
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+unsub...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/oxcal/CE7A659B-E41C-43E1-A531-B09CB5D5A963%40arch.ox.ac.uk.

Reply all
Reply to author
Forward
0 new messages