You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for the package. This is my first time suggesting code changes, sorry if I dont obey common practices.
Maybe it would be useful to some users (e.g. to me it was...) to provide also functionality to calculate the correlation matrix (or more properly: Pearson’s product-moment correlation coefficient: https://en.wikipedia.org/wiki/Correlation#Pearson's_product-moment_coefficient ). This is not difficult to do, as with the covariance matrix and the standard errors all the necessary ingredients are already readily available. But I guess it does not hurt if it is there directly.
function correlation(fit::LsqFitResult; rtol::Real=NaN, atol::Real=0)
# computes correlation of fit parameters
covar = vcov(fit)
std_errors = stderror(fit; rtol=rtol, atol=atol)
corr = covar./(std_errors'.*std_errors)
return corr
end
Probably one needs some catching of erros, in case std_errors has zeros.
The text was updated successfully, but these errors were encountered:
Thank you for the package. This is my first time suggesting code changes, sorry if I dont obey common practices.
Maybe it would be useful to some users (e.g. to me it was...) to provide also functionality to calculate the correlation matrix (or more properly: Pearson’s product-moment correlation coefficient: https://en.wikipedia.org/wiki/Correlation#Pearson's_product-moment_coefficient ). This is not difficult to do, as with the covariance matrix and the standard errors all the necessary ingredients are already readily available. But I guess it does not hurt if it is there directly.
Probably one needs some catching of erros, in case std_errors has zeros.
The text was updated successfully, but these errors were encountered: