Message Boards Message Boards


Pass starting values in matrix form?

Posted 3 months ago
3 Replies
2 Total Likes

Consider the following MWE, where I try to pass starting values to FindDistributionParameters[]:

emptyμ[n_] := Table[Subscript[μf, i], {i, 1, n}];
emptyΣ[n_] := 
  Table[Subscript[σf^(1 + KroneckerDelta[i, j]), 
    Sort[{i, j}]], {i, 1, n}, {j, 1, n}];
fit = FindDistributionParameters[data, 
    emptyΣ[n], ν]]; (*THIS WORKS*)

I tried to add starting values to FindDistributionParameters[] as:

p = Flatten[{emptyμ[n], emptyΣ[n], ν}]
p0 = Flatten[{Mean[data], Covariance[data], 5}]
start1 = {p, p0}\[Transpose]
start2 = Rule @@@ %
start3 = {emptyμ[n] -> Mean[data], emptyΣ[n] -> Covariance[data] , ν -> 5}

fit = FindDistributionParameters[data, 
    emptyΣ[n], ν], start1(*start2, start3*)]; (*THIS DOESN'T WORK*)

However, nothing works.

Also, is it possible to pass only starting values for one of the required parameters, e.g. start4 = {{ν, 5}}?

3 Replies

Have you tried removing the final semicolon at the end of the last line of code? If I remove it, I get an answer. The semicolon suppresses the display of the output.

Posted 3 months ago

Thanks for your comment, maybe I did not clarify enough: The version without starting values works for me, however, the one that includes "start" does not. Did you test the last line of code?


start1 = {p, p0}\[Transpose]


start1 = DeleteDuplicates[{p, p0}\[Transpose]]

and your code will likely work. What's happening is that the off-diagonal terms are in start1 twice. (You might also need to raise the maximum number of iterations depending on the actual data.)

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract