Recent content by jimmy1

  1. J

    Mathematica How can I randomly shuffle the positions within a Mathematica table?

    Use the RandomPermutation[] function. It should do the trick. (need to load the DiscreteMath package to use it)
  2. J

    Mathematica Calculate Real Part of Expression in Mathematica

    You have written the imaginary symbol "i" wrongly in your code. Replace it with a capital "I" or alternatively use the mathematica symbol for an imaginary number, which you can get by typing Esc, ii, Esc (Esc is the button Esc on the keyboard). Try either method and you should get the code to work.
  3. J

    Mathematica Plotting in a loop in mathematica

    Use the Table[..] function to do the loop. First use Table[NDSolve[...],{i,Length[arr]}] to get an array of solutions for the parameters you want, where 'arr' is an array storing your parameters. Then just do a similar loop for your plot. ie. Table[Plot[...],{i,Length[solArr]}], where solArr...
  4. J

    MATLAB Would matlab be faster than Mathematica for this?

    I have an optimization problem which I cannot seem to solve in Mathematica as the computation time takes too long, and I'm wondering whether things would improve if I performed the same task on a program such as Matlab? The task is to find the maximum of a non-linear function (the function is...
  5. J

    Systems of algebraic equations

    So without finding any of these solutions, is there any way to show that they actually exist?
  6. J

    Systems of algebraic equations

    Ok, so is there any general method to show that a solution exists (or dosn't exist) to a system of non linear equations? What would the best approach be?
  7. J

    Systems of algebraic equations

    If I had a linear system of algebraic equations, then I can relate the number of unknowns to the number of equations to determine if a solution exists. However, does this criteria carry over to nonlinear equations? For example, I have a set of m>2 non linear equations and I have 2 unknowns...
  8. J

    Mathematica Calculating Integral in Mathematica

    Cool, thanks guys! I've used your suggestions and I think I've got it now, just need to test the result a bit more. Anyway, cheers for the help!
  9. J

    Mathematica Calculating Integral in Mathematica

    Basically, f(x1,x2) is a http://en.wikipedia.org/wiki/Multivariate_normal_distribution" . An example in Mathematica code would be: f(x) = "Integrate[PDF[MultinormalDistribution[{5,6}, {{1,1}, {1,2}}], {x1,x2}], {x1,x,c},{x2,x,c}]" For any particular value of x and c (c is a known constant) I...
  10. J

    Mathematica Calculating Integral in Mathematica

    Unfortunately f(x) has no closed form solution (so the expression for f(x) still has the symbols x1, x2) and thus evaluating "NIntegrate[ f[x], {x, c1, c} ]" just gives the error the "Integrand ... is not numerical at...". I've also tried "NIntegrate[ f[x], {x1, x, c}, {x2, x, c}, {x, c1...
  11. J

    Mathematica Calculating Integral in Mathematica

    I have a function f(x) which is defined as f(x) = \int_{x}^{c} \int_{x}^{c} f(x_1,x_2) dx_1 dx_2 where c is a known constant and f(x1,x2) is a multivariate Gaussian. Unfortunetaly there is no closed form solution for f(x). My problem is I want to numerically calculate \int_{c_1}^{c} f(x)...
  12. J

    Estimating parameters from multivariate normal

    I need to estimate parameters from data that follow a mutinormal distribution. The parameters that I need to estimate are contained in the expression for the mean of the marginal normal distributions. That is each marginal distribution has mean: \frac{p_1*c_i + p_1*y}{p_1+p_2} where...
  13. J

    Var of Sum of Random Variables when n is a Random Variable?

    Are you sure the terms highlighted are correct? Shouldn't it read: Var[E[\sum_1^n X|n]] = Var[n\mu] = Var[n]\mu^2 ?? And therefore, as mathman has stated (var(sum)=sum(var)) does not hold when n is a random variable?
  14. J

    Var of Sum of Random Variables when n is a Random Variable?

    If I have a set of indepenent and identically distributed random variables X1,...Xn, then Var(\sum_{i=1}^{n}X_i) = \sum_{i=1}^{n}Var(X_i). Now I want to know what the sum of variances of Xi would be when n is a random variable? I'm guessing the above statement still holds when n is a random...
  15. J

    Is the formula for conditional expectation valid for multiple random variables?

    Ah yes, that clears things up. Cheers, you've been great help once again!
Back
Top