Calculating determinant of a matrix [closed] - math

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I need an recursive algorithm to calculate determinant of n*n matrix.

The Standard Method for computing the determinant is LU decomposition. Use a library like LAPACK in production code. There is absolutely no point in using recursion, LU decomposition is usually implemented by solving M = LU in closed form, and takes O(n^3) operations.

Wikipedia has a formula for calculating determinants. It involves permutations, which can easily be generated recursively. Google has plenty of results on "permutation algorithm".

I don't see the point in recursiveness here.
This matrix operation can easily be implemented in a SIMD operation, can be divided into threads, can be very well calculated on the GPU.
Recursiveness consumes a lot of memory, and some systems have limits in recursion depths.

|a b c d ...|
det |...........|
|...........|
|...........|
= a * det(M1) - b * det(M2) + c * det(M3) - d * det(M4) + ... - ...
where Mn is the remaining Matrix if you drop the first row and the n-th column

Related

Projection of points onto ellipsoid [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I have a set of points (x0...xn, y0...yn, z0....zn) and an ellipsoid given by the equation: x^2/a^2 + y^2/b^2 + z^2/c^2 = 1. Is there an algorithm that could I use to project my points onto my ellipsoid? If so, what are the steps to accomplish this?
You also need a source point, the point that you are projecting from. Each point and the source point form a line, and you can find the intersection of that line and your ellipsoid. There will typically be either two or zero projection points, depending on whether the line intersects the ellipsoid or not. You might try solving the 2d case first to see if you understand it.
David Eberly's book on geometrical methods is usually a good source for such algorithms. You can get some insight from chapter 3 in this pdf. It is about point to ellipsoid distance evaluation but a lot of theory is the same.

What is most efficient way to plot a domain of convergence? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Say, you have a Newton Method algorithms with 2 parameters of interest(a,b).
And I would like to plot their domain of convergence with x-axis = a, y-axis = b. Is there a really fast and simple to do this??? Any suggestions?
My algorithm will basically converge for some values of a & b. If I input (a,b), it will return (the number of iterations , value of a that it converge to, value of b that it converge to). Right now, I am thinking of setting up a for loop within another for loop, which run through all possible values of b first holding a fixed, and all possible values that a will converge holding b fixed.
However, my trouble is: how to identify whether a & b is converging or not. And is there a better way than using nested for loops????

How to perform Particle Swarm Optimization [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
We have been asked to do 5 or 6 iterations of particle swarm optimisation by hand for homework, but i don't really understand how and we were given no examples.
Would it be possible for someone to do the first run through for me so I can see how it works?
Explanations as each step would be fantastic.
Consider an illustrative example of a particle swarm optimisation system composed of three particles and Vmax = 10. To facilitate calculation, we will ignore the fact that r1 and r2 are random numbers and fix them to 0.5 for this exercise. The space of solutions is the two dimensional real valued space R2 and the current state of the swarm is as follows:
Position of particles: x1 = (5,5); x2 = (8,3); x3 = (6,7);
Individual best positions: x∗1 = (5,5); x∗2 = (7,3); x∗3 = (5,6);
Social best position: x∗ = (5,5);
Velocities: v1 = (2,2); v2 = (3,3); v3 = (4,4).
"I don't really understand how and we were given no examples". Let me add a little bit of critique to this sentence. If you're not given any examples it probably means you should be looking for examples for yourself. Have you even put "particle swarm optimization" into Google and look at some of the results? Do you expect everything in your study to be given to you?
There are many resources that explain the working of particle swarm optimization such as wikipedia, Google Scholar, Scholarpedia, or a dedicated website to PSO. The original paper is from Kennedy and Eberhart 1995 and is the top result in the scholar search. Also there are frameworks where PSO is implemented and where you can look at how it works like HeuristicLab. It's an opportunity to explore this topic.

What's the idea of doing x mod 1000000007? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
In many programming problems (e.g. some Project Euler problems) we are asked to report the answer as the remainder left after dividing the answer by 1,000,000,007.
Why not any other number?
Edit:
2 years later, here's what I know: the number is a big prime, and any answer to such a question is so large that it makes sense to report a remainder instead (as the number may be too large for a native datatype to handle).
Let me play a telepathist. 1000...7 are prime numbers and 1000000007 is the biggest one that fits in 32-bit integer. Since prime numbers are used to calculate hash (by finding the remainder of the division by prime), 1000000007 is good for calculating 32-bit hash.

R bootstrap for time series: sieve bootstrap [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Is there any R package (or C++) that has sieve bootstrap? (The bootstrap is a method for estimating the distribution of an estimator or test statistic
by resampling one’s data or a model estimated from the data. This is more complicated when the data are a time series because bootstrap
sampling must be carried out in a way that suitably captures the dependence structure of the data
generation process). For time series there is block bootstrap in the package: boot and Maximum Entropy Bootstrap in the package meboot but I would also like to look at sieve bootstrap which I have heard produces better results than the block. I have done ???sos and http://www.rseek.org
but could not find anything.
Thanks for your help.
This paper appears to indicate that the VLMC package implements the sieve bootstrap with variable length Markov chains.

Resources