2
$\begingroup$

I'm trying to predict output per worker for given inputs of capital (physical capital), labor (human capital) & productivity. I have a data set of several countries

[[ "USA", {"Capital":3.21,"Labor":1.31,"Productivity":3.17}, 2.96 ]
 [ "Norway", {"Capital":3.46,"Labor":1.27,"Productivity":2.92}, 2.72 ]
 [ "UK", {"Capital":2.21,"Labor":1.27,"Productivity":2.76}, 2.25 ]
 [ "Canada", {"Capital":2.76,"Labor":1.32,"Productivity":2.5}, 2.22 ]
 [ "Japan", {"Capital":3.53,"Labor":1.3,"Productivity":2.12}, 2.04 ]
 [ "South Korea", {"Capital":2.34,"Labor":1.22,"Productivity":2}, 1.6 ]
 [ "Mexico", {"Capital":0.87,"Labor":1.04,"Productivity":1.65}, 0.86 ]
 [ "Peru", {"Capital":0.38,"Labor":1.07,"Productivity":1.01}, 0.41 ]
 [ "India", {"Capital":0.32,"Labor":0.97,"Productivity":1.11}, 0.38 ]
 [ "Cameroon", {"Capital":0.12,"Labor":0.76,"Productivity":1.39}, 0.3 ]
 [ "Zambia", {"Capital":0.1,"Labor":0.85,"Productivity":0.44}, 0.1 ]
 [ "United-States", {"Capital":3.21,"Labor":1.31,"Productivity":3.17}, 2.96 ]
 [ "Canada", {"Capital":3.21,"Labor":1.19,"Productivity":3.28}, 2.78 ]
 [ "Italy", {"Capital":3.41,"Labor":0.85,"Productivity":3.83}, 2.47 ]
 [ "West-Germany", {"Capital":3.59,"Labor":1.05,"Productivity":2.89}, 2.42 ]
 [ "France", {"Capital":3.5,"Labor":0.87,"Productivity":3.57}, 2.42 ]
 [ "United-Kingdom", {"Capital":2.86,"Labor":1.06,"Productivity":3.2}, 2.15 ]
 [ "Hong-Kong", {"Capital":2.38,"Labor":0.96,"Productivity":3.53}, 1.8 ]
 [ "Singapore", {"Capital":3.31,"Labor":0.71,"Productivity":3.42}, 1.79 ]
 [ "Japan", {"Capital":3.59,"Labor":1.04,"Productivity":2.09}, 1.74 ]
 [ "Mexico", {"Capital":2.78,"Labor":0.71,"Productivity":2.94}, 1.28 ]
 [ "Argentina", {"Capital":3.06,"Labor":0.89,"Productivity":2.05}, 1.24 ]
 [ "USSR.", {"Capital":3.95,"Labor":0.95,"Productivity":1.48}, 1.23 ]
 [ "India", {"Capital":2.27,"Labor":0.6,"Productivity":0.85}, 0.25 ]
 [ "China", {"Capital":2.86,"Labor":0.83,"Productivity":0.34}, 0.18 ]
 [ "Kenya", {"Capital":2.4,"Labor":0.6,"Productivity":0.52}, 0.17 ]
 [ "Zaire", {"Capital":1.6,"Labor":0.53,"Productivity":0.51}, 0.1 ]]

Each row represent country name, inputs (capital, labor, productivity) & output. Now I want to be able from given inputs say

{"Capital":1.1,"Labor":0.4,"Productivity":0.3}   

to predict how much output will the country produce.

So far I've looked at two neural network implementations http://github.com/harthur/brain which gives me bad predictions (or I'm using it/training it badly), and http://cs.stanford.edu/people/karpathy/convnetjs which I don't know how to use for continuous data.

I don't know are the neural networks right approach,or maybe different method/ library are more fitting for my problem, maybe surface fitting or whatever. I just want to create some bastard Solow model that roughly fits the data points I have.

$\endgroup$
  • 1
    $\begingroup$ Get coefficients using R and lm function: lm(out~. , data=mydata) $\endgroup$ – rnso Nov 7 '14 at 17:18
  • $\begingroup$ @whuber I don't have idea how to narrow it down. What I need is any method to learn from historical data and predict from new inputs.I've looked at two neural network implementations github.com/harthur/brain bad predictions (or me using it wrong), and cs.stanford.edu/people/karpathy/convnetjs don't know how to use it for continuous data. So I'm not sure are neural networks even right approach. $\endgroup$ – slobodan.blazeski Nov 7 '14 at 17:35
  • $\begingroup$ Predicting one value based on observations of other values comprises a great deal of statistics. There wouldn't be enough space even to list all their names in an answer! To focus your question you need at least to explain what these data are and provide a context for understanding why you are making predictions and evaluating the quality of those predictions. $\endgroup$ – whuber Nov 7 '14 at 17:46
  • $\begingroup$ Is there a reason you aren't simply using standard regression methods? $\endgroup$ – gung - Reinstate Monica Nov 7 '14 at 18:51
  • 1
    $\begingroup$ Because I forgot all the statistics in 14 years of not using it. The only tools I have now are magic (libraries) or brute force and ignorance. Any more specific pointers/links for my problem 3 independent parameters -> 1 dependent will be appreacited $\endgroup$ – slobodan.blazeski Nov 7 '14 at 19:16
2
$\begingroup$

Here's the code in R for linear regression, assuming you have the object as a dataframe X, Capital Labor Productivity Output 3.21 1.31 3.17 2.96 3.46 1.27 2.92 2.72 2.21 1.27 2.76 2.25 2.76 1.32 2.50 2.22 3.53 1.30 2.12 2.04 2.34 1.22 2.00 1.60

Then you can just use the simple linear regression

fit = lm(Output~., data = X)

To predict on newdata which doesn't have the Output, you just use predict

predict(fit, newdata)
| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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