uwesterr / CoronaPredict

With AdMOS develop a shiny app to predict corona progress
1 stars 2 forks source link

write function to prepare parameters for optimiser #121

Closed uwesterr closed 4 years ago

uwesterr commented 4 years ago

create a function to prepare an input vector to Rechenkern based on optimisation parameters to replace

   inputForOptimization <- input# to make setting reduzierung_rtx easy and fast
    inputForOptimization$reduzierung_rt1 <- allPara[["reduzierung_rt1"]]
    inputForOptimization$reduzierung_rt2 <- allPara[["reduzierung_rt2"]]
    inputForOptimization$reduzierung_rt3 <- allPara[["reduzierung_rt3"]]

in a general way, something like

inputForOptimization = merge(input, allPara)

uwesterr commented 4 years ago

done

calcPredictionsForGaOptimization = function(optPara, allPara, parameter_tibble, RkiDataWithR0N0,input) {   
  # calculate the predictions for the optimzaition loop, i.e. GA algorithm
  denormPara <- denormalizePara(optPara, parameter_tibble)
  #  cat("para",unlist(denormPara,"\n"))
  for(i in 1 : length(optPara)){
    allPara[[i]] <- denormPara[[i]]
  }

  inputForOptimization <- input # to make setting reduzierung_rtx easy and fast
  inputVarNames <- names(allPara)
  for (inputVarName in   inputVarNames ) {
    inputForOptimization[[inputVarName]]<- allPara[[inputVarName]]
  }