thztools.FitResult#
- class thztools.FitResult(p_opt, p_err, p_cov, mu_opt, mu_err, psi_opt, frfun_opt, resnorm, dof, delta, epsilon, 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))
.- p_covndarray
Covariance matrix estimate for
p_opt
, determined from the curvature of the cost function at(p_opt, mu_opt)
.- 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)
.- psi_optndarray
Optimal estimate of the output waveform.
- 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
, wheren
is the number of samples in each waveform,n_p
is the number of fit parameters in the frequency response function, andn_a + n_b
is 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
.- epsilonndarray
Residuals of the output waveform
y
, defined asy - psi_opt
, wherepsi_opt = thztools.apply_frf(frfun, mu, dt=dt, args=p_opt)
,frfun
is the parameterized frequency response function, andp_opt
is the array of optimized parameters.- r_tlsndarray
Normalized total least-squares residuals.
- successbool
True if one of the convergence criteria is satisfied.
- diagnosticscipy.optimize.OptimizeResult
Instance of
scipy.optimize.OptimizeResult
returned 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)
.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)
.psi_opt
(ndarray) Optimal estimate of the output waveform.
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
, wheren
is the number of samples in each waveform,n_p
is the number of fit parameters in the frequency response function, andn_a + n_b
is 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
.epsilon
(ndarray) Residuals of the output waveform
y
, defined asy - psi_opt
, wherepsi_opt = thztools.apply_frf(frfun, mu, dt=dt, args=p_opt)
,frfun
is the parameterized frequency response function, andp_opt
is the array of optimized parameters.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.OptimizeResult
returned byscipy.optimize.least_squares
.See also
fit
Fit a frequency response function to time-domain data.