Any nonlinear fits I have missed?

1 view (last 30 days)
B K
B K on 28 Nov 2011
I'm trying to make a first order spherical harmonic model. I'm using theta and phi in spherical coordinates to solve for the radius, and from these radii I want to be able to draw some 3D surfaces. So using the first 4 spherical harmonics I'm trying to get:
radius = beta(0)*Y(0,0) + beta(1)*Y(-1,0) + beta(3)*Y(0,1) + beta(4)*Y(0,0)
Which I should be able to use my datapoints to solve for coefficients beta. The thing is, being essentially a Fourier series with more dimensions, this thing is not linear at all. So just doing least squares by tossing the thing into matrix form and using left division isn't giving me accurate enough results when I compare my model to the actual data.
This is real radius information I need to solve for, not binary so I can't use glmfit, and my data is doubles so I can't use mnrfit. The data somewhat categorical, that is, some of these surfaces will be ranked at difficulty 1, some are difficulty 10, etc. I could use these difficulties to make a binary model and use logistic regression to get a different model for each difficulty, but then how do I get my radius information back from that?
Basically, are there any more nonlinear curve fitting techniques I've missed? I'm at a loss of what else to try.
  2 Comments
Daniel Shub
Daniel Shub on 28 Nov 2011
You are not yet at the stage where this is a MATLAB question. You need to break your problem down into smaller chunks. It seems like you are currently trying to figure out how to deal with the fact that some of your data is continuous and some is categorical.
B K
B K on 29 Nov 2011
I agree. It was more a cry for help at this point to find something I hadn't tried yet. Turns out nlinfit and some more work on my part did the trick. Thank you for your time.

Sign in to comment.

Accepted Answer

the cyclist
the cyclist on 28 Nov 2011
You could try nlinfit().
  1 Comment
B K
B K on 29 Nov 2011
Playing with that then changing my approach finally led to an answer. Thanks!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!