The most basic estimate is to look at the amount of blocks mined since the last diff-change and the elapsed time. Divide 10 by the average time per block (in minutes) since the last diff-change and multiply the result with the current difficulty and you obtain an estimate for the next difficulty. Since the network actually computes the new difficulty this way when a change occurs, this estimate gets very accurate close to a change. But early in a cycle, it can swing wildly.
hmm thanks.. lookign into that.. im seeing something weird on a test recent blocks timestamp diff was a negative value how is that so?