Tag Info

New answers tagged

0

Using b.gatessucks tips, I managed to get a better solution. I'm using constrained optimization with some reasonable limits on the parameters: In[1115]:= ClearAll[likelihoodf] likelihoodf[m_?NumericQ, std_?NumericQ] := Evaluate[Probability[70 < x < 80, x \[Distributed] TruncatedDistribution[{65, 100}, NormalDistribution[m, std]]]] ...


3

You can get the function explicitly : Probability[70 < x < 80, x \[Distributed] TruncatedDistribution[{65, 100}, NormalDistribution[m, std]]] (* (Erfc[(-80 + m)/(Sqrt[2] std)] - Erfc[(-70 + m)/(Sqrt[2] std)])/(2 (1/2 Erfc[(-100 + m)/(Sqrt[2] std)] - 1/2 Erfc[(-65 + m)/(Sqrt[2] std)])) *) I think most of the numerical errors are due to the ...


0

you may try this, without explicit defenition of F[x,p] it's hard to reccomend something Plot[F[x,#]&/@{10^7, 10^8, 10^9, 10^10, 10^11},{x,0,1}]


2

Primary fixes: Adding First to fidelPhase and adding t to Subscript[u, i, j][t]. Making an objective function obj that is not evaluated until a and b are numeric may or may not be important. I won't have time to check it out (I've lost track of the original optimizer). The following works and it's not crucial to be so precise in one's fixes. ...


1

A nice little function KT (based on Reduce) that provides both optimal variables and corresponding Lagrange multipliers for simple and small problems can be found here The following code takes about 15sec to evaluate on my pc: f = (3/10)*Exp[-z2]*((9/100)*Exp[-(x + z1)] + (3/10)*Exp[-y]) + (9/100)*Exp[-(x + z1)] + (3/10)*Exp[-x] + (3/10)*Exp[-y] + ...


3

Your use of NMaximize has a couple syntax errors. According to the documentation, the restrictions and equations should be given as a list as the first argument, not as the first and second arguments. Also, you have an extraneous {} around your equation and restrictions, so remove those. Finally, remember that LinearProgramming assumes all quantities are ...


3

I don't know if I understand well, but if you want to check, with Mathematica on Unix, if a given file/directory is executable, you'll have to run a specific external unix command line and retrieve the result. Unix useful commands The following concerns UNIX systems but there are probably some equivalent commands for Windows. (Feel free to edit the post if ...


2

Define so it only exists for explicitly numeric intput, as g[x1_?NumberQ,x2_?NumberQ,x3_?NumberQ,x4_?NumberQ,x5_?NumberQ,x6_?NumberQ] Then can do vars = {x1,x2,x3,x4,x5,x6}; NMinimize[{g[x1,x2,x3,x4,x5,x6],Element[vars,Integers] Thread[-2<=#<=2&, vars]}, vars] There are ways to make this slightly cleaner, but that's the idea. The reason ...


3

I've found one difference between NonLinearModelFit and FindFit, and that is that NonLinearModelFit does not allow you to use the NormFunction to adjust how normalization as weighting is done. By default NonLinearModelFit seeks to reduce the sum of the squares of the residuals, so it will be equivalent to FindFit with NormFunction -> (Norm[Abs[#], 2] ...



Top 50 recent answers are included