I have a stream of numbers - efficiency ratio of solar cells - in range 0-100%. The efficiency is defined as (produced/expected)*100.
I'm measuring the ratio every minute, and I'd like to have a "cumulative" ratio that shows the average.
A little problem is at night, when the ratio becomes undefined, since there is no light and no power. I'm setting it to zero at night, and this would be excluded from the computation of average.
Is there some formula how to keep such average, so that it'll show ever-improving average of the efficiency? I want that when the solar cells age, and lose efficiency, that this average would also lower - but when for example snow falls onto the cells, and they don't work properly, it should not ruin the average immediately.
Ideally I'd want to keep just one variable, maybe two. I can no way keep all the past values.