thztools.FitResult#
- class thztools.FitResult(p_opt, _p_err, p_cov, mu_opt, _mu_err, mu_cov, psi_opt, psi_cov, frfun_opt, resnorm, dof, delta, delta_norm, delta_norm_cov, epsilon, epsilon_norm, epsilon_norm_cov, delta_norm_epsilon_norm_cov, r_tls, success, diagnostic)[source]#
Dataclass for the output of
fit.- Parameters:
- p_optndarray
Optimal fit parameters.
- p_errndarray
Uncertainty estimate for
p_opt,p_err = np.sqrt(np.diag(p_cov)).Deprecated since version 0.6.0: This option is deprecated and will be removed in version 0.8.0.
- p_covndarray
Covariance matrix estimate for
p_opt, determined from the curvature of the cost function at(p_opt, mu_opt). To compute one standard deviation errors on the parameters, usep_err = np.sqrt(np.diag(p_cov)).- mu_optndarray
Optimal estimate of the input waveform.
- mu_errndarray
Estimated uncertainty in
mu_opt, determined from the curvature of the cost function at(p_opt, mu_opt).Deprecated since version 0.6.0: This option is deprecated and will be removed in version 0.8.0.
- mu_covndarray
Covariance matrix estimate for
mu_opt, determined from the curvature of the cost function at(p_opt, mu_opt). To compute one standard deviation errors of the input waveform, usemu_err = np.sqrt(np.diag(mu_cov)).- psi_optndarray
Optimal estimate of the output waveform.
- psi_covndarray
Covariance matrix estimate for
psi_opt. To compute one standard deviation errors of the output waveform, usepsi_err = np.sqrt(np.diag(psi_cov)).- frfun_optcomplex ndarray
Estimated values of the frequency response function at non-negative frequencies.
- resnormfloat
Euclidean norm (i.e., sum of the squares) of the normalized total least-squares residuals.
- dofint
Number of statistical degrees of freedom,
dof = n - n_p - n_a - n_b, wherenis the number of samples in each waveform,n_pis the number of fit parameters in the frequency response function, andn_a + n_bis the number of real parameters necessary to specify the frequency response function at the excluded frequencies.- deltandarray
Residuals of the input waveform
x, defined asx - mu_opt.- delta_normndarray
Normalized residuals of the input waveform
x, defined asdelta/noise_model.noise_amp(xdata).- delta_norm_covndarray
Covariance matrix estimate for
delta_norm.- epsilonndarray
Residuals of the output waveform
y, defined asy - psi_opt, wherepsi_opt = thztools.apply_frf(frfun, mu, dt=dt, args=p_opt),frfunis the parameterized frequency response function, andp_optis the array of optimized parameters.- epsilon_normndarray
Normalized residuals of the output waveform
y, defined asepsilon/noise_model.noise_amp(ydata).- epsilon_norm_covndarray
Covariance matrix estimate for
epsilon_norm.- delta_norm_epsilon_norm_covndarray
Cross-covariance matrix of the normalized residuals
delta_normandepsilon_norm.- r_tlsndarray
Normalized total least-squares residuals.
- successbool
True if one of the convergence criteria is satisfied.
- diagnosticscipy.optimize.OptimizeResult
Instance of
scipy.optimize.OptimizeResultreturned byscipy.optimize.least_squares.
Attributes
p_opt
(ndarray) Optimal fit parameters.
p_err
(ndarray) Uncertainty estimate for
p_opt,p_err = np.sqrt(np.diag(p_cov)).p_cov
(ndarray) Covariance matrix estimate for
p_opt, determined from the curvature of the cost function at(p_opt, mu_opt). To compute the standard errors for the parameters, usep_err = np.sqrt(np.diag(p_cov)).mu_opt
(ndarray) Optimal estimate of the input waveform.
mu_err
(ndarray) Estimated uncertainty in
mu_opt, determined from the curvature of the cost function at(p_opt, mu_opt).mu_cov
(ndarray) Covariance matrix estimate for
mu_opt, determined from the curvature of the cost function at(p_opt, mu_opt). To compute the standard errors for the input waveform, usemu_err = np.sqrt(np.diag(mu_cov)).psi_opt
(ndarray) Optimal estimate of the output waveform.
psi_cov
(ndarray) Covariance matrix estimate for
psi_opt. To compute the standard errors for the output waveform, usepsi_err = np.sqrt(np.diag(psi_cov)).frfun_opt
(complex ndarray) Estimated values of the frequency response function at non-negative frequencies.
resnorm
(float) Euclidean norm (i.e., sum of the squares) of the normalized total least-squares residuals.
dof
(int) Number of statistical degrees of freedom,
dof = n - n_p - n_a - n_b, wherenis the number of samples in each waveform,n_pis the number of fit parameters in the frequency response function, andn_a + n_bis the number of real parameters necessary to specify the frequency response function at the excluded frequencies.delta
(ndarray) Residuals of the input waveform
x, defined asx - mu_opt.delta_norm
(ndarray) Normalized residuals of the input waveform
x, defined asdelta/noise_model.noise_amp(xdata).delta_norm_cov
(ndarray) Covariance matrix estimate for
delta_norm.epsilon
(ndarray) Residuals of the output waveform
y, defined asy - psi_opt, wherepsi_opt = thztools.apply_frf(frfun, mu, dt=dt, args=p_opt),frfunis the parameterized frequency response function, andp_optis the array of optimized parameters.epsilon_norm
(ndarray) Normalized residuals of the output waveform
y, defined asepsilon/noise_model.noise_amp(ydata).epsilon_norm_cov
(ndarray) Covariance matrix estimate for
epsilon_norm.delta_norm_epsilon_norm_cov
(ndarray) Cross-covariance matrix of the normalized residuals
delta_normandepsilon_norm.r_tls
(ndarray) Normalized total least-squares residuals.
success
(bool) True if one of the convergence criteria is satisfied.
diagnostic
(scipy.optimize.OptimizeResult) Instance of
scipy.optimize.OptimizeResultreturned byscipy.optimize.least_squares.See also
fitFit a frequency response function to time-domain data.