What is the formula for inferring hash rate from difficulty and block frequency? Two parts to this question
1/ There have recently been concerns over drops in hash rate observed on sites such as blockchain.com. However, my understanding is that hash rate is inferred from the difficulty level and the block intervals. I am trying to work out the exact formula for the inference of hash rate.
I know that the average time we can expect to find a block in is calculated with the following formula:
average time to find a block = (difficulty * 32 ** 2)/ hash rate

Would that mean that hash rate is inferred with the following formula?
hash rate = (difficulty * 32 ** 2)/ time interval between the last two blocks

2/ I mainly want the first part answered but if you are feeling rosy today, an answer to this second part would be amazing.
Block times are Poisson distributed. I understand that this allows us to calculate the probability that block times increase to such an extent over the course of a day that it infers a 40% reduction in hash rate.
Does anyone know the exact calculation which would let us calculate this probability?
Here's some rough ideas I have about the calculation:
The following formula allows us to calculate the probability that k events take place in time period t.
P(k in t) = (e ** -lam)*(lam**k / k!) 
where lam = (average events which can be expected to be observed per unit of time  * t) 

The average events which can be expected to be observed in the case of block intervals is 1 block per ten minutes so 1/10.
Let's say we have hash rate dropping 50% over the course of one day, would that imply that we are observing 288 blocks over the course of 1440 minutes?
If I am thinking about this in the correct way, this would mean the calculation is as follows:
P(288 blocks in 1440 minutes) = (e ** -(144)*((144**288)/288!)

Not sure if this calculation is correct. But to take it further, this would calculate the small probability of exactly 288 blocks being found in 1440 minutes. But if it were possible to calculate the Poisson distribution of block intervals, we may be able to find the probability of finding greater than or equal to 288 blocks in 1440 minutes.
As you can probably tell, my understanding of the second part of the question is limited so if you have an answer to even just the fist part, that would be amazing!
Better Late than Never. I was asking myself the same question...I thought the hash rate of the network came from Full Nodes observation on Miners...I was wrong.
I was looking for this answer on Bitcoin.org, but it's on Blockchain website: https://www.blockchain.com/charts/hash-rate. Look at the methodology at the bottom of the page.
Formula is Hash rate = (Difficulty*2^32)/(intervals in seconds between 2 blocks.
Theoretically you know this to be 600 seconds. So the tell it as H = 2exp32 D/T..
For the second part of your answer, this is from my own inference, but within a day, we can expect a persistent shorter time of resolution per blocks, as hash speed in the long run accelerates at about 400% per year (from technological efficiencies and Mining Nodes being added), meaning about 0,45% per day. Look at Network Difficulty over time, and you see that it continuously increases Difficulty, neutralizing efficiencies, to maintain block resolution time around 10 minutes. If it did not do so, reversibility would increase making reliability of security vulnerable, weakening users confidence, whom would either seek trust signals or defect . On this you can read Nakamoto's introduction of his white paper.
Many factors may affect the slowing of the Networks Hash rate. The most important is not from technology when Hash slips, but from defections (permanent or temporary) of miners associated with Price of the Bitcoin usually.
With blockchain.com latest charts (data from March 18 2021)I can infer the average time of block resolution from the same formula. By doing T = (Difficulty*(2^32)/Network Hash Rate. (21.6TH*4,294967296)/157.6EH = 588.65 seconds or 9'48&quot;.
I am new to this, a week or so, and am not and won't be either an investor, nor miner...but I am always very curious, like estimating the number of Miner Nodes, a statistics I cannot find anywhere.
They are about 70 Million lightweight Nodes (mostly wallets), Between 8,000 to 12,000 Full Nodes...but how many Mining Nodes? At Least 1,1 Million to up to 6 Million depending of the formula you create (or I create). If someone has the answer to this, please go ahead.