From: Obaid Mushtaq on 2 Aug 2010 14:54 Hi all, I have this simple question. If the answer is yes, please tell me if it is possible to preserve the variance of the interpolated data. You can take me as a noobie in Statistics. Sample code follows: xMin=0; xMax=1; yMin=0; yMax=1; d=0.01; x=xMin:d:xMax; y=yMin:d:yMax; [X,Y]=meshgrid(x,y); [r,c]=size(X); Z = 8*randn(r,c)+10; mean(reshape(Z,1,prod(size(Z)))) var(reshape(Z,1,prod(size(Z)))) res=0.001; xi=0:res:1; yi=0:res:1; [Xi,Yi] = meshgrid(xi,yi); Zi = interp2(X,Y,Z,Xi,Yi); [ri,ci]=size(Xi); mean(reshape(Zi,1,prod(size(Zi)))) var(reshape(Zi,1,prod(size(Zi)))) I would appreciate any comments. BR, Obaid
From: Tom Lane on 2 Aug 2010 17:53 > I have this simple question. If the answer is yes, please tell me if it is > possible to preserve the variance of the interpolated data. You can take > me as a noobie in Statistics. >> x = 1:2; >> y = 1:2; >> var(y) ans = 0.5000 >> xi = [1 1.5 2]; >> yi = interp1(x,y,xi) yi = 1.0000 1.5000 2.0000 >> var(yi) ans = 0.2500 This one-dimensional example shows that it's certainly possible that the interpolation results will have a lower variance than the original data. I'm not sure what you want to do about that. You could add noise to the output from interp1/2, but then the results will no longer interpolate the original data. Maybe you can explain what you're trying to accomplish. -- Tom
From: John D'Errico on 2 Aug 2010 18:16 "Obaid Mushtaq" <obaidmushtaq(a)yahoo.com> wrote in message <i37490$ic7$1(a)fred.mathworks.com>... > Hi all, > > I have this simple question. If the answer is yes, please tell me if it is possible to preserve the variance of the interpolated data. You can take me as a noobie in Statistics. > Yes, there is NO presumption at all that an interpolation will preserve the variance of an array. Therefore it will do so. I have no idea why you wish a variance preserving interpolant, but I would suggest that no tool does what you want. People always want things they can't have though. John
From: Obaid Mushtaq on 3 Aug 2010 09:10 Hi, Thanks for your response. Actually I get random shadowing values at a pre-defined 2D grid and these values have a particular variance as they are normally distributed. After that I want to interpolate the values over a finer grid but the variance of the interpolated version changes as I showed you in case of ML functions. See [1] p.p 44. They say that the linear interpolation formula guarantees the same variance. I was confused why ML's function is not preserving. BR, Obaid [1] http://www.ieee802.org/16/tgm/docs/80216m-08_004r5.zip "Tom Lane" <tlaneATmathworksDOTcom(a)nospam.com> wrote in message <i37epl$skj$1(a)fred.mathworks.com>... > > I have this simple question. If the answer is yes, please tell me if it is > > possible to preserve the variance of the interpolated data. You can take > > me as a noobie in Statistics. > > >> x = 1:2; > >> y = 1:2; > >> var(y) > ans = > 0.5000 > >> xi = [1 1.5 2]; > >> yi = interp1(x,y,xi) > yi = > 1.0000 1.5000 2.0000 > >> var(yi) > ans = > 0.2500 > > This one-dimensional example shows that it's certainly possible that the > interpolation results will have a lower variance than the original data. I'm > not sure what you want to do about that. You could add noise to the output > from interp1/2, but then the results will no longer interpolate the original > data. Maybe you can explain what you're trying to accomplish. > > -- Tom >
From: us on 3 Aug 2010 09:27 "Obaid Mushtaq" <obaidmushtaq(a)yahoo.com> wrote in message <i394fv$8kd$1(a)fred.mathworks.com>... > Hi, > > Thanks for your response. Actually I get random shadowing values at a pre-defined 2D grid and these values have a particular variance as they are normally distributed. > > After that I want to interpolate the values over a finer grid but the variance of the interpolated version changes as I showed you in case of ML functions. > > See [1] p.p 44. They say that the linear interpolation formula guarantees the same variance. I was confused why ML's function is not preserving. > > BR, > > Obaid > > [1] http://www.ieee802.org/16/tgm/docs/80216m-08_004r5.zip well... carefully(!) read the pages 44 and 45, again - and carefully(!) listen to what they really say... us
|
Next
|
Last
Pages: 1 2 3 Prev: Combining two .dat files Next: Moment of Inertia of a machine modelled with SimMechanics |