Prev: Issues with Matlab Figure
Next: Write to xlm file
From: Bjorn Gustavsson on 10 Jun 2010 11:53 "Neha " <smile_neha16(a)yahoo.co.in> wrote in message <huqsls$snt$1(a)fred.mathworks.com>... > "Oleg Komarov" <oleg.komarovRemove.this(a)hotmail.it> wrote in message <huqr38$bdk$1(a)fred.mathworks.com>... > > > > If you need to consolidate data: > > > > > > > > In = {'24-05-09' 'ABC' nan 298 '5:30' > > > > '24-05-09' 'PQR' 34 251 '8:30' > > > > '24-05-09' 'JHK' 5 28 '13:20' > > > > '24-05-09' 'NJE' 26 nan '15:30' > > > > '25-05-09' 'THJ' 54 41 '2:30' > > > > '25-05-09' 'LOU' nan nan '8:30' > > > > '25-05-09' 'PIU' nan nan '11:20' > > > > '25-05-09' 'LIS' nan nan '15:30'}; > > > > > > > > Pivot(In(:,1:3),@nansum) % search on he FEX > > > > ans = > > > > [NaN] '24-05-09' '25-05-09' > > > > 'ABC' [ NaN] [ NaN] > > > > 'JHK' [ 5] [ NaN] > > > > 'LIS' [ NaN] [ NaN] > > > > 'LOU' [ NaN] [ NaN] > > > > 'NJE' [ 26] [ NaN] > > > > 'PIU' [ NaN] [ NaN] > > > > 'PQR' [ 34] [ NaN] > > > > 'THJ' [ NaN] [ 54] > > > > > > > > Oleg > > > > > > Hi Oleg, > > > > > > Thanks for your reply. > > > > > > I have one question, with this I will be able to interpolate or calculate the NaN value as well? > > > > > > Actually I need to fill these Nan value. > > > > > > Thanks > > > Neha > > > > You say: "But the problem is that the counts for each day is not available and mostly data for classone is missing. But this count is necessary since company want to forecast the demand for the future. " > > > > why do you want to calculate teh NaNs? This will affect the distribution of the product and the forecast itself will be biased by the assumptions made to estimate those nans. > > > > Oleg > > I agree with your point. But the problem is that for one class 50% of data is missing and for other 5% of data is missing. Company is not interested in forecasting on the basis of current available counts only. They want to calculate NaNs. Till now they used to take the average in place of the missing value but which reduces the accuracy of forecast. > > So, in order to improve this we have decided to calculate these NaNs using some appropriate startegy. In Matlab we have option of some models with which the NaNs calculated might be better and reduces the percentage of devation. > > Neha > Neha, I think you've got a rough-deal-task. I understand that we all need to pay the rent and get fed, so while you're looking for an employer that gives you a job that is possible to solve you could maybe be helped by either of: http://www.mathworks.com/matlabcentral/fileexchange/15538-invdistgrid http://www.mathworks.com/matlabcentral/fileexchange/15590-fillnans http://www.mathworks.com/matlabcentral/fileexchange/4551-inpaintnans HTH, Bjeorn
From: Neha on 10 Jun 2010 12:15
"Bjorn Gustavsson" <bjonr(a)irf.se> wrote in message <hur1p0$faj$1(a)fred.mathworks.com>... > "Neha " <smile_neha16(a)yahoo.co.in> wrote in message <huqsls$snt$1(a)fred.mathworks.com>... > > "Oleg Komarov" <oleg.komarovRemove.this(a)hotmail.it> wrote in message <huqr38$bdk$1(a)fred.mathworks.com>... > > > > > If you need to consolidate data: > > > > > > > > > > In = {'24-05-09' 'ABC' nan 298 '5:30' > > > > > '24-05-09' 'PQR' 34 251 '8:30' > > > > > '24-05-09' 'JHK' 5 28 '13:20' > > > > > '24-05-09' 'NJE' 26 nan '15:30' > > > > > '25-05-09' 'THJ' 54 41 '2:30' > > > > > '25-05-09' 'LOU' nan nan '8:30' > > > > > '25-05-09' 'PIU' nan nan '11:20' > > > > > '25-05-09' 'LIS' nan nan '15:30'}; > > > > > > > > > > Pivot(In(:,1:3),@nansum) % search on he FEX > > > > > ans = > > > > > [NaN] '24-05-09' '25-05-09' > > > > > 'ABC' [ NaN] [ NaN] > > > > > 'JHK' [ 5] [ NaN] > > > > > 'LIS' [ NaN] [ NaN] > > > > > 'LOU' [ NaN] [ NaN] > > > > > 'NJE' [ 26] [ NaN] > > > > > 'PIU' [ NaN] [ NaN] > > > > > 'PQR' [ 34] [ NaN] > > > > > 'THJ' [ NaN] [ 54] > > > > > > > > > > Oleg > > > > > > > > Hi Oleg, > > > > > > > > Thanks for your reply. > > > > > > > > I have one question, with this I will be able to interpolate or calculate the NaN value as well? > > > > > > > > Actually I need to fill these Nan value. > > > > > > > > Thanks > > > > Neha > > > > > > You say: "But the problem is that the counts for each day is not available and mostly data for classone is missing. But this count is necessary since company want to forecast the demand for the future. " > > > > > > why do you want to calculate teh NaNs? This will affect the distribution of the product and the forecast itself will be biased by the assumptions made to estimate those nans. > > > > > > Oleg > > > > I agree with your point. But the problem is that for one class 50% of data is missing and for other 5% of data is missing. Company is not interested in forecasting on the basis of current available counts only. They want to calculate NaNs. Till now they used to take the average in place of the missing value but which reduces the accuracy of forecast. > > > > So, in order to improve this we have decided to calculate these NaNs using some appropriate startegy. In Matlab we have option of some models with which the NaNs calculated might be better and reduces the percentage of devation. > > > > Neha > > > Neha, I think you've got a rough-deal-task. I understand that we all need to pay the rent and get fed, so while you're looking for an employer that gives you a job that is possible to solve you could maybe be helped by either of: > http://www.mathworks.com/matlabcentral/fileexchange/15538-invdistgrid > http://www.mathworks.com/matlabcentral/fileexchange/15590-fillnans > http://www.mathworks.com/matlabcentral/fileexchange/4551-inpaintnans > > HTH, > Bjeorn Thanks Bjeorn. Yup somethings are done inspite of making no logic. Good but they won't last for long. Thanks for the links. I will look at them in detail. Neha |