I need to know the algorithm(s) it uses, because I have to write my own program. Levenberg-Marquardt doesn't really do the same. Is there like a list of algorithms, from which Mathematica chooses what algorithm to use for a specific problem?
Thank you.
Mathematica 8.x can use the following algorithms for NonLinearModelFit[] for its Method option:
Possible settings for Method include "ConjugateGradient", "Gradient", "LevenbergMarquardt", "Newton", "NMinimize", and "QuasiNewton", with the default being Automatic.
See the documentation for additional options etc.
Note that NonLinearFit[] is obsolete; you should now use FindFit[] instead.
Related
Can I find ode solvers (ode23, ode45, and ode113) in Scilab?
I use these solvers in MATLAB, but I have no idea if there is the same option in Scilab or not.
Thanks in advance.
Did you try the search function? The answer in Convert ode45() to scilab should give an idea, even if RKF is not DoPri5.
Read the documentation on the other available steppers.
The default stepper without type parameter uses lsoda, which can be seen as comparable to ode113
With "stiff" you get lsode, which is approximately equivalent to ode15s.
"adams" could substitute for ode23, there are no explicit low-order methods available, so adaptive-step and order Adams-Bashford is the best you get for a fast integration. And, as mentioned,
"rkf" is an embedded explicit 4(5) method that can substitute for the embedded explicit (4)5 Dormand-Prince method of ode45.
There exist more modern solvers and step-size heuristics, using dense output, an advanced event "root->action" mechanism etc. Scilab is not alone in having a stalled development in this regard. The default is good enough for small projects and prototyping, for massive number-crunching use a compiled language.
This question is about how to best approach a coding interview from a data structures point of view.
The way I see it, there are two different ways, I could implement a specific DS from scratch, initialise it and then use it to solve my problem, or simply use a library (I'm talking about Node.js here, but I guess this applies to other languages as well, at least those with some in-built support for DS) without worrying about the implementation and only focusing on how to use them to solve a problem.
In the first case, I'm also demonstrating that I can implement a specific DS from scratch, but at the same time I would need more time and there's some additional complexity. Instead, using a library would leave me more time to solve the actual problem, but some companies might take a dim view on this approach.
I know there's no silver bullet, and different companies will have different views, but what approach would you take if you could only pick one, and why?
Well it is always best to use the library but it is always better to know how common library functions work at least the basic ones.
For example, in many interviews Binary search is asked to be implemented instead of just using the library functions. This is because knowing the implementation adds some good concept which can be used in general problem solving like using the same concept in other divide and conquer algorithms.
In production level code we always look for the fail safe and properly tested library code.
You should pick available libraries, first hand. If needed, customize the behavior of already available libraries.
I have a simple linear programming problem. After solving it, I get the correct result. I want to speed it up using hot-start feature of MOSEK, but I don't know how to set some parameters like "res.sol.bas.sku", "res.sol.bas.skn", .... I only know an initial solution, i.e, "res.sol.bas.xx", where the value of the variables are stored for a near to optimal solution. Is it possible for me to accelerate the engine using Hot start feature in this way!
Regards
You seem to using MATLAB. Did you read
http://docs.mosek.com/6.0/toolbox/node009.html#238393032
Does it solve the issue?
I am doing some numerical analysis work in VB6, and the question arises of which of
sqr(x)
or
x^0.5
I should use.
Is there any difference in the method used to evaluate these two expressions, and if so, which of them should I prefer?
VB6 does not document the method is uses to evaluate sqr() or x^0.5. Empirically, sqr() is much faster, which could mean that they are using a dedicated root finding algorithm here. The use of a specialized algorithm could mean that sqr() also has better numerical stability, but I have no information regarding this.
How can I put this into spss???
http://www.cbi.dongnocchi.it/glossary/Cosinor.html
I am trying to calculate the MESOR for a cyclic pattern of circadian rhythm.
SPSS is not very good about including built-in procedures for anything beyond very standard social science statistics. However, what you want to do (or something like it, I'm not familiar with the method) is apparently feasible if you transform your variables and then run a linear regression, as documented here (a powerpoint file).
If it isn't strictly necessary to use SPSS, you're probably better off using something like R where what you want is more likely to be formally implemented. Check out the season package.