randomTest()
Scientific results for this function.
Direct spherical propagation was checked on steep skylines, including a sightline through the celestial pole. D02 validation study.
The 500-simulation Ggantija-phase workflow in W02 reproduced the bundled global probability, local intervals and adjusted probabilities. W02 results.
In S01, at a nominal 5 percent level the global rejection rate was 4.25 to 5.85 percent across the tested uniform-null settings with sufficient Monte Carlo resolution. The package uses the source azimuth density spacing and cutoff for simulations and matches the observed SPD spacing on the shared-horizon route. S01 results.
The global score counts north once. A qualifying excess across north is reported as one interval with start greater than end. S03 checks.
The null draw relocates each observation’s full measurement model, including triangular asymmetry, taper and independent survey error. Measurement families.
Following Silva (2020), the test combines the observed measurement densities into a summed probability density (SPD). For each simulated dataset, the function draws one azimuth per measurement with replacement from the uniform grid from 0 to 360 degrees at the source azimuth spacing. It applies the source density family and measurement uncertainties and constructs a comparable SPD. For a declination test, random azimuths are transformed using the site geometry; the resulting null distribution in declination depends on latitude and horizon.
A new transformation takes its atmosphere from skyscapeR.vars. A saved declination PDF supplies its original settings. The fit records these in metadata$atmosphere for declination tests.
Study design and numerical checks.
The simulated null describes independently sampled orientations with the specified site geometry and measurement model. It does not automatically model shared construction episodes, correlated measurement errors, geographical clustering or selection of sites after inspecting their orientations. Such structure needs a justified sampling model or separate sensitivity analysis.
The pointwise envelope is not a simultaneous confidence band. A significant
global result rejects the specified random-orientation model; it does not
identify a celestial target. Refine the comparison grid and increase
nsims to assess borderline results, preserving the seed and inputs.
More simulations improve Monte Carlo resolution, not the validity of the
archaeological sampling design. Repeated searches over alternative subsets or
models are not included in the within-fit local-cluster adjustment.
Method references
Silva, F. (2020). A probabilistic framework and significance test for the analysis of structural orientations in skyscape archaeology. Journal of Archaeological Science, 118, 105138. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jas.2020.105138")}.
Silva, F. and Lomsdalen, T. (2025). ‘No easy way from the earth to the stars’: a new statistical approach to the orientation of the Maltese temples. Archaeological and Anthropological Sciences, 17, 96. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s12520-025-02208-4")}.
Maris, E. and Oostenveld, R. (2007). Nonparametric statistical testing of EEG- and MEG-data. Journal of Neuroscience Methods. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jneumeth.2007.03.024")}.
Sassenhagen, J. and Draschkow, D. (2019). Cluster-based permutation tests of MEG/EEG data do not establish significance of effect latency or location. Psychophysiology. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/psyp.13335")}.
Dufour, J.-M. (2006). Monte Carlo tests with nuisance parameters: A general approach to finite-sample inference and nonstandard asymptotics. Journal of Econometrics, 133, 443-477. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jeconom.2005.06.007")}.
North, B. V., Curtis, D. and Sham, P. C. (2002). A note on the calculation of empirical P values from Monte Carlo procedures. American Journal of Human Genetics, 71, 439-441. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1086/341527")}.
Reproducing a test under its null model.
Implementation arguments, return value and documented modes
| Argument | Formal default | Behaviour in this interface |
|---|---|---|
pdf |
— | A skyscapeR.pdf object created with either |
az |
— | Original azimuth skyscapeR.pdf; required only when |
hor |
— | For azimuth input, optionally supply one shared skyscapeR.horizon to test in declination. For declination input, required: the original shared horizon or an ordered list matching the distributions in |
nsims |
1000 |
Number of simulations, at least two. Default is 1000. |
conf |
0.95 |
Confidence level as a fraction. For example, 0.95 requests a 95 percent envelope. |
tails |
2 |
1 for upper excesses, 2 for excesses and deficits (default). |
normalise |
F |
Logical to control whether to normalize SPDs. Default is FALSE |
.res |
0.1 |
Resolution with which to output probability distribution(s). Default is 0.1 degrees. |
ncores |
NULL |
Worker count. By default use half the detected available logical cores, rounded down with a minimum of one. Set ncores=1 for serial execution. The simulation count and memory batch size can further limit workers. Verbose output reports the effective count. |
verbose |
T |
Logical. Display progress or informational messages. Default |
Return value
A skyscapeR.sigTest list containing metadata (test settings, global and local p-values) and data (empirical SPD and null confidence envelope). No original PDFs or horizon objects are attached.
Implementation. R/statistics.R. Full function help · Random orientations · Null models and significance outline · From a measured orientation to a declination distribution · Reading the Ġgantija fit · Test random orientations