anchor.diff:  //            |> Seq.mapi (fun i {values=sample} -> Column.Create(res.sampler.Parameters.GetName(i),sample))
   //            |> Table.OfColumns
   //        printfn "done"
  -        //Table.Save(posterior, sprintf "posterior_%d.csv" !seed)        
  +        //Table.Save(posterior, sprintf "posterior_%d.csv" !seed)   
  +        0     
       else        
           //simulation    
  -        let v_m = 0.550798
  -        let v_p = 0.219125
  -        let d_m = 0.883239
  -        let d_p = 7.6e-49
  -        let v_b = 0.269306
  -        let d_b = 0.469225
  -        let D = 1587.39
  -        let Sigma = 0.0430126
  -
  -        let testWind = getWind predictorsT v_m v_p d_m d_p
  -
  -        let testWind = expandWind testWind
  -
  -        let time_start = timeToTick 150.0        
  -        let time_stop = timeToTick 2000.0        
  -        let time_by = 100
  -        let space_start = 0
  -        let space_end = 1587
  -
  -        let simulation = simulate testWind time_start time_stop time_by space_start space_end
  -
  -        //Dumping the data to NetCDF using http://research.microsoft.com/en-us/downloads/ccf905f6-34c6-4845-892e-a5715a508fa3/
  -        let ds = Microsoft.Research.Science.Data.DataSet.Open("msds:nc?openMode=create&file=simulation.nc")
  -        ds.IsAutocommitEnabled <- false
  -        //let windVar = ds.AddVariable<float>("windDens",[|"x";"t"|])
  -        let windSpVar = ds.AddVariable<float>("avgWindSpeed",[|"x";"t"|])
  -        //let windSpMaxVar = ds.AddVariable<float>("maxWindSpeed",[|"x";"t"|])
  -        let timeAxis = ds.AddVariable<int>("t",[|"t"|])
  -        let spaceAxis = ds.AddVariable<int>("x",[|"x"|])        
  -
  -        let timeObsAxis = ds.AddVariable<int>("obs_time",[|"t_obs"|])
  -        let obsAxis = ds.AddVariable<float>("obs",[|"t_obs"|])
  -        let predAxis = ds.AddVariable<float>("pred",[|"t_obs"|])
  -        let predMeanAxis = ds.AddVariable<float>("predMean",[|"t_obs"|])
  -
  -        let dummy =
  -            Table.MapToColumn "pred" ["ts";"velocity_mean"]  (fun (t:float) (v:float) ->
  -                let burstsAtEarth = locationState testWind (timeToTick t) (int(round(D)))
  -                let windAtEart = windAvg burstsAtEarth
  -                let v_avg_Earth,d_avg_Earth = windAtEart
  -                let mu = (v_b*d_b+v_avg_Earth*d_avg_Earth)/(d_b+d_avg_Earth)
  -                        
  -                let n = Statistics.Normal(mu,Sigma)
  -                let pred = Statistics.draw rng n
  -                timeObsAxis.Append([|timeToTick t|]);
  -                obsAxis.Append([|v|]);
  -                predAxis.Append([|toKmPerS pred|]);
  -                predMeanAxis.Append([|toKmPerS mu|]);
  -                //printfn "%f %f %f %f" t v pred mu
  -                pred
  -                ) observationsT
  -
  -        printfn "simulated for %d time moments" (dummy.RowsCount)
  -
  -        List.iteri (fun i sample_speed ->
  -            let t = time_start+i
  -            let sample_speed_km_s = Array.map toKmPerS sample_speed
  -            windSpVar.Append(sample_speed_km_s,"t")            
  -            timeAxis.Append([|t|]);
  -            )
  -            simulation
  -        let spaceAxisData = Array.init (space_end-space_start+1) (fun i -> space_start+i)
  -        spaceAxis.Append(spaceAxisData)
  -
  -        ds.Commit()        
  +//        let v_m = 0.470203
  +//        let v_p = 0.558267
  +//        let d_m = 0.519722
  +//        let d_p = 1.25e-245
  +//        let v_b = 0.224688
  +//        let d_b = 0.675671
  +//        let D = 1795.86
  +//        let Sigma = 0.0527357
  +//
  +//        let testWind = getWind predictorsT v_m v_p d_m d_p
  +//
  +//        let testWind = expandWind testWind
  +//
  +//        let time_start = timeToTick 1500.0        
  +//        let time_stop = timeToTick 2000.0        
  +//        let time_by = 100
  +//        let space_start = 0
  +//        let space_end = 1587
  +//
  +//        let simulation = simulate testWind time_start time_stop time_by space_start space_end
  +//
  +//        //Dumping the data to NetCDF using http://research.microsoft.com/en-us/downloads/ccf905f6-34c6-4845-892e-a5715a508fa3/
  +//        let ds = Microsoft.Research.Science.Data.DataSet.Open("msds:nc?openMode=create&file=simulation.nc")
  +//        ds.IsAutocommitEnabled <- false
  +//        //let windVar = ds.AddVariable<float>("windDens",[|"x";"t"|])
  +//        let windSpVar = ds.AddVariable<float>("avgWindSpeed",[|"x";"t"|])
  +//        //let windSpMaxVar = ds.AddVariable<float>("maxWindSpeed",[|"x";"t"|])
  +//        let timeAxis = ds.AddVariable<int>("t",[|"t"|])
  +//        let spaceAxis = ds.AddVariable<int>("x",[|"x"|])        
  +//
  +//        let timeObsAxis = ds.AddVariable<int>("obs_time",[|"t_obs"|])
  +//        let obsAxis = ds.AddVariable<float>("obs",[|"t_obs"|])
  +//        let predAxis = ds.AddVariable<float>("pred",[|"t_obs"|])
  +//        let predMeanAxis = ds.AddVariable<float>("predMean",[|"t_obs"|])
  +//
  +//        let dummy =
  +//            Table.MapToColumn "pred" ["ts";"velocity_mean"]  (fun (t:float) (v:float) ->
  +//                let burstsAtEarth = locationState testWind (timeToTick t) (int(round(D)))
  +//                let windAtEart = windAvg burstsAtEarth
  +//                let v_avg_Earth,d_avg_Earth = windAtEart
  +//                let mu = (v_b*d_b+v_avg_Earth*d_avg_Earth)/(d_b+d_avg_Earth)
  +//                        
  +//                let n = Statistics.Normal(mu,Sigma)
  +//                let pred = Statistics.draw rng n
  +//                timeObsAxis.Append([|timeToTick t|]);
  +//                obsAxis.Append([|v|]);
  +//                predAxis.Append([|toKmPerS pred|]);
  +//                predMeanAxis.Append([|toKmPerS mu|]);
  +//                //printfn "%f %f %f %f" t v pred mu
  +//                pred
  +//                ) observationsT
  +//
  +//        printfn "simulated for %d time moments" (dummy.RowsCount)
  +//
  +//        List.iteri (fun i sample_speed ->
  +//            let t = time_start+i
  +//            let sample_speed_km_s = Array.map toKmPerS sample_speed
  +//            windSpVar.Append(sample_speed_km_s,"t")            
  +//            timeAxis.Append([|t|]);
  +//            )
  +//            simulation
  +//        let spaceAxisData = Array.init (space_end-space_start+1) (fun i -> space_start+i)
  +//        spaceAxis.Append(spaceAxisData)
  +//
  +//        ds.Commit()        
       
       0 // return an integer exit code
  
positive.code:         if System.Double.IsNaN mu then
              log improbable
          else
              let distribution = Statistics.Normal(mu,Sigma)
              let lglk = log_pdf distribution v
              //printfn "mu:%g\tv:%g\tsigma:%g\tlglk:%g" mu v Sigma lglk
              lglk        
  
negative.code: 
  let mutable bestLglk = System.Double.NegativeInfinity
  
  let mutable iteration_counter = 0
  
  let logLikelihood (predictorsT: Table) (observationsT: Table) (p: Parameters) =                
      //Distance to Earth
      //varies between 0.9832898912 and 1.0167103335 AU. 
  