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
d790fe3f
Commit
d790fe3f
authored
3 years ago
by
Alejandro Saez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update in bayesian_av
Now model labels in plots
parent
e3532dd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
src/juobs_tools.jl
src/juobs_tools.jl
+12
-4
No files found.
src/juobs_tools.jl
View file @
d790fe3f
...
@@ -347,6 +347,7 @@ function bayesian_av(fun::Function, y::Array{uwreal}, tmin_array::Array{Int64},
...
@@ -347,6 +347,7 @@ function bayesian_av(fun::Function, y::Array{uwreal}, tmin_array::Array{Int64},
AIC
=
Array
{
Float64
,
1
}()
AIC
=
Array
{
Float64
,
1
}()
chi2chi2exp
=
Array
{
Float64
,
1
}()
chi2chi2exp
=
Array
{
Float64
,
1
}()
p1
=
Array
{
uwreal
,
1
}()
p1
=
Array
{
uwreal
,
1
}()
mods
=
Array
{
String
,
1
}()
if
tmax_array
[
end
]
>
length
(
y
)
if
tmax_array
[
end
]
>
length
(
y
)
error
(
"Error: upper bound for the fits is bigger than last data point"
)
error
(
"Error: upper bound for the fits is bigger than last data point"
)
...
@@ -373,6 +374,8 @@ function bayesian_av(fun::Function, y::Array{uwreal}, tmin_array::Array{Int64},
...
@@ -373,6 +374,8 @@ function bayesian_av(fun::Function, y::Array{uwreal}, tmin_array::Array{Int64},
push!
(
AIC
,
chi2
+
2
*
k
+
2
*
Ncut
)
push!
(
AIC
,
chi2
+
2
*
k
+
2
*
Ncut
)
push!
(
chi2chi2exp
,
chi2
/
dof
(
fit
))
push!
(
chi2chi2exp
,
chi2
/
dof
(
fit
))
push!
(
p1
,
up
[
1
])
push!
(
p1
,
up
[
1
])
push!
(
mods
,
string
(
"["
,
INDEX
+
1
,
","
,
j
,
"]"
))
catch
e
catch
e
@warn
string
(
":/ Negative window for error propagation at tmin = "
,
INDEX
,
", tmax = "
,
j
,
"; skipping that point"
)
@warn
string
(
":/ Negative window for error propagation at tmin = "
,
INDEX
,
", tmax = "
,
j
,
"; skipping that point"
)
end
end
...
@@ -396,14 +399,14 @@ function bayesian_av(fun::Function, y::Array{uwreal}, tmin_array::Array{Int64},
...
@@ -396,14 +399,14 @@ function bayesian_av(fun::Function, y::Array{uwreal}, tmin_array::Array{Int64},
figure
()
figure
()
fill_between
(
1
:
length
(
p1
),
v
-
e
,
v
+
e
,
color
=
"green"
,
alpha
=
0.75
)
fill_between
(
1
:
length
(
p1
),
v
-
e
,
v
+
e
,
color
=
"green"
,
alpha
=
0.75
)
errorbar
(
x
,
y
,
dy
,
fmt
=
"x"
,
color
=
"black"
)
errorbar
(
mods
,
y
,
dy
,
fmt
=
"x"
,
color
=
"black"
)
ylabel
(
L"
$
p_1
$
"
)
ylabel
(
L"
$
p_1
$
"
)
xlabel
(
L"model"
)
xlabel
(
L"model"
)
display
(
gcf
())
display
(
gcf
())
figure
()
figure
()
bar
(
x
,
weight_model
,
color
=
"green"
)
errorbar
(
mods
,
weight_model
,
0
*
dy
,
color
=
"green"
)
ylabel
(
L"
$
weight
$
"
)
ylabel
(
L"
$
weight
$
"
)
xlabel
(
L"model"
)
xlabel
(
L"model"
)
...
@@ -424,6 +427,7 @@ function bayesian_av(fun1::Function, fun2::Function, y::Array{uwreal}, tmin_arra
...
@@ -424,6 +427,7 @@ function bayesian_av(fun1::Function, fun2::Function, y::Array{uwreal}, tmin_arra
AIC
=
Array
{
Float64
,
1
}()
AIC
=
Array
{
Float64
,
1
}()
chi2chi2exp
=
Array
{
Float64
,
1
}()
chi2chi2exp
=
Array
{
Float64
,
1
}()
p1
=
Array
{
uwreal
,
1
}()
p1
=
Array
{
uwreal
,
1
}()
mods
=
Array
{
String
,
1
}()
if
tmax_array
[
end
]
>
length
(
y
)
if
tmax_array
[
end
]
>
length
(
y
)
error
(
"Error: upper bound for the fits is bigger than last data point"
)
error
(
"Error: upper bound for the fits is bigger than last data point"
)
...
@@ -451,6 +455,8 @@ function bayesian_av(fun1::Function, fun2::Function, y::Array{uwreal}, tmin_arra
...
@@ -451,6 +455,8 @@ function bayesian_av(fun1::Function, fun2::Function, y::Array{uwreal}, tmin_arra
push!
(
chi2chi2exp
,
chi2
/
dof
(
fit
))
push!
(
chi2chi2exp
,
chi2
/
dof
(
fit
))
push!
(
p1
,
up
[
1
])
push!
(
p1
,
up
[
1
])
push!
(
mods
,
string
(
"["
,
INDEX
+
1
,
","
,
j
,
"]"
))
p00
=
[
0.5
for
i
in
1
:
1
:
k2
]
p00
=
[
0.5
for
i
in
1
:
1
:
k2
]
chisq
=
gen_chisq
(
fun2
,
x
,
dy
)
chisq
=
gen_chisq
(
fun2
,
x
,
dy
)
fit
=
curve_fit
(
fun2
,
x
,
value
.
(
yy
),
W
,
p00
)
fit
=
curve_fit
(
fun2
,
x
,
value
.
(
yy
),
W
,
p00
)
...
@@ -461,6 +467,8 @@ function bayesian_av(fun1::Function, fun2::Function, y::Array{uwreal}, tmin_arra
...
@@ -461,6 +467,8 @@ function bayesian_av(fun1::Function, fun2::Function, y::Array{uwreal}, tmin_arra
push!
(
chi2chi2exp
,
chi2
/
dof
(
fit
))
push!
(
chi2chi2exp
,
chi2
/
dof
(
fit
))
push!
(
p1
,
up
[
1
])
push!
(
p1
,
up
[
1
])
push!
(
mods
,
string
(
"["
,
INDEX
+
1
,
","
,
j
,
"]"
))
catch
e
catch
e
@warn
string
(
":/ Negative window for error propagation at tmin = "
,
INDEX
,
", tmax = "
,
j
,
"; skipping that point"
)
@warn
string
(
":/ Negative window for error propagation at tmin = "
,
INDEX
,
", tmax = "
,
j
,
"; skipping that point"
)
end
end
...
@@ -484,14 +492,14 @@ function bayesian_av(fun1::Function, fun2::Function, y::Array{uwreal}, tmin_arra
...
@@ -484,14 +492,14 @@ function bayesian_av(fun1::Function, fun2::Function, y::Array{uwreal}, tmin_arra
figure
()
figure
()
fill_between
(
1
:
length
(
p1
),
v
-
e
,
v
+
e
,
color
=
"green"
,
alpha
=
0.75
)
fill_between
(
1
:
length
(
p1
),
v
-
e
,
v
+
e
,
color
=
"green"
,
alpha
=
0.75
)
errorbar
(
x
,
y
,
dy
,
fmt
=
"x"
,
color
=
"black"
)
errorbar
(
mods
,
y
,
dy
,
fmt
=
"x"
,
color
=
"black"
)
ylabel
(
L"
$
p_1
$
"
)
ylabel
(
L"
$
p_1
$
"
)
xlabel
(
L"model"
)
xlabel
(
L"model"
)
display
(
gcf
())
display
(
gcf
())
figure
()
figure
()
bar
(
x
,
weight_model
,
color
=
"green"
)
errorbar
(
mods
,
weight_model
,
0
*
dy
,
color
=
"green"
)
ylabel
(
L"
$
weight
$
"
)
ylabel
(
L"
$
weight
$
"
)
xlabel
(
L"model"
)
xlabel
(
L"model"
)
...
...
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