What to do with variances in a covariance matrix?

AI Thread Summary
The discussion focuses on understanding how to interpret and utilize a covariance matrix obtained from parameter fitting in a model. The user is fitting four parameters using the Levenberg-Marquardt method and seeks to derive the errors of these parameters from the covariance matrix. It is clarified that the inverse of the Hessian matrix approximates the variance/covariance matrix of the parameters. To obtain the standard errors, one should either square root the diagonal elements of the covariance matrix or invert the Hessian if that is what was provided. This guidance helps the user effectively extract the necessary error information from their covariance matrix.
snipertje
Messages
11
Reaction score
0
How to get a covariance matrix is well defined, but I don't really know how to use it once obtained.

I'm trying to find the best parameters for a data set with a given function. I'm having four parameters a1,a2,a3,a4 and from these parameters I have the covariance matrix. I'm supposed to get the 'errors' of the parameters from the matrix. I know that the covariance between the same element gives the variance so the elements on the diagonal of the matrix (when i=j) give the variances. I can't really figure out what the variance means, is it an absolute error in the parameters or maybe a relative error? Or maybe it's something quite different, can anyone explain me what the variance means?
 
Physics news on Phys.org
snipertje said:
I'm trying to find the best parameters for a data set with a given function. I'm having four parameters a1,a2,a3,a4 and from these parameters I have the covariance matrix.

Let's clarify what you are doing. You have some data. What is the format of the data?

You say you have 4 parameters. Does this mean that you have determined the numerical values of thse parameters? If so, did you do this with a curve fitting method? What method?

You say that you have the covariance matrix. Is the covariance matrix for the parameters? Or is it for the components of the data? Do you know how this matrix was computed or is it merely an output of some curve fitting software?
 
Stephen Tashi said:
Let's clarify what you are doing. You have some data. What is the format of the data?

You say you have 4 parameters. Does this mean that you have determined the numerical values of thse parameters? If so, did you do this with a curve fitting method? What method?

You say that you have the covariance matrix. Is the covariance matrix for the parameters? Or is it for the components of the data? Do you know how this matrix was computed or is it merely an output of some curve fitting software?
The data I have is the time differences of a measured pulse from a pulsar due to the radial velocity caused by a planet, the times at which this is measured and the errors of the measurement.

From theory follows this formula ΔT=a1+a2*sin(a3*t+a4) (note: ΔT and t are independent). I use the Levenberg-Marquardt method to find the best fitting parameter values. This numerical method uses a covariance matrix, which is returned once you stop the 'routine'. So what I have now is the best parameter values, but I somehow need to get the 'errors' in these values from the covariance matrix of these parameters.

I hope it's a bit more clear now.
 
snipertje said:
The data I have is the time differences of a measured pulse from a pulsar due to the radial velocity caused by a planet, the times at which this is measured and the errors of the measurement.

From theory follows this formula ΔT=a1+a2*sin(a3*t+a4) (note: ΔT and t are independent). I use the Levenberg-Marquardt method to find the best fitting parameter values. This numerical method uses a covariance matrix, which is returned once you stop the 'routine'. So what I have now is the best parameter values, but I somehow need to get the 'errors' in these values from the covariance matrix of these parameters.

I hope it's a bit more clear now.

Hi snipertje!

Yeah, much more clear now! When fitting several parameters into a model, typically pseudo-Newtonian methods like the one you mention are used which means Jacobian and Hessian matrices are going to be involved in the process.

Now, fortunately, it turns out that the inverse of the Hessian matrix approximates the variance/covariance matrix of the parameters involved in the model.

I'm explaining all this because you must make sure if the matrix you have is the Hessian returned by the algorithm or the approximation given by the Hessian (the actual variance/covariance matrix you won't have it).

If it is the approximation of the variance/covariance matrix simply square root the diagonal (that is the variance of each parameter) and that will be the standard error you're looking for.

If it is the Hessian, then invert the matrix and treat it like if it was the variance/covariance matrix to calculate the standard error.

I hope this helps! :smile:
 
Last edited:
viraltux said:
Hi snipertje!

Yeah, much more clear now! When fitting several parameters into a model, typically pseudo-Newtonian methods like the one you mention are used which means Jacobian and/or Hessian matrices are going to be involved in the process.

Now, fortunately, it turns out that the inverse of the Hessian matrix approximates the variance/covariance matrix of the parameters involved in the model.

I'm explaining all this because you must make sure if the matrix you have is the Hessian returned by the algorithm or the approximation given by the Hessian (the actual variance/covariance matrix you won't have it).

If it is the approximation of the variance/covariance matrix simply square root the diagonal (that is the variance of each parameter) and that will be the standard error you're looking for.

If it is the Hessian, then invert the matrix and treat it like if it was the variance/covariance matrix to calculate the standard error.

I hope this help! :smile:

This is exactly what I wanted to know, thanks a lot. I'm pretty sure that it indeed is the Hessian which the method uses, but the subroutine I use inverts it when you tell it to stop, so I get precisely what you say here. Cheers
 
I was reading documentation about the soundness and completeness of logic formal systems. Consider the following $$\vdash_S \phi$$ where ##S## is the proof-system making part the formal system and ##\phi## is a wff (well formed formula) of the formal language. Note the blank on left of the turnstile symbol ##\vdash_S##, as far as I can tell it actually represents the empty set. So what does it mean ? I guess it actually means ##\phi## is a theorem of the formal system, i.e. there is a...
Back
Top