« first day (1282 days earlier)      last day (3370 days later) » 

7:47 AM
A question: I have a stochastic optimization process that tries to minimize cost function over certain space of arguments. It has a pool of candidates, out of which it picks a subset probabilistically, weighted for small cost function value. Then it adds every item to the original set with a simple modification whose nature is probabilistically selected from candidate subcomponents most affecting the cost. Then, candidate set is contracted back to original size by again choosing...
candidates on basis of the cost function. And this is repeated over and over.
Is calling this a MCMC method accurate?
8:13 AM
Once I recalled this kind of method from some entirely different context and understood how to evolve the candidates, it came as quite efficient-looking solution for this question: mathematica.stackexchange.com/questions/88118/…
@kirma I guess the first question is, is it memoryless?
8:37 AM
@blochwave Depends on what you mean by it... :)
My inspiration comes from this paper: arxiv.org/pdf/1211.0557.pdf
In that case, though, there are possible incorrect evolution steps. In my case, they're all valid, some just worse than others.
Yes, I think it is memoryless in this case.
 
3 hours later…
11:55 AM
Is there agreement with Albert that this is a bug? If so it should be tagged as such.
8
A: Dynamic does not update when wrapped in DynamicModule

Albert ReteyI think you are actually not doing anything wrong but have found one of those cases where the automatic dependency tracking doesn't work (I think this is a bug). You can make the code work (version 10.1 on Windows) by explicitly telling the last Dynamic to track choices: Dynamic[choices,Tracked...

 
1 hour later…
1:14 PM
I marked this question as a duplicate and I was joined by Community which closed the question. Why did Community do this and how does it decide my duplicate call was correct?
2:01 PM
@blochwave In the end I removed all the untractable ad-hoc stuff and got a plain Metropolis-Hastings method: mathematica.stackexchange.com/a/88942/3056
 
6 hours later…
8:03 PM
What's the simplest way to extract the upper triangular part of a matrix into a list?
Extract[mat, Subsets[Range@Length[mat], {2}]]
There must be something better.
@Szabolcs so no diagonal?
@chuy No diagonal necessary, but a method that can take the diagonal as well is more interesting of course.
Applying that neighbour sorting to some old stuff...
Flatten[Diagonal[mat, #] & /@ Range[1, Length[mat] - 1]]
not much better
but you can include the diag if desired Flatten[Diagonal[mat, #] & /@ Range[0, Length[mat] - 1]]
8:33 PM
Hmmh... how do I perform geometry on an arbitrary surface? Both in Mathematica and in general.
Like, I have a well-behaved 2D surface embedded in 3D space, and I want to ask a question: what points on the surface are at distance r from two other points?
RegionDistance?
@chuy I don't believe it quite succeeds in that. What I was thinking of is, say, having a torus. Now, I paint a spot on it, and want to continue painting spots on its surface in a manner that over "tape measure" on the surface, every new spot is as close as possible to the previous ones, but not overlapping.
@kirma oh I see
I can sort of see how I could approach this problem on a discretized surface consisting of triangles.
tricky
8:49 PM
I'm thinking mostly of visual stuff on practice, but odd constructs like print halftoning you can see on paper, being embedded on complicated geometric surfaces, just for fun.
9:33 PM
@Szabolcs (UpperTriangularize[mat] // Flatten ) /. 0 -> Nothing
9:57 PM
@Sq
@SquareOne that could be dangerous if your upper triangle contains legitimate zeros
10:23 PM
@chuy mmmh. Then (UpperTriangularize[m /. 0 -> foo] // Flatten) /. 0 -> Nothing /. foo -> 0 but it gets less simple ! ;)
10:44 PM
MapIndexed[
  If[LessEqual @@ #2, #, Nothing] &,
  mat,
  {2}
  ] // Flatten

« first day (1282 days earlier)      last day (3370 days later) »