MCMC Order Search

Some rough pseudocode of what I am implementing:
The main detail I am not too sure about is the last step. In a sampling algorithm, we would store od_{i+1} since that is the step we made. In this version, it seems that we would ignore duplicates (i.e. it wouldn't be useful to attempt to add od_{i+1} when od_{i+1}=od_i).
- Code: Select all
MCMC-ORDER-SEARCH(dataset d, max_parents k, max_time t):
[1. INITIALIZATION:]
od_0 = random_order( d )
s_0 = log_score( od_0, d, k )
results = { (od_0, s_0) }
end_time = system_time() + t
while ( system_time() < end_time )
[2. PROPOSAL:]
od*_{i+1} = random_swap( od_i )
s*_{i+1} = log_score( od*_{i+1}, d, k )
[3. ACCEPT-REJECT:]
if ( rand[0,1] < exp( s*_{i+1} - s_i ) )
od_{i+1} = od*_{i+1}
s_{i+1} = s*_{i+1}
else
od_{i+1} = od_i
s_{i+1} = s_i
end
results = { results, (od*_{i+1}, s*_{i+1}) }
end
The main detail I am not too sure about is the last step. In a sampling algorithm, we would store od_{i+1} since that is the step we made. In this version, it seems that we would ignore duplicates (i.e. it wouldn't be useful to attempt to add od_{i+1} when od_{i+1}=od_i).