forked from ilkkavir/ELSPEC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ElSpec_fitfun.m
44 lines (40 loc) · 1.41 KB
/
ElSpec_fitfun.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
function AIC = ElSpec_fitfun(X0,ne,stdne,ne0,A,photoprod,alpha,dt,E,dE,integtype,IePrior,stdPrior,nmeas_eff)
%
% The function to be minimized in the electron energy spectrum
% fit. Re-arranges the paremeter vector p in a more understanble
% form and calls the function update_AICc.
%
% AIC = ElSpec_fitfun(X0,ne,stdne,ne0,A,alpha,dt,E,integtype)
%
% INPUT:
% X0 Coefficients of the polynomial
% ne measured electron density profile
% stdne standard deviations of ne
% ne0 modeled electron density profile from the previous time step
% A Ion production profile matrix
% photoprod Ion production rate by photoionization
% alpha effective recombination rates
% dt time step [s]
% E energies of the dense "model grid"
% dE widths of the energy bins
% integtype type input for integrate_continuity_equation
% ('endNe','integrate',or 'equilibrium')
% IePrior Apriori flux
% stdPrior standard deviation of the apriori
%
%
% OUTPUT:
% AIC corrected Akaike information criterion value
%
%
%
% IV 2017
%
% Copyright I Virtanen <[email protected]> and B Gustavsson <[email protected]>
% This is free software, licensed under GNU GPL version 2 or later
% calculate the actual AICc value
AIC = update_AICc(ne,stdne,ne0,A,photoprod,alpha,dt,X0,E,dE,integtype,IePrior,stdPrior,nmeas_eff);
%if isnan(AIC)
% disp('AIC=NaN')
%end
end