View source: R/optim_portfolio.R
optim_portfolio | R Documentation |
Optimal Portfolio.
optim_portfolio(w_ini, fn, lb, ub, eqfun, eqB, w_bench = NULL,
lb_act = NULL, ub_act = NULL, ineqfun = NULL, ineqLB = NULL,
ineqUB = NULL, method = "RI", fixed = NULL, n.restarts = 10,
n.sim = 20000, type = "absolute", itermax = 1000, NP = 100,
max.time = 180)
w_ini |
Initial weights. |
fn |
Objective function or list of objective function. By default it corresponds to the mean-var utility. |
lb |
Lower bound. |
ub |
Upper bound. |
eqfun |
Equality constraint function returning vector. |
eqB |
Equality constraints. |
w_bench |
Benchmark weigths. |
lb_act |
Lower bound active weight per asset |
ub_act |
Upper bound active weight per asset |
ineqfun |
Inequality constraint function returning vector. |
ineqLB |
Inequality lower bound. |
ineqUB |
Inequality upper bound. |
method |
Gradient descent (GD), GD with random initialization (RI), differential evolution (DE), Genetic Opt. using Derivative (GE), Generalized Simulated Annealing (SA) or Memetic with local search (MALS). |
fixed |
Numeric index indicating parameters that stay fixed. |
n.sim |
Random parameters for every restart of the solver. |
type |
Type of objective function. absolute or relative. |
itermax |
Maximum iteration (population generation) allowed. |
NP |
Number of population members. |
max.time |
Max time in seconds. Applied to SA. |
n.restars |
Number of solver restarts. |
Optimal weights.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.