

def bgplvm_simulation_missing_data_stochastics(optimize=True, verbose=1, plot=True, plot_sim=False, max_iters=20000.0, percent_missing=0.1, d=13, batchsize=2):
    from GPy import kern
    from GPy.models.bayesian_gplvm_minibatch import BayesianGPLVMMiniBatch
    (D1, D2, D3, N, num_inducing, Q) = (d, 5, 8, 400, 3, 4)
    (_, _, Ylist) = _simulate_matern(D1, D2, D3, N, num_inducing, plot_sim)
    Y = Ylist[0]
    k = kern.Linear(Q, ARD=True)
    inan = _np.random.binomial(1, percent_missing, size=Y.shape).astype(bool)
    Ymissing = Y.copy()
    Ymissing[inan] = _np.nan
    m = BayesianGPLVMMiniBatch(Ymissing, Q, init='random', num_inducing=num_inducing, kernel=k, missing_data=True, stochastic=True, batchsize=batchsize)
    m.Yreal = Y
    if optimize:
        print('Optimizing model:')
        m.optimize('bfgs', messages=verbose, max_iters=max_iters, gtol=0.05)
    if plot:
        m.X.plot('BGPLVM Latent Space 1D')
        m.kern.plot_ARD('BGPLVM Simulation ARD Parameters')
    return m

dataset/ETHPy150Open SheffieldML/GPy/GPy/examples/dimensionality_reduction.py bgplvm_simulation_missing_data_stochastics/original