optimize_parameter: optimize_parameter

View source: R/optimize.R

optimize_parameterR Documentation

optimize_parameter

Description

A function to optimize the parameters in power or sample size estimation.

Usage

optimize_parameter(
  fun = est_power,
  opt1,
  opt2,
  opt1Value,
  opt2Value,
  main,
  ...
)

Arguments

fun

function to be optimized, can be est_power, sample_size.

opt1

parameter1 to be optimized.

opt2

parameter2 to be optimized.

opt1Value

values of parameter1 to be optimized.

opt2Value

values of parameter2 to be optimized.

main

Title of optimization result figure.

...

Other parameters for optimized funtion.

Details

A function to optimize the parameters in power or sample size estimation.

Value

A power or sample size matrix, generated by different pair of two paramters.

Examples

#Optimization for power estimation
result<-optimize_parameter(fun=est_power,opt1="n",opt2="lambda0",opt1Value=c(3,5,10,15,20),
opt2Value=c(1:5,10,20))
#Optimization for sample size estimation
result<-optimize_parameter(fun=sample_size,opt1="lambda0",opt2="phi0",opt1Value=c(1,3),
opt2Value=c(1.5,2),power=0.8)

slzhao/RnaSeqSampleSize documentation built on March 24, 2022, 2:21 a.m.