How to estimate the constant term in a multiple linear regression?
Afficher commentaires plus anciens
Hi,
I would like to estimate the constant term "a" in the multiple linear regression X=a+bY+BZ
This is my code :
y = [Y Z]
[h(1).mdl]=mvregress(X,y,'algorithm','ecm')
Réponses (3)
the cyclist
le 8 Fév 2015
Add a constant term to your predictor variable:
y = [ones(size(Y)) Y Z]
1 commentaire
Mr LE
le 8 Fév 2015
the cyclist
le 9 Fév 2015
0 votes
Can you post a very small example where you are seeing implausible results? The syntax of mvregress can be a bit tricky (and I actually think my simple suggestion may actually a bit misleading.)
I have posted a very detailed example of using mvregress in this question that you might want to take a look at.
Tom Lane
le 9 Fév 2015
0 votes
You write "X=a+bY+BZ" suggesting that X may be a response and Y and Z predictors. But the first input to mvregress is the predictor matrix, and the second is the response matrix. Perhaps you need to swap them, or maybe you just need to explain what you're trying to fit.
Catégories
En savoir plus sur Linear Predictive Coding dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!