Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/genwwn.thpower.R

Compute (approximation) to the theoretical power of the
`genwwn.test`

test. Note: this
function does no simulation, it merely computes an approximation
to the likely statistical power (or size) of the
`genwwn.test`

function. It can be useful to establish
the reverse question: what sample size do I require to
achieve a certain power for a given ARMA process?

1 2 3 |

`N` |
The length of the series you want to get a theoretical power result for. |

`ar` |
Autoregressive parameters. A vector with p entries for AR(p) with the first entry being the value for lag-one term (alpha_1), the second entry being the value for the lag-two term (alpha_2) etc. If this argument is NULL then there are no AR terms. |

`ma` |
Similar to the |

`plot.it` |
If |

`sigsq` |
The theoretical innovation variance (also the variance
of white noise if |

`alpha` |
The nominal size of the test for this theoretical power calculation. |

`away.from` |
Describes how many fine scales to exclude, the
same as in |

`filter.number` |
The number of vanishing moments in the Daubechies series of wavelets. |

`family` |
The wavelet family. |

`verbose` |
If TRUE then informative messages are printed during the progress of the function. |

Function calculates the value of the power function at the specified arguments. It does this by: (i) specifying the functional spectrum of the ARMA process (which can be flat, ie white noise); (ii) calculating the variance of the ARMA process by numerical integration of the spectrum; (iii) calculating the spectrum values at the Fourier frequencies; (iv) calculating the wavelet coefficients at the exact spectrum values; (v) computing the exact variance of the wavelet coefficients of the squared normalized spectrum; (vi) computing the approximate power of the whole lot.

A list containing the following components.

`C.alpha.c` |
The critical value for the test, which is the nominal size critical value after correction for multiple hypothesis tests (correction using Bonferroni). |

`th.power` |
The computed theoretical power |

`norspecwd` |
The wavelet coefficients of the true spectrum |

`norspecvarwd` |
The squared wavelet transform of the squared normalized spectrum |

`all.hwc` |
All of the wavelet coefficients from the normalized true specturm as a single vector |

`all.sdwc` |
The ‘true’ standard deviations of the wavelet coefficients |

Delyan Savchev and Guy Nason

Nason, G.P. and Savchev, D. (2014) White noise testing using
wavelets. *Stat*, **3**, 351-362.
http://dx.doi.org/10.1002/sta4.69

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
#
# Calculate what the theoretical actual size is likely to be for the
# genwwn.test for a white noise sequence of T=64, nominal size=0.05
#
genwwn.thpower(N=64)$th.power
#[1] 0.04894124
#
# This is pretty close to the nominal size of 5%. Good.
#
# What is the power of detection for the AR(1) process with alpha=0.3?
# Let's say with sample size of T=32
#
genwwn.thpower(N=32, ar=0.3)$th.power
#[1] 0.2294128
#
# That's pretty poor, we'll only detect about 23% of cases. Can we achieve
# a power of 90%? Actually, it turns out that by repeating these above
# functions with N=128 gives a power of 61%, and for N=256 we get a power of
# 90%.
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.