I am trying to compute a measure of environmental complexity based on a rolling regression formula. The formula for complexity is defined as follows: for a rolling three-yea