function [P,V] = initializeProbability(P0,sigma)
%% Create a distribution of prices centered around P0
% Copyright 2015 The MathWorks, Inc.
if nargin == 0
P0 = 28.5850;
sigma = 0.13;
end
% vector of prices
%V = ( (P0-6*sigma):0.01:(P0+6*sigma) )';
V = (27.9:0.01:29)';
% normal distribution centered around P0
nd = (1/(sigma*sqrt(2*pi)))*exp(-(V-P0).^2/(2*sigma^2));
nd = nd/sum(nd);
P = nd;
本文介绍了一个用于创建以特定价格为中心的价格分布的MATLAB函数。该函数接受初始价格P0和标准差sigma作为输入,并生成一个正常分布的价格向量及其对应的概率密度。
1183

被折叠的 条评论
为什么被折叠?



