Bitcoin Forum

Economy => Speculation => Topic started by: drawingthesun on November 25, 2013, 10:13:32 AM



Title: How to model a logarithmic progression and is this accurate for Bitcoin price?
Post by: drawingthesun on November 25, 2013, 10:13:32 AM
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.


Title: Re: How to model a logarithmic progression and is this accurate for Bitcoin price?
Post by: Rannasha on November 25, 2013, 10:44:39 AM
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.


Title: Re: How to model a logarithmic progression and is this accurate for Bitcoin price?
Post by: drawingthesun on November 25, 2013, 10:52:39 AM
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?


Title: Re: How to model a logarithmic progression and is this accurate for Bitcoin price?
Post by: Rannasha on November 25, 2013, 11:03:00 AM
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.


Title: Re: How to model a logarithmic progression and is this accurate for Bitcoin price?
Post by: BitchicksHusband on November 25, 2013, 05:36:28 PM
We already did a lot of work on that in this thread:

http://bitcointalk.org/index.php?topic=322058.0

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

https://bitcointalk.org/index.php?topic=322058.msg3549092#msg3549092

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.


Title: Re: How to model a logarithmic progression and is this accurate for Bitcoin price?
Post by: drawingthesun on November 25, 2013, 05:43:51 PM
Thanks BitchicksHusband, :)