Examples

Some examples for demonstration purposes.

Sunspots and Melanoma

The etiology of melanoma is complex and may include the influences of trauma, heredity and hormonal activity. In particular, exposure to solar radiation may be involved in the pathogenesis of melanoma. Melanoma is more common in fair-skinned individuals and most frequent in skin sites exposed to the sun. In white populations melanoma is more common in areas closer to the equator where the intensity of solar radiation is higher. Data from various parts of the world suggest that the incidence of melanoma is increasing. The data below, giving age-adjusted melanoma incidence, are from the Connecticut Tumor Registry from 1936-1972. Connecticut has the longest record of state population-based cancer statistics in the United States of America. The data also includes the sunspot relative number. Houghton, Munster and Viola (1978) have shown that the age-adjusted incidence rate for malignant melanoma in the state of Connecticut has risen since 1935 and that superimposed on the rise are 3-5 year periods in which the rise in the rate of incidence is excessive. These periods have a cycle of 8-11 years and follow times of maximum sunspot activity. The relationship between solar cycles and melanoma supports the hypothesis that melanoma is related to sun exposure and provides evidence that solar radiation may trigger the development of clinically apparent melanoma.

The data can be obtained through the following helper function

AsymptoticPDC.get_sunspot_melanoma_dataFunction
get_sunspot_melanoma_data()

This data is from Andrews and Herzberg. D. F. Andrews, A. M. Herzberg. (1985) Data: A Collection of Problems from Many Fields for the Student and Research Worker. Springer, New York.

Returns u:

  • u[:, 1]: Year 1936-1972
  • u[:, 2]: Annual male melanoma incidence (age-adjusted per 10e5) in Connecticut
  • u[:, 3]: Annual total melanoma incidence (age-adjusted per 10e5) in Connecticut
  • u[:, 4]: Annual sunspot relative number
source

Setup

A first look at the detrended data

u = get_sunspot_melanoma_data()
t = u[:, 1]
melanoma, _ = detrend(u[:, 3])
sunspots, _ = detrend(u[:, 4])
p1 = plot(t, melanoma, title = "Detrended annual melanoma incidence Connecticut")
p2 = plot(t, sunspots, title = "Detrended annual sunspot number")
plot(p1, p2, layout = (2, 1), legend = :none)

Estimation

Estimate the model parameters using mcar

y = [melanoma sunspots]
model, _, _ = mcar(y)
(MCAR_Model{Float64, Array{Float64, 3}, Matrix{Float64}}(3, 2, 37, [-0.15136402462500836 -0.0005913956663627665; -13.007134576783498 0.765652335488139;;; -0.0762157476017296 0.004227477213695851; 16.6699493203485 -0.04394536617446674;;; 0.09778093472058648 0.002891647014980567; -28.62446855694505 -0.2832230418733722;;; -0.10327559460573496 -0.0028936913155264863; -3.578229944054352 -0.13644990698633863], [0.04270223341659899 -1.7919220155852729; -1.7919220155852633 558.6072604240353], [0.07709815078236182 -24.004267425320066; -0.06266761070267378 74.64659715915631; … ; -0.17371639273352027 2.375269026946955; -0.0403663923409128 -2.745645999156643]), 142.24657012533189, [150.9486885199741, 148.14305646442727, 142.24657012533189, 144.0125514977107, 0.0, 0.0, 0.0, 0.0, 0.0])

Connectivity

Perform a Granger causality test to get a connectivity matrix

connectivity, pvalues = granger_causality_test(model, y);
                  GRANGER CAUSALITY TEST
======================================================================
Connectivity matrix:
2×2 Matrix{Float64}:
 NaN      1.0
   0.0  NaN
Granger causality test p-values:
2×2 Matrix{Float64}:
 NaN           5.38809e-6
   0.342676  NaN
======================================================================
Connectivity matrix:
2×2 Matrix{Float64}:
 NaN      1.0
   0.0  NaNGranger causality test p-values:
2×2 Matrix{Float64}:
 NaN           5.38809e-6
   0.342676  NaN

PDC Analysis

Original PDC analysis

The time series are not standardized and the sunspots series has a larger variance which explains the counterintuitive results below

original_pdc = pdc(model, y; metric = "euc")
pdcplot(original_pdc, cnames = ["Melanoma", "Sunspots"])

But when calculating the asymptotic statistics for the original PDC analysis, only the coherence from sunspots -> melanoma is considered significant (grey shaded area).

original_pdc_asymp = pdc(model, y; metric = "euc", α = 0.01)
pdcplot(original_pdc_asymp, cnames = ["Melanoma", "Sunspots"])

Generalized PDC analysis

The generalized PDC analysis gives a better view inside the "true" interaction. The ~11 year sun activity cycle is clearly visible

generalized_pdc = pdc(model, y; metric = "diag", α = 0.01)
pdcplot(generalized_pdc, cnames = ["Melanoma", "Sunspots"])

Information PDC analysis

The information PDC analysis gives similar results

info_pdc = pdc(model, y; metric = "info", α = 0.01)
pdcplot(info_pdc, cnames = ["Melanoma", "Sunspots"])