Skip to content

Commit

Permalink
issue 68 .. resolved 0 variance
Browse files Browse the repository at this point in the history
  • Loading branch information
midoshammaa committed Dec 13, 2021
1 parent dd13b74 commit 6b69ce8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions R/fitFfmDT.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,17 @@ specFfm <- function(data, asset.var, ret.var, date.var, exposure.vars,
obj$model.styleOnly = TRUE
} else {
obj$model.styleOnly = FALSE
# this would prevent the issue of having one company in a sector..
# this would produce 0 variance whcih causes the weight to blow up iin
# WLS... I check for the number of companies per date becuase we fit a model
# for each day...
if (min( data[ , .N, by = c(date.var, obj$exposures.char)]$N) == 1 )
stop("
There is at least one ", obj$exposures.char, " that has one observation which will cause a
problem with computing residual variance.")
}


obj$rob.stats <- rob.stats
obj$addIntercept <- addIntercept
obj$lagged <- FALSE
Expand Down

0 comments on commit 6b69ce8

Please sign in to comment.