Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
Jon34
Posted - 12/01/2016 : 09:54:56 AM Dear all,
How to perform cumulative or window-shifting standard deviation on a column of values?
I would like something analogous to the sum() function where one can define Col(B) = sum(Col(A)) to get a cumulative sum. If I use Col(B)=StdDev(Col(A)) I get the same unique value on every row of Col B.
Cheers.
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8.0 Operating System: Windows 7
4 L A T E S T R E P L I E S (Newest First)
Jon34
Posted - 12/02/2016 : 05:09:11 AM Thank you, I've tried the script both from the command line and from a script file. The result is the same as previously, it runs without error but only "--" is displayed in the cells instead of calculated values. I ended up using another software (GNU Octave) to do this and I pasted the results back in Origin. But for future cases, if someone knows of a way that's compatible with Origin 8, it would come handy.
Cheers
Hideo Fujii
Posted - 12/01/2016 : 12:13:38 PM Hi Jon34,
How about this script?
for(ii=1; ii<=wks.maxRows; ii++) {
range rr=col(A)[1:ii];
col(B)[ii]=StdDev(rr);
}
Hope this works.
--Hideo Fujii OriginLab
Jon34
Posted - 12/01/2016 : 11:56:30 AM Thank you for your help. This formula doesn't seem to work for me. It generates no error so I suppose the syntax is correct, but the result column is simply filled with "--" where the calculated values should be. Is there a way to run this formula other than in the Set Column Values tool?
Hideo Fujii
Posted - 12/01/2016 : 11:12:56 AM Hi Jon34,
You can try to apply the following formula in the Set Column Values tool:
StdDev(col(A)[1:i])
I'm not sure if this works in your Origin 8, but at least it works in Origin 2016/2017.