Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2014-02-13 04:07:15

engrymbiff
Member
Registered: 2010-06-14
Posts: 30

Fit y = a + (b1*x1+b2*x2+...+bn*xn) + (c1*x1^2+c2*x2^2+...+cn*xn^2)

Hi

I have a big set of data and I belive my data can be explained/estimated by the following formula
y = a + (b1*x1+b2*x2+...+bn*xn) + (c1*x1^2+c2*x2^2+...+cn*xn^2)

I want to estimate all coeficcients (a, b1, b2, ..., bn, c1, c2, ..., cn), which in my particular case is 47 coefficients (because n=23 => 1+23*2=47). How do I proceed for doing this in Matlab or Excel?

Please help

BR
engrymbiff

Ps. I have 744 samples of y, x1, x2, ..., xn. Actually, I'm trying to explain how my 23 parameters affects y out of a data set containing 1 month of hourly registrations of y, x1, x2, ..., xn, which makes 31x24 = 744 samples).

Last edited by engrymbiff (2014-02-13 04:07:40)

Offline

#2 2014-02-13 04:44:46

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Fit y = a + (b1*x1+b2*x2+...+bn*xn) + (c1*x1^2+c2*x2^2+...+cn*xn^2)

Hi;

I could do it for you.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#3 2014-02-13 04:59:45

engrymbiff
Member
Registered: 2010-06-14
Posts: 30

Re: Fit y = a + (b1*x1+b2*x2+...+bn*xn) + (c1*x1^2+c2*x2^2+...+cn*xn^2)

But how? Please don't be ironic and it is not a homework!!

Do you know any Matlab functions for multivariate analysis? Actually, I do not know for certain that every variable from x1 to xn is equally important in explaining y

Maybe by polyfitn and polyvaln in Matlab smile https://woodshole.er.usgs.gov/staffpages/cdenham/public_html/snackbar/polyfitn.m

Offline

#4 2014-02-13 05:17:19

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Fit y = a + (b1*x1+b2*x2+...+bn*xn) + (c1*x1^2+c2*x2^2+...+cn*xn^2)

If you post the data I can fit it.

Do you know any Matlab functions for multivariate analysis? Actually, I do not know for certain that every variable from x1 to xn is equally important in explaining y

I do not use matlab so offhand I do not. Your best bet is the help or a forum devoted to matlab.

It is highly unlikely that each x^n will contribute to y in a meaningful way. Many will just be noise. After x^15 that usually is true.

The standard polynomials do not form an orthogonal set and therefore produce much roundoff error.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#5 2014-02-13 05:53:21

engrymbiff
Member
Registered: 2010-06-14
Posts: 30

Re: Fit y = a + (b1*x1+b2*x2+...+bn*xn) + (c1*x1^2+c2*x2^2+...+cn*xn^2)

bobbym wrote:

If you post the data I can fit it.

Do you know any Matlab functions for multivariate analysis? Actually, I do not know for certain that every variable from x1 to xn is equally important in explaining y

I do not use matlab so offhand I do not. Your best bet is the help or a forum devoted to matlab.

It is highly unlikely that each x^n will contribute to y in a meaningful way. Many will just be noise. After x^15 that usually is true.

The standard polynomials do not form an orthogonal set and therefore produce much roundoff error.

OK, I'll be back at the office tomorrow and will send you the data then.

Ps. It's xn^2, not x^n (the polynomial is of order two)

Offline

#6 2014-02-13 05:57:26

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Fit y = a + (b1*x1+b2*x2+...+bn*xn) + (c1*x1^2+c2*x2^2+...+cn*xn^2)

Yes, try those help pages. If you can not then bring the data I will try.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

Board footer

Powered by FluxBB