This question is closed. Reopen it to edit or answer.
Hello, I am working on monte carlo markov chain to generate synthetic data for energy consumption values. Any heads up on this, will be really helpful.
1 view (last 30 days)
Show older comments
Ragini Gupta on 4 Nov 2017
Closed: John D'Errico on 4 Nov 2017
I have empirical data for 17520 records that I am reading from an excel file, discretizing those values into 8 bins and creating Transition Probability matrix after binning. However, I don't understand how to simulate this matrix to generate new consumption values. Here is the code I have so far:
filename = 'newTestingExcel.xlsx'; Furnace=xlsread(filename,'B:B'); %H1D1
edges = linspace(min(Furnace),max(Furnace),8); [counts,bins] = histc(Furnace, edges); [counts,bins] = histc(Furnace, edges);
%# transition matrix
m = max(bins); n = numel(bins); y = zeros(m,1); p = zeros(m,m); for k=1:n-1 y(bins(k)) = y(bins(k)) + 1; p(bins(k),bins(k+1)) = p(bins(k),bins(k+1)) + 1; end p = bsxfun(@rdivide,p,y); p(isnan(p)) = 0;
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!