Meni Rosenfeld
Donator
Legendary
Offline
Activity: 2044
Merit: 1000


May 30, 2011, 06:28:20 PM 

In fact it's arguably even simpler. For this you don't need to keep ltotalscore. To find the expected payout of a worker for the current round, do
select (1rd.f)*(1rd.c)*p*rd.b*sum(exp(lscorelastlscore))
p should be calculated based on the current difficulty.
Hmm, unless I am doing something wrong, this is throwing out very small expected values per worker. Much lower than the current balance calculation. < 0.001 BTC. Is it possible you've used lastscore instead of lastlscore? If that's not it, can you post the values of rd.f rd.c p rd.b lastlscore sum(exp(lscorelastlscore)) (1rd.f)*(1rd.c)*p*rd.b*sum(exp(lscorelastlscore))







Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.


martok


May 30, 2011, 07:01:57 PM 

In fact it's arguably even simpler. For this you don't need to keep ltotalscore. To find the expected payout of a worker for the current round, do
select (1rd.f)*(1rd.c)*p*rd.b*sum(exp(lscorelastlscore))
p should be calculated based on the current difficulty.
Hmm, unless I am doing something wrong, this is throwing out very small expected values per worker. Much lower than the current balance calculation. < 0.001 BTC. Is it possible you've used lastscore instead of lastlscore? If that's not it, can you post the values of rd.f rd.c p rd.b lastlscore sum(exp(lscorelastlscore)) (1rd.f)*(1rd.c)*p*rd.b*sum(exp(lscorelastlscore)) f = 0.001001... c = 0.001 lastlscore = 369.6131 sum(exp(lscorelastlscore)) = 15.0887 (1f)*(1c)*p*b*sum = 0.001 sum(exp(lscoreltotalscore)) 0.0345 (1f)*b*0.0345 = 1.73




Meni Rosenfeld
Donator
Legendary
Offline
Activity: 2044
Merit: 1000


May 30, 2011, 07:32:39 PM 

In fact it's arguably even simpler. For this you don't need to keep ltotalscore. To find the expected payout of a worker for the current round, do
select (1rd.f)*(1rd.c)*p*rd.b*sum(exp(lscorelastlscore))
p should be calculated based on the current difficulty.
Hmm, unless I am doing something wrong, this is throwing out very small expected values per worker. Much lower than the current balance calculation. < 0.001 BTC. Is it possible you've used lastscore instead of lastlscore? If that's not it, can you post the values of rd.f rd.c p rd.b lastlscore sum(exp(lscorelastlscore)) (1rd.f)*(1rd.c)*p*rd.b*sum(exp(lscorelastlscore)) f = 0.001001... c = 0.001 lastlscore = 369.6131 sum(exp(lscorelastlscore)) = 15.0887 (1f)*(1c)*p*b*sum = 0.001 sum(exp(lscoreltotalscore)) 0.0345 (1f)*b*0.0345 = 1.73 The calculations are correct. 0.001 (actually it's closer to 0.002) is the expectation, while 1.73 is what it would be if it's very lucky and the round ends now (remember, on average 430000 more shares will be introduced before the round ends). Come to think of it, unless you make c higher (decreasing variance for participants), I don't know if the expectation for already submitted shares is such a useful measure. Can you tell me the hashrate of this worker and how long it has mined before this evaluation?




martok


May 30, 2011, 08:45:26 PM 

The calculations are correct. 0.001 (actually it's closer to 0.002) is the expectation, while 1.73 is what it would be if it's very lucky and the round ends now (remember, on average 430000 more shares will be introduced before the round ends). Come to think of it, unless you make c higher (decreasing variance for participants), I don't know if the expectation for already submitted shares is such a useful measure. Can you tell me the hashrate of this worker and how long it has mined before this evaluation?
That particular worker was my own and it mined at around 330 mhash that round. The round lasted 23 hours, 37 minutes and I would estimate the average of the pool at around 78 gh/s. So yes, definitely a short round. I have no long rounds to analyze yet though.




martok


June 01, 2011, 10:07:32 PM 

Hi again,
Hopefully I have the payment formulas of your method right. I am wondering what the round duration is before the operator loses money with an expected fee of 0 at c=0.001. After 4 rounds, I have lost on all even those of relatively short duration. Since I have a miner as well, it doesn't really matter that much. Just wanted to doublecheck I am scoring correctly.
Here is output on the production pool, note that round 5 is current. All scores (os, totalscore) are stored in log scale (los = os, ltotalscore = totalscore) I just didn't rename the fields.
select round.id,max(time)min(time) as duration, f,c,b,os,totalscore, cast(f*b as numeric(22,8)) as fixed_fee, cast((1f)*b*exp_or_zero(ostotalscore) as numeric(22,8)) as var_fee from share inner join round on round.id = round_id group by round.id,f,c,b,os,totalscore order by round.id;
iddurationfcbostotalscorefixed_feevar_fee 11 day 04:37:44.148420.0010010010010010.00150.000500005.4987402081296440.5831244461390.050050550.00000000 22 days 21:09:25.4957210.0010010010010010.00150.163500006.07607688989912712.7691822134410.050213710.00000000 323:37:05.51120.0010010010010010.00150.0816.07607688989912375.6915034382330.050131130.00000000 41 day 22:36:46.4511890.0010010010010010.00150.040500006.07607688989912652.2428204468030.050090590.00000000 52 days 00:42:35.3600260.0010010010010010.001506.07607688989912833.9632347425250.050050050.00000000
exp_or_zero function is a wrapper on exp() which returns 0 in case of an underflow. It does so only in the current round which is a bit long.




Meni Rosenfeld
Donator
Legendary
Offline
Activity: 2044
Merit: 1000


June 02, 2011, 04:09:09 AM 

Hi again,
Hopefully I have the payment formulas of your method right. I am wondering what the round duration is before the operator loses money with an expected fee of 0 at c=0.001. After 4 rounds, I have lost on all even those of relatively short duration. Since I have a miner as well, it doesn't really matter that much. Just wanted to doublecheck I am scoring correctly.
Looks ok, but it will help if you also post the number of shares on each round. To profit in a round you need it to have less than 3,000 shares (which happens with probability 1/140). So that's fairly rare, but in those cases you do, you'll make on average about 1/7 of the block reward so it evens out. The variance is still not too bad because even when you lose, you don't lose too much.




martok


June 02, 2011, 04:21:36 AM 

Hi again,
Hopefully I have the payment formulas of your method right. I am wondering what the round duration is before the operator loses money with an expected fee of 0 at c=0.001. After 4 rounds, I have lost on all even those of relatively short duration. Since I have a miner as well, it doesn't really matter that much. Just wanted to doublecheck I am scoring correctly.
Looks ok, but it will help if you also post the number of shares on each round. To profit in a round you need it to have less than 3,000 shares (which happens with probability 1/140). So that's fairly rare, but in those cases you do, you'll make on average about 1/7 of the block reward so it evens out. The variance is still not too bad because even when you lose, you don't lose too much. Thanks, as long as it looks ok, I am content with the variance. For completeness though: select round.id,count(*) from round inner join share on round.id=round_id where score is not null group by round.id order by round.id; idcount 183410 2275961 3161084 4281610 5412581




Meni Rosenfeld
Donator
Legendary
Offline
Activity: 2044
Merit: 1000


June 02, 2011, 05:02:14 AM 

Hi again,
Hopefully I have the payment formulas of your method right. I am wondering what the round duration is before the operator loses money with an expected fee of 0 at c=0.001. After 4 rounds, I have lost on all even those of relatively short duration. Since I have a miner as well, it doesn't really matter that much. Just wanted to doublecheck I am scoring correctly.
Looks ok, but it will help if you also post the number of shares on each round. To profit in a round you need it to have less than 3,000 shares (which happens with probability 1/140). So that's fairly rare, but in those cases you do, you'll make on average about 1/7 of the block reward so it evens out. The variance is still not too bad because even when you lose, you don't lose too much. Thanks, as long as it looks ok, I am content with the variance. For completeness though: select round.id,count(*) from round inner join share on round.id=round_id where score is not null group by round.id order by round.id; idcount 183410 2275961 3161084 4281610 5412581 I'm finding some inconsistencies between the reported ltotalscore and what it should be based on the number of shares. For rounds 3 and 4 the error is only in the 2nd decimal place so it's tolerable. But for rounds 2 and 5, the total score is as if the round lasted 307990 and 360808 shares, respectively.




martok


June 02, 2011, 06:50:15 AM 

Hi again,
Hopefully I have the payment formulas of your method right. I am wondering what the round duration is before the operator loses money with an expected fee of 0 at c=0.001. After 4 rounds, I have lost on all even those of relatively short duration. Since I have a miner as well, it doesn't really matter that much. Just wanted to doublecheck I am scoring correctly.
Looks ok, but it will help if you also post the number of shares on each round. To profit in a round you need it to have less than 3,000 shares (which happens with probability 1/140). So that's fairly rare, but in those cases you do, you'll make on average about 1/7 of the block reward so it evens out. The variance is still not too bad because even when you lose, you don't lose too much. Thanks, as long as it looks ok, I am content with the variance. For completeness though: select round.id,count(*) from round inner join share on round.id=round_id where score is not null group by round.id order by round.id; idcount 183410 2275961 3161084 4281610 5412581 I'm finding some inconsistencies between the reported ltotalscore and what it should be based on the number of shares. For rounds 3 and 4 the error is only in the 2nd decimal place so it's tolerable. But for rounds 2 and 5, the total score is as if the round lasted 307990 and 360808 shares, respectively. Ok, for 5 that may be my posting error. 5 is current round and I posted totalscore earlier in the day and posted share count later. Here it is in an atomic select totalscore: 997.23786939 shares: 431965 As for round 2, can the difficulty change account for that? r gets adjusted and subsequent scores also. The above reported r value for round 2 is that at the end of the round, but not so for the duration.




Meni Rosenfeld
Donator
Legendary
Offline
Activity: 2044
Merit: 1000


June 02, 2011, 08:14:35 AM 

Ok, for 5 that may be my posting error. 5 is current round and I posted totalscore earlier in the day and posted share count later. Here it is in an atomic select totalscore: 997.23786939 shares: 431965
Ok, that's better. There's still an error in the 3rd decimal place which I don't think should happen. As for round 2, can the difficulty change account for that? r gets adjusted and subsequent scores also. The above reported r value for round 2 is that at the end of the round, but not so for the duration.
Yeah, that could be it. If you happen to know at which share the difficulty changed I'll be able to verify it (assuming everything worked as specified for that round).




simplecoin


June 06, 2011, 06:14:35 PM 

I could really use the help getting this setup on my opensource pool frontend.
It's based on mysql, php and pushpool.
Any help would be greatly appreciated, as well as benefit the community with an opensource solution for their own implementation.

Donations: 1VjGJHPtLodwCFBDWsHJMdEhqRcRKdBQk



Dusty


June 06, 2011, 06:43:09 PM 

(watching)




Meni Rosenfeld
Donator
Legendary
Offline
Activity: 2044
Merit: 1000


June 06, 2011, 07:25:15 PM 

I could really use the help getting this setup on my opensource pool frontend.
It's based on mysql, php and pushpool.
Any help would be greatly appreciated, as well as benefit the community with an opensource solution for their own implementation.
I'll sit this one out because I haven't the slightest idea how to set it up (if I had, I probably would have done so myself a long time ago). I hope martok will be willing to compare notes with you.




simplecoin


June 06, 2011, 09:15:15 PM 

I'm getting close seems like r^i is huge! even a 53digit double gets rounded eventually.

Donations: 1VjGJHPtLodwCFBDWsHJMdEhqRcRKdBQk



Meni Rosenfeld
Donator
Legendary
Offline
Activity: 2044
Merit: 1000


June 07, 2011, 04:24:23 AM 

I'm getting close seems like r^i is huge! even a 53digit double gets rounded eventually. You'll need to use either periodic rescaling or logarithmic scale, as discussed in this thread.




simplecoin


June 07, 2011, 03:35:48 PM 

I'm getting close seems like r^i is huge! even a 53digit double gets rounded eventually. You'll need to use either periodic rescaling or logarithmic scale, as discussed in this thread. I'm going for logarithmic, since the other seems hackish. So, I'm close...... it looks like max is the previous row lscore value, is that right?

Donations: 1VjGJHPtLodwCFBDWsHJMdEhqRcRKdBQk



Meni Rosenfeld
Donator
Legendary
Offline
Activity: 2044
Merit: 1000


June 07, 2011, 03:45:30 PM 

I'm getting close seems like r^i is huge! even a 53digit double gets rounded eventually. You'll need to use either periodic rescaling or logarithmic scale, as discussed in this thread. I'm going for logarithmic, since the other seems hackish. So, I'm close...... it looks like max is the previous row lscore value, is that right? Yes. The exact value used for max doesn't matter, as long as it's used consistently and it's about the right size. Its role in the calculation is just to shift the scale to a reasonable location to avoid under/over flowing the exp.




simplecoin


June 07, 2011, 04:01:38 PM 

Got it! I haven't had to wrap my head around this much math in a while.

Donations: 1VjGJHPtLodwCFBDWsHJMdEhqRcRKdBQk



simplecoin


June 07, 2011, 04:53:31 PM 

1 final question.
How do I calculate estimates while using the logarithmic scaling?
(Update, nvm, think I got it)

Donations: 1VjGJHPtLodwCFBDWsHJMdEhqRcRKdBQk



simplecoin


June 07, 2011, 06:39:45 PM 

using (1rd.f)*(1rd.c)*p*rd.b*sum(exp(lscorelastlscore)) to calculate an estimated earning, I'm getting wildly incorrect results.
For example my account says 11.x, when I run the full round calc it's closer to 6.
Additionally, the sum of estimates is >88, when it should be < 50.
I'm looking at a round with ~1mil shares.

Donations: 1VjGJHPtLodwCFBDWsHJMdEhqRcRKdBQk



