Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
juobs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Javier Ugarrio
juobs
Commits
211d2807
Commit
211d2807
authored
3 years ago
by
AlejandroSaezGonzalvo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update bayesian_av to plot weights
parent
fa1cacf5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
src/juobs_tools.jl
src/juobs_tools.jl
+17
-3
No files found.
src/juobs_tools.jl
View file @
211d2807
...
@@ -368,7 +368,7 @@ function bayesian_av(fun::Function, y::Array{uwreal}, tmin_array::Array{Int64},
...
@@ -368,7 +368,7 @@ function bayesian_av(fun::Function, y::Array{uwreal}, tmin_array::Array{Int64},
chisq
=
gen_chisq
(
fun
,
x
,
dy
)
chisq
=
gen_chisq
(
fun
,
x
,
dy
)
fit
=
curve_fit
(
fun
,
x
,
value
.
(
yy
),
W
,
p00
)
fit
=
curve_fit
(
fun
,
x
,
value
.
(
yy
),
W
,
p00
)
isnothing
(
wpm
)
?
(
up
,
chi_exp
)
=
fit_error
(
chisq
,
coef
(
fit
),
yy
)
:
(
up
,
chi_exp
)
=
fit_error
(
chisq
,
coef
(
fit
),
yy
,
wpm
)
isnothing
(
wpm
)
?
(
up
,
chi_exp
)
=
fit_error
(
chisq
,
coef
(
fit
),
yy
)
:
(
up
,
chi_exp
)
=
fit_error
(
chisq
,
coef
(
fit
),
yy
,
wpm
)
uwerr
(
up
[
1
],
wpm
)
isnothing
(
wpm
)
?
uwerr
(
up
[
1
])
:
uwerr
(
up
[
1
],
wpm
)
chi2
=
sum
(
fit
.
resid
.^
2
)
*
dof
(
fit
)
/
chi_exp
chi2
=
sum
(
fit
.
resid
.^
2
)
*
dof
(
fit
)
/
chi_exp
push!
(
AIC
,
chi2
+
2
*
k
+
2
*
Ncut
)
push!
(
AIC
,
chi2
+
2
*
k
+
2
*
Ncut
)
push!
(
chi2chi2exp
,
chi2
/
dof
(
fit
))
push!
(
chi2chi2exp
,
chi2
/
dof
(
fit
))
...
@@ -401,6 +401,13 @@ function bayesian_av(fun::Function, y::Array{uwreal}, tmin_array::Array{Int64},
...
@@ -401,6 +401,13 @@ function bayesian_av(fun::Function, y::Array{uwreal}, tmin_array::Array{Int64},
xlabel
(
L"model"
)
xlabel
(
L"model"
)
display
(
gcf
())
display
(
gcf
())
figure
()
bar
(
x
,
weight_model
,
color
=
"green"
)
ylabel
(
L"
$
weight
$
"
)
xlabel
(
L"model"
)
display
(
gcf
())
end
end
if
!
data
if
!
data
...
@@ -438,7 +445,7 @@ function bayesian_av(fun1::Function, fun2::Function, y::Array{uwreal}, tmin_arra
...
@@ -438,7 +445,7 @@ function bayesian_av(fun1::Function, fun2::Function, y::Array{uwreal}, tmin_arra
chisq
=
gen_chisq
(
fun1
,
x
,
dy
)
chisq
=
gen_chisq
(
fun1
,
x
,
dy
)
fit
=
curve_fit
(
fun1
,
x
,
value
.
(
yy
),
W
,
p00
)
fit
=
curve_fit
(
fun1
,
x
,
value
.
(
yy
),
W
,
p00
)
isnothing
(
wpm
)
?
(
up
,
chi_exp
)
=
fit_error
(
chisq
,
coef
(
fit
),
yy
)
:
(
up
,
chi_exp
)
=
fit_error
(
chisq
,
coef
(
fit
),
yy
,
wpm
)
isnothing
(
wpm
)
?
(
up
,
chi_exp
)
=
fit_error
(
chisq
,
coef
(
fit
),
yy
)
:
(
up
,
chi_exp
)
=
fit_error
(
chisq
,
coef
(
fit
),
yy
,
wpm
)
uwerr
(
up
[
1
],
wpm
)
isnothing
(
wpm
)
?
uwerr
(
up
[
1
])
:
uwerr
(
up
[
1
],
wpm
)
chi2
=
sum
(
fit
.
resid
.^
2
)
*
dof
(
fit
)
/
chi_exp
chi2
=
sum
(
fit
.
resid
.^
2
)
*
dof
(
fit
)
/
chi_exp
push!
(
AIC
,
chi2
+
2
*
k1
+
2
*
Ncut
)
push!
(
AIC
,
chi2
+
2
*
k1
+
2
*
Ncut
)
push!
(
chi2chi2exp
,
chi2
/
dof
(
fit
))
push!
(
chi2chi2exp
,
chi2
/
dof
(
fit
))
...
@@ -482,6 +489,13 @@ function bayesian_av(fun1::Function, fun2::Function, y::Array{uwreal}, tmin_arra
...
@@ -482,6 +489,13 @@ function bayesian_av(fun1::Function, fun2::Function, y::Array{uwreal}, tmin_arra
xlabel
(
L"model"
)
xlabel
(
L"model"
)
display
(
gcf
())
display
(
gcf
())
figure
()
bar
(
x
,
weight_model
,
color
=
"green"
)
ylabel
(
L"
$
weight
$
"
)
xlabel
(
L"model"
)
display
(
gcf
())
end
end
if
!
data
if
!
data
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment