Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Say a user could enter project data into my software. Each project has 2 variables "size" and "work" and they're related but the relationship is not known. Is there a way to programmatically determine the relationship between the variables based on previous data and forecast the amount of work provided if only given the size of the project in the future?

For Example, say the user had manually entered the following projects.

  • Project 1 - Size:1, Work: 4
  • Project 2 - Size:2, Work: 7
  • Project 3 - Size:3, Work: 10
  • Project 4 - Size:4, Work: x

What should I look into to be able to programmatically determine, that Work = Size*3+1 and therefor be able to say that x=13?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

This is called regression analysis. In your example, you're looking for a linear relationship between Work and Size,

Work = a * Size + b + noise

Given a set of (Work, Size) observations, you can solve for a and b using ordinary least squares. This method can handle any number of explanatory variables (in addition to Size).

More sophisticated approaches to this type of problem fall under the umbrella of machine learning.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.