When we did the spring, we had this theory of Hooke's Law that told us something, and we built a simulation, or built some tools around that theory.
当我们写弹簧程序的时候,我们有胡克定律来告诉我们原理,然后我们建立了一个仿真模型,或者说是在这个理论基础上建立了一些工具。
After all, I'm going to try and build a simulation of the stock market, so I might as well have the notion of a market, and probably the notion of a stock.
不管怎样,我得建立一个股票市场的仿真程序,所以我最好要有股票的概念,和股市的概念。
And then we try and get our simulation to match the past, and hope that that will help it predict the future.
尝试让仿真程序能和这一部分实际数据相符,并且希望它能够帮我们对未来进行预测。
So in fact, it is the case, if you look at data, and by the way, that's the way I ended up setting a lot of these parameters and playing with it, was comparing what my simulation said to historical stock data.
所以实际上,在这个例子中,如果你看到数据,顺便说一下,这就是我设置很多变量,然后编程的方式,也就是把我的仿真程序得到的结果,和历史股票数据进行比较。
And it would take at least an hour do a perfect simulation of the stock market.
而要做一个完美的股市仿真,至少要1个小时。
And when we do a simulation, we're pulling the samples from some distribution.
当我们写一个仿真程序的时候,我们就是从一些分布中进行了采样。
And let's think about how we're going to build the simulation.
让我们想想,我们怎样进行建模。
Now, as we know, and by the way we're not going to write a perfect simulation here, because we're going to try and do it in 40 minutes, or 30 minutes.
现在u,我们知道,我们并不是要写一个,完美的仿真程序,因为我们得,在40或者30分钟内完成它。
I could do this, by the way, by running the code and putting print statements in various places as well, but the hand simulation is valuable, so let me just start it.
做了正确的更新,顺便说一句,我可以通过在很多地方,放置print声明来达到这个目的,但是手工模拟也很有用。
应用推荐