Calculate Confidence Interval after using mldivide for regression analysis

I'm trying to calculate the confidence interval of the coefficients of my second order fit. Here is my function:
a(v_a,v_r) = b1*v_a.^2 + b2*v_r + b3
It should be noted that I already have values for a, v_a and v_r from my experiments.
In order to calculate the coefficients I used the mldivide operator in Matlab, since I couldn't find another way to fit a function with two independent variables:
b = V\a
Where
V = [v_a.*v_a v_r ones(size(v_a,1))];
This gives me the coefficients which I can then use to fit my model (and determine other values in the function). However, I would like to determine the accuracy of the fit. I would like to determine it's 95% confidence interval and plot it. Matlab has a lot of functions to do this, but there doesn't seem to be a way to do it for the mldivide (\) operator. Does anyone know how I could do this?

 Accepted Answer

Not answering your question directly, but ...
If you have the Statistics and Machine Learning Toolbox, then you could use fitlm or regress to estimate the coefficients.

1 Comment

I eventually ended up using a similar technique. Turns out this is the most efficient way to do this and I was just being stubborn.

Sign in to comment.

More Answers (0)

Categories

Find more on Descriptive Statistics and Insights in Help Center and File Exchange

Tags

Asked:

L
L
on 8 Aug 2017

Commented:

L
L
on 18 Aug 2017

Community Treasure Hunt

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

Start Hunting!