View source: R/workflow_rcpp.R
| run_model_single | R Documentation |
This function is the C++ implementation of run_model, it will run a singly constrained model there must be a match in the dimensions, when running a production constrained model, any(dim(distance) == length(flows)) must be TRUE if no values for weight are provided, a vector with ones is used
run_model_single(flows, distance, weight = NULL, beta = 0.25)
flows |
A vector of either origin (production constrained) or destination (attraction constrained) flows. |
distance |
a distance matrix between origins and destinations, provide distance in km. |
weight |
a vector of weights for the unconstrained part of the model. |
beta |
Exponent to use when calculating the cost function, default .25. |
A list containing a matrix with predicted values.
data(flows_test)
data(distance_test)
flows_test <- apply(flows_test,MARGIN = 1,FUN = sum)
model_test <- run_model_single(flows_test,distance_test)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.