'start'
'#Copyright (c) 2009, 2010 Sebastien Bihorel'
'#All rights reserved.'
'#'
'#This file is part of scaRabee.'
'#'
'#    scaRabee is free software: you can redistribute it and/or modify'
'#    it under the terms of the GNU General Public License as published by'
'#    the Free Software Foundation, either version 3 of the License, or'
'#    (at your option) any later version.'
'#'
'#    scaRabee is distributed in the hope that it will be useful,'
'#    but WITHOUT ANY WARRANTY; without even the implied warranty of'
'#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the'
'#    GNU General Public License for more details.'
'#'
'#    You should have received a copy of the GNU General Public License'
'#    along with scaRabee.  If not, see <http://www.gnu.org/licenses/>.'
'#'
'@newline@'
'rm(list=ls(all=T))'
'@newline@'
'################################################################################'
'# User settings:'
'@newline@'
'# Please provide the names of the following files'
'  #   - data:  the dataset; must be a .csv file with 3 columns'
'  #   - param: the initial guess for model and residual variability'
'  #            parameters; must be a .csv file with 6 columns'
'  #   - dose:  the dosing history; must be a .csv file with 2 columns'
'  #   - cov:   the covariate history: must be a .csv file with at least'
'  #            3 columns'
'  #   - model: the model; a .R file located in the model.definition'
'  #            subdirectory'
'  #   - var:   the residual variability model; a .R file located in the'
'  #            model.definition subdirectory'
'  #   - sec:   a .R file located in the model.definition subdirectory'
'  #            defining the secondary parameters'
'@newline@'
'  files <- list(data  = \'data.csv\','
'                param = \'initials.csv\','
'                dose  = \'dosing.csv\','
'                cov   = \'covariates.csv\','
'                model = \'model.R\','
'                var   = \'weighting.R\','
'                sec   = \'secondary.R\')'
'@newline@'
'# Please, enter the indices of model outputs corresponding to the observations'
'  states <- c(1)'
'@newline@'
'# Please, enter the type of run: \'simulation\' or \'estimation\''
'  runtype <- @type@'
'@newline@'
'# Please, indicate if you want to run the analysis in debug mode: TRUE or FALSE'
'  debugmode <- FALSE'
'@newline@'
'# Please, enter the maximum number of iterations or function evaluations'
'# for the estimation'
'  estim <- list(maxiter=500,'
'                maxfunc=5000)'
'@newline@'
'################################################################################'
'@newline@'
'library(lattice)'
'library(scaRabee)'
'library(deSolve)'
'library(PBSddesolve)'
'library(neldermead)'
'@newline@'
'  scarabee.analysis(files=files,'
'                    states=states,'
'                    runtype=runtype,'
'                    debugmode=debugmode,'
'                    estim=estim,'
'                    analysis=sub(\'.R$\',\'\',commandArgs()[3]))'
'@newline@'