View source: R/gof_power_disc.R

gof_power_disc | R Documentation |

Find the power of various gof tests for discrete data.

```
gof_power_disc(
pnull,
rnull,
vals,
ralt,
param_alt,
phat = function(x) -99,
TS,
TSextra = NA,
alpha = 0.05,
B = c(1000, 1000),
nbins = c(100, 10),
rate = 0,
maxProcessors,
minexpcount = 5,
ChiUsePhat = TRUE
)
```

`pnull` |
cumulative distribution function under the null hypothesis |

`rnull` |
a function to generate data under null hypothesis |

`vals` |
values of discrete rv. |

`ralt` |
function to generate data under alternative hypothesis |

`param_alt` |
vector of parameter values for distribution under alternative hypothesis |

`phat` |
=function(x) -99, function to estimate parameters from the data, -99 if no parameters are estimated |

`TS` |
user supplied function to find test statistics, if any |

`TSextra` |
=NA, list passed to TS, if desired |

`alpha` |
=0.05, the level of the hypothesis test |

`B` |
=c(1000, 1000), number of simulation runs to find power and null distribution |

`nbins` |
=c(100, 10) number of bins for chi square tests |

`rate` |
rate of Poisson if sample size is random |

`maxProcessors` |
maximum of number of processors to use, 1 if no parallel processing is needed or number of cores-1 if missing |

`minexpcount` |
=5 minimal number of expected counts in each bin for chi square tests |

`ChiUsePhat` |
= TRUE, if TRUE param is estimated parameter, otherwise minimum chi square method is used. |

A numeric matrix of power values.

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.