Quantcast
Channel: Data Science, Analytics and Big Data discussions - Topics tagged data_science
Viewing all articles
Browse latest Browse all 787

Risk Constraint in PortfolioAnalytics- Portfolio Optimazation(Stocks)

$
0
0

@sirishan wrote:

Can some one help me on the below ?

1)How to add risk constraint in PortfolioAnalytics?
I have tried adding the return as constraint,risk as objective function and its working fine. Can’t we do return as objective function and risk as constraint ?

  1. when i execute this code, i got the below result and would need help here to interpret the output .
    p <- portfolio.spec(assets = c(“WST”,“HDB”,“PAM”,“CRL”,“JPM”))
    p<- add.constraint(p, type = “box”, min = 0.05, max = 0.8)
    p <-add.constraint(portfolio = p, type = “full_investment”)
    maxret.port <- add.objective(p, type = “return”,name = “mean”)
    minvar.port <- add.objective(maxret.port, type = “risk”, name = “var”)
    minvar.port <- optimize.portfolio(returns.data, minvar.port, optimize_method = “ROI”)
    minvar.port

image

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 787

Trending Articles