Author

Topic: How to model a logarithmic progression and is this accurate for Bitcoin price? (Read 2046 times)

legendary
Activity: 1176
Merit: 1015
Thanks BitchicksHusband, Smiley
sr. member
Activity: 378
Merit: 255
We already did a lot of work on that in this thread:

https://bitcointalksearch.org/topic/monthly-average-usdbitcoin-price-trend-322058

There is even a Google Docs Spreadsheet that you can copy here:

https://bitcointalksearch.org/topic/m.3549092

I don't know if that's the one you can play with or another copy later, but there's one where you can tweak the variables.

In any event, looking at the formulas used in this spreadsheet should give you a great head start.
hero member
Activity: 728
Merit: 500
Awesome, thanks for the response.

I assume you mean exponential progression (rate of increase goes up) rather than logarithmic progression (rate of increase slows down)? The two are eachothers inverse.

Haha yeah this is what I need, I guess I got confused about the difference. Yeah rate of increase in absolute values increasings whereas the percentage increase is linear, thats correct right?

Yes.
legendary
Activity: 1176
Merit: 1015
Awesome, thanks for the response.

I assume you mean exponential progression (rate of increase goes up) rather than logarithmic progression (rate of increase slows down)? The two are eachothers inverse.

Haha yeah this is what I need, I guess I got confused about the difference. Yeah rate of increase in absolute values increasing whereas the percentage increase is linear, thats correct right?
hero member
Activity: 728
Merit: 500
I assume you mean exponential progression (rate of increase goes up) rather than logarithmic progression (rate of increase slows down)? The two are eachothers inverse.

Anyway, it'd be something like this (using C-syntax):
Code:
double startprice = 10;
double endprice = 10000;
double logpriceratio = log(endprice / startprice);
int years = 2;
int days = years * 365;

double price = startprice;
int week = 0;

for (int i = 0; i < days + 1; i += 7)
{
    price = startprice * exp(i / days * logpriceratio);
    fprintf("Week %3i | Price: %4.2f\n", week, price);
}

log() and exp() are standard functions for logarithm and exponentiation with base e.
legendary
Activity: 1176
Merit: 1015
I am trying to build a simple Bitcoin price model in matlab.

I have a starting price, around $10 beginning of this year and want to model the values if the price ends up at $10,000 at the end of 2014. I believe that a linear progression is inaccurate ($5,000 end of this year) and want to run a for loop (in weeks) progressing the price each week using a logarithmic increase.

How would I set up a logarithmic "for loop"?

This works for linear increase but does not represent reality at all:
Quote
startPrice = 10;
endPrice = 10000;
years = 2;

days = years * ( 365 );

price = startPrice;
week = 0;

difference = (startPrice - endPrice) / days;

for day=1:days
   price = price - difference;
    
    if mod(day, 7) == 0
        week = week + 1;
        fprintf('Week %3i | Price: %4.2f\n',week, price)
    end
end

Also, if you think a logarithmic model is inaccurate please explain why.
Jump to: