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
363f46a1
Commit
363f46a1
authored
3 years ago
by
AlejandroSaezGonzalvo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed in bayesian_av from juobs_tools.jl
parent
6d6b63bb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/juobs_tools.jl
src/juobs_tools.jl
+7
-7
No files found.
src/juobs_tools.jl
View file @
363f46a1
...
...
@@ -351,7 +351,7 @@ function bayesian_av(fun::Function, y::Array{uwreal}, tmin_array::Array{Int64},
for
INDEX
in
tmin_array
## vary tmin
for
j
in
tmax_array
## vary tmax
try
#
try
x
=
[
i
for
i
in
INDEX
+
1
:
1
:
j
]
yy
=
y
[
INDEX
+
1
:
1
:
j
]
Ncut
=
total
-
length
(
x
)
...
...
@@ -359,7 +359,7 @@ function bayesian_av(fun::Function, y::Array{uwreal}, tmin_array::Array{Int64},
W
=
1
./
dy
.^
2
p00
=
[
0.5
for
i
in
1
:
1
:
k
]
chisq
=
fit_defs
(
fun
,
x
,
W
)
chisq
=
gen_chisq
(
fun
,
x
,
dy
)
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
)
uwerr
(
up
[
1
],
wpm
)
...
...
@@ -367,9 +367,9 @@ function bayesian_av(fun::Function, y::Array{uwreal}, tmin_array::Array{Int64},
push!
(
AIC
,
chi2
+
2
*
k
+
2
*
Ncut
)
push!
(
chi2chi2exp
,
chi2
/
dof
(
fit
))
push!
(
p1
,
up
[
1
])
catch
e
@warn
string
(
":/ Negative window for error propagation at tmin = "
,
INDEX
,
", tmax = "
,
j
,
"; skipping that point"
)
end
#
catch e
#
@warn string(":/ Negative window for error propagation at tmin = ", INDEX, ", tmax = ", j, "; skipping that point")
#
end
end
end
...
...
@@ -409,7 +409,7 @@ function bayesian_av(fun1::Function, fun2::Function, y::Array{uwreal}, tmin_arra
W
=
1
./
dy
.^
2
p00
=
[
0.5
for
i
in
1
:
1
:
k1
]
chisq
=
fit_defs
(
fun1
,
x
,
W
)
chisq
=
gen_chisq
(
fun1
,
x
,
dy
)
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
)
uwerr
(
up
[
1
],
wpm
)
...
...
@@ -419,7 +419,7 @@ function bayesian_av(fun1::Function, fun2::Function, y::Array{uwreal}, tmin_arra
push!
(
p1
,
up
[
1
])
p00
=
[
0.5
for
i
in
1
:
1
:
k2
]
chisq
=
fit_defs
(
fun2
,
x
,
W
)
chisq
=
gen_chisq
(
fun2
,
x
,
dy
)
fit
=
curve_fit
(
fun2
,
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
)
uwerr
(
up
[
1
],
wpm
)
...
...
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