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
 Section fitting?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

flirt

USA
Posts

Posted - 11/06/2007 :  12:24:25 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear developers and users,

How can one refine a trace that has separate trendlines for several sections? As an example, I generated two noisy lines as pasted below, x=1:20 for section 1, x=21:50 for section 2, and smoothed their joint part. This is an example and the trendline may not be linear. Is there a way to do advanced fit of the whole pattern to get the right trendline?
Thanks a lot.
x y
1 0.55002
2 0.69863
3 0.41885
4 0.73308
5 0.74913
6 0.95625
7 1.04946
8 0.95814
9 1.11419
10 1.16559
11 1.48408
12 1.33935
13 1.41326
14 1.83436
15 1.85974
16 1.87008
17 1.77542
18 1.97046
19 1.94242
20 1.90431
21 1.9532
22 1.8583
23 1.68719
24 1.5434
25 1.4449
26 1.47086
27 1.28461
28 1.16005
29 0.90488
30 0.80683
31 -0.07985
32 -0.1817
33 -0.43662
34 0.00805
35 -0.94654
36 -0.97525
37 -0.95891
38 -1.46769
39 -1.19232
40 -1.74449
41 -1.35926142
42 -2.295079242
43 -1.961904251
44 -1.850321692
45 -2.998005976
46 -2.405363235
47 -3.061000348
48 -3.073086682
49 -3.772977692
50 -3.402583242




Deanna

China
Posts

Posted - 11/11/2007 :  10:14:09 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Maybe it is better to fit two sections separately. You can use the range selector to select different sections and do the fitting with different functions.

Deanna
OriginLab Technical Services
Go to Top of Page

greg

USA
1378 Posts

Posted - 11/13/2007 :  3:19:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I'm going to dust off a bit of ancient LabTalk wisdom for this one.
The LR object has an option to search the beginning or the end of a dataset for a linear pattern given a criteria controlled by MAXLRANGE and CHKLINEARR. Consult the Help for more information.

Here is a script that uses the default values to determine the linearity of the beginning and ending of your data:

lr -b %C;
type Slope in the beginning \x3D $(LR.B), Intercept \x3D $(LR.A);
lr -e %C;
type Slope at the end \x3D $(LR.B), Intercept \x3D $(LR.A);

which outputs:

Slope in the beginning = 0.09392, Intercept = 0.33885
Slope at the end = -0.18633, Intercept = 5.82756


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