Curve fitting: seversl curves to one

Hi,
I have quite a special demand: I have a curve for number of housholds for the years of 1960-2020 and want to create a relationship of several economic and demographic curves/datapoints. I want to have the combination of those datasets (demographic ones) to fit to the number of households. Is there a sort of fitting tool integrated, combining the different datasets?

4 Comments

What does your curve represent? What do the other economic and demo data represent? Let's say you have, for each household, the household income, the race, the city, and the ages of the oldest and youngest occupant. Now let's say you have that data for 1000 households in dataset #1, 600 households in dataset #2, and 3000 households in dataset #3. Now what? How was this curve you mentioned created from that data? It would be best if you attached your actual data so we could talk about the exact features/attributes of the households.
And I have no idea what "to fit the best the number of households" means. I don't even understand the grammar. What is being fit to what?
Redstein
Redstein on 12 Apr 2020
Edited: Redstein on 12 Apr 2020
Thank you for the fast feedback and sorry for the grammar misunderstanding!
Here some clarifications:
As the data is confidential, I only can share dummy numbers:
I have the following data to what I want to fit the other data for the years 1960-2020:
  • number of households:
The data I want to fit is:
  • Population:
  • GDP:
  • Taxes:
  • Mean income:
And I want to get something like
in order to find the values for
Image Analyst
Image Analyst on 12 Apr 2020
Edited: Image Analyst on 12 Apr 2020
Make up some dummy data sets in tables, or separate variables, and upload them so we have something to work with. Make it easy for us to help you, not hard.
Also, there are probably lots of models that could be fit using those 4 vectors. Do you want the product like you suggested, or perhaps a weighted sum, or Principal Components Analysis, or LDA? Or has anyone ever come up with some sort of formula that we can use?
I have made a dummy set for the years of 1960-1980
I am seeking for for a product as I've suggested. Unfortunately, I was not able to find something similar to the issue I have.

Sign in to comment.

Answers (2)

Rajani Mishra
Rajani Mishra on 16 Apr 2020
What I understand from your question and following comments is that you have dataset of Household, Population, GDP, Taxes, Mean Income and you want to find the values of a,b,c and d for the equation you have provided.
In that case you can make a combined data set having each data set as a column and use function nlinfit, you can read more about the function here.
refer to the similar question I came across:
Tom Lane
Tom Lane on 23 Apr 2020
If you want
nhh = a * (n1^b) * (n2^c) * (n3^d)
consider taking logs
log(nhh) = log(a) + b*log(n1) + c*log(n2) + d*log(n3)
You can use any least squares feature in MATLAB, Statistics and Machine Learning Toolbox, or Optimization Toolbox. Pass in the log values as data. You'd get back estimates of log(a), b, c, and d.

Categories

Tags

Asked:

on 12 Apr 2020

Answered:

on 23 Apr 2020

Community Treasure Hunt

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

Start Hunting!