필터 지우기
필터 지우기

moving a histogram to correct skewness

조회 수: 2 (최근 30일)
zozo
zozo 2012년 8월 17일
I have the following histogram:
If x is a vector containing my dataset,
k=skewness(x,0); %skewness of data-set with bias correction
I plotted the above histogram as:
[bin,xout]=hist(x,200); %%s1 original%%%histogram of filtered signal
bin=bin./max(bin); %normalise histogram bins to max. bin
bar(xout,bin);
How do I move my histogram to correct the bias in skewness so that my histogram is now modified to skewness=0?
addtional info
I am taking the area (say 4%) of the total histogram area on either side of histogram. But since in this case, the right side is more compared to the left, I would like to update(increase) my % area on right side in accordance to the skewness value so that it is balanced. How can I achience this?
Please help
  댓글 수: 2
the cyclist
the cyclist 2012년 8월 17일
I'm not sure what you mean by "move" your histogram. Do you mean just translate by a constant x0, left or right? That will not affect the skewness.
Maybe you should describe what it really is that you are trying to achieve with your data.
José-Luis
José-Luis 2012년 8월 17일
편집: José-Luis 2012년 8월 17일
If you want your histogram to look different then you need to transform your data. The boxcox transform will (hopefully) make your data normal, i.e. skew = 0. It is available from the financial toolbox. If you don't have it you can try to do a power transform of your data (positive or negative depending on whether your data is skewed to the left or the right) and test again.
Cheers!

댓글을 달려면 로그인하십시오.

답변 (2개)

José-Luis
José-Luis 2012년 8월 17일
You can use a boxcox transform to make your data normal.
http://www.mathworks.se/help/toolbox/finance/boxcox.html
Cheers!
  댓글 수: 6
zozo
zozo 2012년 8월 17일
편집: zozo 2012년 8월 17일
I want to reduce only the small peaks near the baseline and withhold the large peaks. % area on left => area from the beginning of histogram till it reaches 6% of the total area. Similarly on the right. I somehow want to update my %area on left and right (which is equal as of now) according to the skewness value( if right skewed=+1.48, %area on the right would be large compared to the left). Is there some math relation or idea u can suggest?
José-Luis
José-Luis 2012년 8월 17일
I don't understand what you are trying to achieve. If you want to keep your large peaks and get rid of the skew, then you have to transform your data. Maybe smoothing it out would work as well. You could either smooth out the data using, some sort of moving average. Or you could smooth out your histogram, using Matlab's ksdensity. Sorry i can't be of more help but i really don't get what you want to do.
Cheers!

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2012년 8월 17일
I'm not sure why you want to do this, but if you have an image, you can use my histogram shaping routine to make it whatever shape you want: http://www.mathworks.com/matlabcentral/fileexchange/28972-custom-shaped-histogram Of course a 1D vector could also be considered a number.
Basically it will change your input data so that when you take its histogram, it will now be the shape that you specified.

카테고리

Help CenterFile Exchange에서 Signal Operations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by