The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Cumulative standard deviation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Jon34

France
6 Posts

Posted - 12/01/2016 :  09:54:56 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Hideo Fujii

USA
1582 Posts

Posted - 12/01/2016 :  11:12:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.

Hope this helps.

--Hideo Fujii
OriginLab
Go to Top of Page

Jon34

France
6 Posts

Posted - 12/01/2016 :  11:56:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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?
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 12/01/2016 :  12:13:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Jon34

France
6 Posts

Posted - 12/02/2016 :  05:09:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000