modelTest()

Scientific results for this function.

The transformed-bearing null was tested with steep skylines, three measurement families and shared or site-specific candidate weights. S02 validation study.

Direct spherical propagation was checked on steep skylines, including a sightline through the celestial pole. D02 validation study.

Empirical input and call Model angles Comparison
modelTest(Az, az.model) Azimuth Sum bearing densities on the circular azimuth grid.
modelTest(Dec, dec.model) Declination Sum declination densities. For transformed input, each candidate gives the mean to which its stored template is translated when unc is omitted.
modelTest(Az, az.model, hor = horizons) Azimuth Transform each measured bearing density through its horizon, then sum in declination. Each simulation draws a bearing for each observation and repeats the individual transformations.

For the third route, supply one shared horizon or a list in measurement order. A ridge can give a simulated bearing a different declination width or shape from the observed bearing. Model angles and replacement widths remain in azimuth degrees. The internal declination step (.transform.res, 0.1°), azimuth integration step (.prec, 0.1°) and output PDF spacing (.output.res, 0.01°) govern the transformation. The final comparison grid uses .res (0.01°). Record the atmospheric settings and the measurement-to-horizon mapping.

In S02, identical candidate bearings produced identical directly constructed observed and simulated densities. Global rejection at the 5 percent level ranged from 4.35 to 5.50 percent under the six matched null designs. S02 results.

The observed and simulated azimuth curves use the same circular cluster search. The original test matrix gave one interval from 346° to 15°. S03 checks.

A directly measured triangular density follows the sampled mode, retaining its left/right proportions. Both softened uniform families preserve their second width in degrees. Measurement families.

Function index

A proposed topographical or astronomical explanation can predict some orientations more frequently than others. Testing that explanation requires simulating its predicted distribution at the sites under study.

Silva and Lomsdalen (2025) extended the random-orientation framework of Silva (2020) to test specific hypotheses about temple orientations in Malta, including topographical and astronomical explanations. Here the hypothesis specifies the relative probability of each candidate orientation. A small global p-value is evidence against that particular model.

Model weights and interpretation.

Weights are discrete sampling probabilities up to proportionality. If a continuous model is evaluated on an uneven coordinate grid, density heights alone do not represent probability mass; construct weights that account for the bin widths before calling the function. Put site-specific model tables in the same order as the observed measurements.

A large p-value does not prove the proposed explanation or measure its probability. The test asks whether the specified model is incompatible with the observed departure statistic. Alternative models can remain compatible. The simulations do not automatically represent dependence between sites, selection after viewing the data, or uncertainty in fitted model parameters. See randomTest for study-design and Monte Carlo limitations.

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")}.

Interpretation and limits. Preserve the generating model, measurement-to-site mapping, simulation seed, comparison grid and rank convention. A change in the null answers a different archaeological question even when the same observed curve is used.

Implementation arguments, return value and documented modes
Argument Formal default Behaviour in this interface
pdf —

Empirical skyscapeR.pdf from az.pdf, dec.pdf or coordtrans. Its coordinate and the optional hor select the simulation path.

model —

One shared data frame or an ordered list with one table per observation. The first column contains candidate coordinates in degrees and the second contains nonnegative discrete sampling weights, with at least one positive weight. On equally spaced grids, density heights can serve as weights.

unc NULL

Optional replacement width in degrees of the input coordinate (azimuth on route 3). Use a standard deviation for normal, half the total span for triangular, or the family-specific half-width documented in az.pdf. Supply a scalar or one per observation. Omit to reuse stored measurement uncertainties or mean-shift transformed declination curves. See Details.

nsims 1000

Number of simulations, at least two. Default is 1000.

conf 0.95

Confidence level as a fraction.

tails 2

1 for upper excesses, 2 for excesses and deficits.

normalise FALSE

Scale each summed density to unit area before comparison.

.res 0.01

Spacing of the empirical and simulated comparison grids in degrees. Default 0.01.

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 TRUE

Display simulation progress.

hor NULL

Optional shared skyscapeR.horizon or an ordered list matching the empirical observations. With azimuth inputs, selects a declination test using individual coordinate transformations. Omit for routes 1 and 2.

.transform.res 0.1

Internal declination transformation spacing, as .res in coordtrans. Default 0.1 degrees.

.prec 0.1

Azimuth integration spacing for route 3, as in coordtrans. Default 0.1 degrees.

.output.res 0.01

Stored declination PDF spacing for route 3, as in coordtrans. Default 0.01 degrees.

Return value

A skyscapeR.sigTest list with settings and global/local results in metadata, empirical density and null envelope in data.

Implementation. R/statistics.R. Full function help · Specified orientation models · Null models and significance outline · From a measured orientation to a declination distribution · Exploring celestial candidates

The matched-null calibration reports global and adjusted local rejection rates for individually transformed measurements.