Skip to content

Commit

Permalink
another oxcal experiment to better understand normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
nevrome committed Dec 1, 2023
1 parent ef5b545 commit 01e2d7d
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions playground/test.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,67 @@ sumCalTest2 |>
# };
# };

# the following two results are equal
system('currycarbon "((A,3000,20)+(B,2900,200)+(C,2800,70))+(((D,3500,60)+(E,3400,60))+(F,3300,30))" --densityFile /tmp/currycarbonSumCalTest1.tsv')

sumCalTest1 <- readr::read_tsv(
"/tmp/currycarbonSumCalTest2.tsv",
col_types = readr::cols()
)

system('currycarbon "(A,3000,20)+(B,2900,200)+(C,2800,70)+(D,3500,60)+(E,3400,60)+(F,3300,30)" --densityFile /tmp/currycarbonSumCalTest2.tsv')

sumCalTest2 <- readr::read_tsv(
"/tmp/currycarbonSumCalTest2.tsv",
col_types = readr::cols()
)

ggplot() +
geom_line(
data = sumCalTest2,
mapping = aes(x = yearBCAD, y = density),
color = "red"
) +
geom_line(
data = sumCalTest2,
mapping = aes(x = yearBCAD, y = density),
color = "blue"
)

# but the following two oxcal scripts are not - only the second one is similar to the currycarbon result
# I think that's how it should be (2023-12-01)

# Oxcal:
#
# Sum("(A+B+C)+((D*E)+F)")
# {
# Sum("A+B+C")
# {
# R_Date("A",3000,20);
# R_Date("B",2900,200);
# R_Date("C",2800,70);
# };
# Sum("(D*E)+F")
# {
# Sum("D*E")
# {
# R_Date("D",3500,60);
# R_Date("E",3400,60);
# };
# R_Date("F",3300,30);
# };
# };

# Sum("(A+B+C)+((D*E)+F)")
# {
# R_Date("A",3000,20);
# R_Date("B",2900,200);
# R_Date("C",2800,70);
# R_Date("D",3500,60);
# R_Date("E",3400,60);
# R_Date("F",3300,30);
# };

#### another test of the random age sampling ####

system('currycarbon "A,3000,30+B,3200,40*C,3300,30" --samplesFile /tmp/currySamples.tsv -n 10000')
Expand Down

0 comments on commit 01e2d7d

Please sign in to comment.