Last data update: 2014.03.03

R: optimize_parameter
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
## Not run: 
result<-optimize_parameter(fun=sample_size,opt1="lambda0",opt2="phi0",opt1Value=c(1,3,5),opt2Value=c(1.5,2,3),power=0.8)

## End(Not run)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(RnaSeqSampleSize)
Loading required package: RnaSeqSampleSizeData
Loading required package: edgeR
Loading required package: limma
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/RnaSeqSampleSize/optimize_parameter.Rd_%03d_medium.png", width=480, height=480)
> ### Name: optimize_parameter
> ### Title: optimize_parameter
> ### Aliases: optimize_parameter
> 
> ### ** 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
> ## Not run: 
> ##D result<-optimize_parameter(fun=sample_size,opt1="lambda0",opt2="phi0",opt1Value=c(1,3,5),opt2Value=c(1.5,2,3),power=0.8)
> ## End(Not run)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>