×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Regression Analysis - Constructing a model with constraints (Need help please)

Regression Analysis - Constructing a model with constraints (Need help please)

Regression Analysis - Constructing a model with constraints (Need help please)

(OP)
Hello,

I am trying to construct a general function/method based on two sets of minimum/maximum data point constraints, which can take on new values in different situations. The only known data for this general function is the starting point (y-axis intercept) and the x-range. The rate of change over time must equal zero, so the amount increased/decreased must be compensated within the x-range. Optimally will vary as little as possible, as long as it meets the constraints.

I attached a figure of an example plot. The minimum constraint data points are marked as the 'necessary' function. The maximum constraint data points are marked as 'maximal.' The function marked as 'case 2' is an example of the general function in question that would satisfy the constraints.

I would appreciate any advice or suggestions on how to approach this problem as I've had very little success so far. Thank you in advance.

RE: Regression Analysis - Constructing a model with constraints (Need help please)

(OP)
It shows the attachment on my post for me. Does the figure not show up for you?
Here is the link I used:
http://i61.tinypic.com/so0qx1.jpg

RE: Regression Analysis - Constructing a model with constraints (Need help please)

Oh, my company's firewall blocks tinpic, sorry about that.

This seems like statistics problem, for which there is a better place to post this question: forum962: Statistics in engineering If you agree, you should red flag this posting and re-post in forum962: Statistics in engineering

TTFN
FAQ731-376: Eng-Tips.com Forum Policies

Need help writing a question or understanding a reply? forum1529: Translation Assistance for Engineers

RE: Regression Analysis - Constructing a model with constraints (Need help please)

Based on your constraints, wouldn't the optimal solution be (using the C language ternary "test?true:false" operator):

div=0
for i in x range
f(x) = min(x) > (f(0)-div) ? min(x) : max(x) < (f(0)-div) ? max(x) : f(0)-div
div += f(x)-f(0)
end for

?

I've assumed by "rate of change over time must equal zero" you mean the integral of the f(x) - f(0) must tend towards zero. If you really did mean the rate of change, then adjust accordingly.

RE: Regression Analysis - Constructing a model with constraints (Need help please)

(OP)
That's correct liteyear, basically however much the function increases or decreases it must be compensated for within the x range. I must admit I have very little knowledge in C-language. I can see by the code it seems to take into account min and max points. So if these min and max functions each have a set of data points, this code would generate a function between them satisfying the constraints? Please excuse my inexperience with programming. I would really like to learn more about C-language and how I could use it to solve his problem.

RE: Regression Analysis - Constructing a model with constraints (Need help please)

Yes, the (untested) function generates a a set of points between the two constraint functions.

No need to worry about learning C at this stage. The ternary operator is simply this:

test ? a : b;

is equivalent to this psuedocode:

if (test)
a
else
b
end if

Just note that the b statement in my code is actually another test.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources