R/getModelParameters.R

Defines functions getModelParameters

getModelParameters <- function(variables, data){

  params = NULL
  paramType = NULL
  paramLocation = NULL
  for (var in variables){
    temp = var$provideParameterTypesAndLocations(data = data)
    params = c(params, temp$paramNames)
    paramType = c(paramType, temp$paramTypes)
    paramLocation = c(paramLocation, temp$paramLocation)
  }

  # start with all parameters that deal with data side

  # reorder list so that model parameters show up first for easy plotting
  params2 = c(params[which(paramType == "model")], params[which(paramType == "data")])
  paramType2 = c(paramType[which(paramType == "model")], paramType[which(paramType == "data")])
  paramLocation2 = c(paramLocation[which(paramType == "model")], paramLocation[which(paramType == "data")])

  return(list(paramNames=params2, paramTypes=paramType2, paramLocation = paramLocation2))
}

Try the blatent package in your browser

Any scripts or data that you put into this service are public.

blatent documentation built on May 29, 2024, 5:42 a.m.