0
|
20717 Views
|
3 Replies
|
1 Total Likes
View groups...
Share
GROUPS:

# I created a model for the bitcoin price

Posted 10 years ago
 It needs work, but it gets the shape of the currency's Price as a function of time P(t) as well as respectably reproducing the log plot.  The model is very senesitive to the "effective bitcoin supply" in the denominator.  Anyway, have at it I'd love to see some noise added, or other artifacts (* Bitcoin price model plotter // Altoidnerd 2013*)    Demand[t_] := 1/(1 + Exp[-t/tp])  Supply[t_] := t*2^(-t/th)  {Slider[Dynamic[tp], {0, 29, .1}, ImageSize -> 1300], Dynamic[tp], "= propogation time tp"  , Slider[Dynamic[th], {0, 3, .00001}, ImageSize -> 1300], Dynamic[th], "= effective bitcoin supply"}Dynamic[ Plot[Demand[t]/Supply[t], {t, .0000001, 20}, ImageSize -> 500,   AspectRatio -> 1/1.6^2]]Dynamic[ Plot[Log[Demand[t]/Supply[t]], {t, .0000001, 20}, ImageSize -> 500,   AspectRatio -> 1/1.6^2]](* You can comment out this table if you just want to use the sliders \to mess with the graph.  If you run both the dynamics and the table \you'll see a cool animation but after that you'll be manipulating \over 200 plots simultaneously*)(* Table[{Plot[Demand[t]/Supply[t],{t,.001,5},ImageSize\[Rule]500],Plot[Log[Demand[t]/Supply[t]],{t,.01,5},ImageSize\[Rule]500]},{th,1*\10^-3,.9995,5*10^-3}] *)
3 Replies
Sort By:
Posted 10 years ago
 This code is written in Wolfram Language - a functional programming language that requires Mathematica software to run. There are many educational materials to learn this language: from general resources to videos and courses.
Posted 10 years ago
 Hi! I'm new to wolfram products. May I ask about these codes. How would you use these? I've just started to learn Wolfram alpha how to use it. But I have no idea what one can do with this kind of code. Let say I would love an introduction!
Posted 10 years ago
 First I just wanted to clean up the presentation, using a single Manipulate to show the supply and demand functions you have posited and the way the parameters control them.Demand[time_, propogationtime_]:=  1/(1+Exp[-time/propogationtime]}Supply[time_, bitcoinsupply_]:= time*2^(-time/bitcoinsupply)Manipulate[Plot[{Supply[time,bitcoinsupply], Demand[time, propogationtime]}, {time, .01,20},PlotLabel->"Supply blue vs Demand red"], {bitcoinsupply, 1, 5, .01},{propogationtime, 1, 30, .1}]I also made the variable names more descriptive to help track which is driving what.The bit of your previous that didn't make sense to me is the expectation that price = demand / supply.  That gives us rather unintuitive "U" shapes when used with these functions, with a near vertical drop in price initially, a long bottom, then exponential increase as your "saturated" demand function goes basically stable, but your "supply" function drops to zero.  I don't see any reason to expect a price to develop that way.  Also, normally one finds clearing prices as the point of intersection of demand and supply curves, where those functions describe the sensitivity of supply and demand to changes in the price.  Your supply and demand functions don't depend on the price; you are treating both as absolute and exogenous.  What you want in these functions to use standard microeconomic theory on them is to know the way the partial derivatiive of supply changes as the price changes, for the supply curve - leaving time out of it for the moment.  Similarly for demand.  You have some set of parameters that move where those curves are, presumably.  The point where the two intersect for a given value of those parameters is the price to be expected when those parameters are registered.  The time evolution of the price then depends on the way those parameters change with time, driving your curves around and changing that intersection point.  That at least is the standard microeconomics way of using supply and demand curves to explain price formation.  I hope this helps.