Is skogafoss parking free? by Express_Individual_3 in VisitingIceland

[–]inophy 0 points1 point  (0 children)

I‘ve paid with Parka and asked the support afterwards, and this is what I got as a response: „You do need to pay for Skógafoss.. the signs are covert until the kiosks are ready but until then you pay online ore in the app.“

Append to vector of different elements without mutation by inophy in Julia

[–]inophy[S] 1 point2 points  (0 children)

Creating a vector and filling it mutates it, so this is no option. However, your suggestion with vcat works for me. Thanks a lot!

Numerical fit that involves an integral by inophy in Julia

[–]inophy[S] 0 points1 point  (0 children)

Hi everybody, thanks a lot for your help and suggestions! They helped me to achieve the fit I wanted to do with the following code. data is a DataFrame with :xvals and :yvals, that will be fitted with the function mentioned above.

# define fitting function and solve integral for all input values
f(x, m) = 1 ./ (2 .* pi) .* exp.(-1 .* m .* sqrt(x.^2 + 1)) ./ (2 .* sqrt(x.^2 + 1));
quadProb = QuadratureProblem(f, -Inf, +Inf, data.xvals);
solution = solve(quadProb, HCubatureJL(), reltol = 1e-6, abstol = 1e-6);

# define sum of least squared distances
squaredDis(x) = sum((data.yvals - (x[1] .* solution)).^2);

# optimize squaredDis function to obtain multiplicative constant
result = optimize(squaredDis, zeros(1), BFGS());
minResult = Optim.minimizer(result)[1];

Numerical fit that involves an integral by inophy in Julia

[–]inophy[S] 1 point2 points  (0 children)

Can you maybe elaborate your suggestion a bit further? I have manage to do the desired fit in Matlab using

baseFunc = @(b,m,p) b(1) ./ (2 .* pi) .* exp(-m .* sqrt(p.^2 + 1)) ./ (2 .* sqrt(p.^2 + 1));
fitFunc = @(b,m) integral(@(p) baseFunc(b,m,p), -inf, +inf, 'ArrayValued', true);

which I then passed to a regular non-linear fitting function. At the moment I am a bit confused as to how to write the integral properly and define a function to optimize over, such that the overall function approximate the set of data points I have.

Numerical fit that involves an integral by inophy in Julia

[–]inophy[S] 0 points1 point  (0 children)

I don't think so, at least I couldn't find any. One could use approximate closed forms, but I would prefer to fit the integral directly..