Last data update: 2014.03.03

R: Perform parameter estimation using a genetic algorithm...
parEstimationLBodeGAR Documentation

Perform parameter estimation using a genetic algorithm (package genalg).

Description

This function uses a genetic algorithm (package genalg) to perform parameter estimation. The objective function is the same as the one provided by getLBodeContObjFunction.

Usage

	parEstimationLBodeGA(cnolist, model, ode_parameters = NULL, indices = NULL, mutationChance = NA, popSize = 200, iters = 100, 
		elitism = NA, time = 1, monitor = TRUE, verbose = 0, transfer_function = 3, reltol = 1e-04, 
		atol = 0.001, maxStepSize = Inf, maxNumSteps = 1e+05, maxErrTestsFails =
50, nan_fac = 1, initial_state=0.1)

Arguments

cnolist

A list containing the experimental design and data.

model

The logic model to be simulated.

ode_parameters

A list with the ODEs parameter information. Obtained with createLBodeContPars.

indices

Indices to map data in the model. Obtained with indexFinder function from CellNOptR.

mutationChance

the chance that a gene in the chromosome mutates. By default 1/(size+1). It affects the convergence rate and the probing of search space: a low chance results in quicker convergence, while a high chance increases the span of the search space.

popSize

the population size.

iters

the number of iterations.

elitism

the number of chromosomes that are kept into the next generation. By default is about 20% of the population size

time

An integer with the index of the time point to start the simulation. Default is 1.

monitor

If TRUE a plot will be generated to monitor the objective function

verbose

A logical value that triggers a set of comments.

transfer_function

The type of used transfer. Use 1 for no transfer function, 2 for Hill function and 3 for normalized Hill function.

reltol

Relative Tolerance for numerical integration.

atol

Absolute tolerance for numerical integration.

maxStepSize

The maximum step size allowed to ODE solver.

maxNumSteps

The maximum number of internal steps between two points being sampled before the solver fails.

maxErrTestsFails

Specifies the maximum number of error test failures permitted in attempting one step.

nan_fac

A penalty for each data point the model is not able to simulate. We recommend higher than 0 and smaller that 1.

initial_state

initial state of the dynamic nodes (non-measured) (Defaults to 0.1)

Value

LB_n

A numeric value to be used as lower bound for all parameters of type n.

LB_k

A numeric value to be used as lower bound for all parameters of type k.

LB_tau

A numeric value to be used as lower bound for all parameters of type tau.

UB_n

A numeric value to be used as upper bound for all parameters of type n.

UB_k

A numeric value to be used as upper bound for all parameters of type k.

UB_tau

A numeric value to be used as upper bound for all parameters of type tau.

default_n

The default parameter to be used for every parameter of type n.

default_k

The default parameter to be used for every parameter of type k.

default_tau

The default parameter to be used for every parameter of type tau.

LB_in

An array with the the same length as ode_parameters$parValues with lower bounds for each specific parameter.

UB_in

An array with the the same length as ode_parameters$parValues with upper bounds for each specific parameter.

opt_n

Add all parameter n to the index of parameters to be fitted.

opt_k

Add all parameter k to the index of parameters to be fitted.

opt_tau

Add all parameter tau to the index of parameters to be fitted.

random

A logical value that determines that a random solution is for the parameters to be optimized.

res

A list containing the information provided by the nonlinear optimization solver (genalg).

Author(s)

David Henriques, Thomas Cokelaer

See Also

CellNOptR createLBodeContPars rbga

Examples

data("ToyCNOlist",package="CNORode");
data("ToyModel",package="CNORode");
data("ToyIndices",package="CNORode");
	
ode_parameters=createLBodeContPars(model,random=TRUE);
#Visualize intial simulation
#simulatedData=plotLBodeFitness(cnolistCNORodeExample, model,ode_parameters,indices=indices)

ode_parameters=parEstimationLBodeGA(cnolistCNORodeExample,model,ode_parameters=ode_parameters,
indices=indices,maxStepSize=1,atol=1e-3,reltol=1e-5,transfer_function=2,popSize=10,iter=40);

#Visual solution after optimization
simulatedData=plotLBodeFitness(cnolistCNORodeExample, model,indices=indices,ode_parameters=ode_parameters);

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(CNORode)
Loading required package: CellNOptR
Loading required package: RBGL
Loading required package: graph
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: hash
hash-2.2.6 provided by Decision Patterns

Loading required package: ggplot2
Loading required package: RCurl
Loading required package: bitops
Loading required package: Rgraphviz
Loading required package: grid
Loading required package: XML

Attaching package: 'XML'

The following object is masked from 'package:graph':

    addNode

Loading required package: genalg

Attaching package: 'CNORode'

The following object is masked from 'package:stats':

    simulate

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/CNORode/parEstimationLBodeGA.Rd_%03d_medium.png", width=480, height=480)
> ### Name: parEstimationLBodeGA
> ### Title: Perform parameter estimation using a genetic algorithm (package
> ###   genalg).
> ### Aliases: parEstimationLBodeGA
> ### Keywords: genetic algorithm CellNOptR logic model
> 
> ### ** Examples
> 
> data("ToyCNOlist",package="CNORode");
> data("ToyModel",package="CNORode");
> data("ToyIndices",package="CNORode");
> 	
> ode_parameters=createLBodeContPars(model,random=TRUE);
> #Visualize intial simulation
> #simulatedData=plotLBodeFitness(cnolistCNORodeExample, model,ode_parameters,indices=indices)
> 
> ode_parameters=parEstimationLBodeGA(cnolistCNORodeExample,model,ode_parameters=ode_parameters,
+ indices=indices,maxStepSize=1,atol=1e-3,reltol=1e-5,transfer_function=2,popSize=10,iter=40);
[1] "Iteration:1  Best_f:0.0854559767108977  N_Evals:10"
[1] "Iteration:2  Best_f:0.0854559767108977  N_Evals:20"
[1] "Iteration:3  Best_f:0.0854559767108977  N_Evals:30"
[1] "Iteration:4  Best_f:0.0254022123367672  N_Evals:40"
[1] "Iteration:5  Best_f:0.0254022123367672  N_Evals:50"
[1] "Iteration:6  Best_f:0.0219997461561912  N_Evals:60"
[1] "Iteration:7  Best_f:0.0219997461561912  N_Evals:70"
[1] "Iteration:8  Best_f:0.0219997461561912  N_Evals:80"
[1] "Iteration:9  Best_f:0.0219997461561833  N_Evals:90"
[1] "Iteration:10  Best_f:0.0184457218337944  N_Evals:100"
[1] "Iteration:11  Best_f:0.0184457218337944  N_Evals:110"
[1] "Iteration:12  Best_f:0.0183427827639755  N_Evals:120"
[1] "Iteration:13  Best_f:0.0178215204078944  N_Evals:130"
[1] "Iteration:14  Best_f:0.0176272853949692  N_Evals:140"
[1] "Iteration:15  Best_f:0.0167420314449053  N_Evals:150"
[1] "Iteration:16  Best_f:0.0153204665485795  N_Evals:160"
[1] "Iteration:17  Best_f:0.0120946654642356  N_Evals:170"
[1] "Iteration:18  Best_f:0.0119692108374706  N_Evals:180"
[1] "Iteration:19  Best_f:0.0116108974553988  N_Evals:190"
[1] "Iteration:20  Best_f:0.0114393314914684  N_Evals:200"
[1] "Iteration:21  Best_f:0.0113493874117593  N_Evals:210"
[1] "Iteration:22  Best_f:0.010237615300133  N_Evals:220"
[1] "Iteration:23  Best_f:0.010237615300133  N_Evals:230"
[1] "Iteration:24  Best_f:0.00997208674644057  N_Evals:240"
[1] "Iteration:25  Best_f:0.00916567374787542  N_Evals:250"
[1] "Iteration:26  Best_f:0.00916567374787542  N_Evals:260"
[1] "Iteration:27  Best_f:0.00868173441364238  N_Evals:270"
[1] "Iteration:28  Best_f:0.00840524941393896  N_Evals:280"
[1] "Iteration:29  Best_f:0.00805265199842338  N_Evals:290"
[1] "Iteration:30  Best_f:0.00781742746453421  N_Evals:300"
[1] "Iteration:31  Best_f:0.00780973264265596  N_Evals:310"
[1] "Iteration:32  Best_f:0.00729208903129881  N_Evals:320"
[1] "Iteration:33  Best_f:0.00726454724972479  N_Evals:330"
[1] "Iteration:34  Best_f:0.00699463947073246  N_Evals:340"
[1] "Iteration:35  Best_f:0.00661727244739602  N_Evals:350"
[1] "Iteration:36  Best_f:0.00588047884973334  N_Evals:360"
[1] "Iteration:37  Best_f:0.00588047884973334  N_Evals:370"
[1] "Iteration:38  Best_f:0.00582771313144051  N_Evals:380"
[1] "Iteration:39  Best_f:0.00582771313144051  N_Evals:390"
[1] "Iteration:40  Best_f:0.00581611279934521  N_Evals:400"
> 
> #Visual solution after optimization
> simulatedData=plotLBodeFitness(cnolistCNORodeExample, model,indices=indices,ode_parameters=ode_parameters);
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>