Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/MP_3g_MultiStockHCR.R
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ MultiStockHCR <- function(stocks, indices, advice, advice.ctrl, year, stknm,...)
if(any(Fadv0 < Flow)){#if((approach == 'min') & any(Fadv0 < Flow)){
lambda2 <- apply(Flow/Fadv0,2,max) #[it]
upps <- Fupp/Fadv0
comp1 <- colSums((1/sweep(upps,1,lambda2,"/")) >1) # [it]
comp1 <- colSums((1/sweep(upps,2,lambda2,"/")) >1) # [it]
# The correction will be always the minimum of the Fupp/Fadv0 ratios, because for NONE of the stock we can be above.
pos <- apply(upps,2,which.min) # [it]
# If comp1 == 0, for this iteration non of the stocks is above Fupp
Expand Down