Exemple #1
0
def sample_Carls_kernel():
    kernel = fk.Carls_Mauna_kernel()
        
    X = np.linspace(0,50,500)
    
    # Todo: set random seed.
    sample = gpml.sample_from_gp_prior(kernel, X)
    
    pylab.figure()
    pylab.plot(X, sample)    
    pylab.title('Carl''s kernel');
def sample_Carls_kernel():
    kernel = fk.Carls_Mauna_kernel()

    X = np.linspace(0, 50, 500)

    # Todo: set random seed.
    sample = gpml.sample_from_gp_prior(kernel, X)

    pylab.figure()
    pylab.plot(X, sample)
    pylab.title('Carl'
                's kernel')
Exemple #3
0
def sample_mauna_best():
    # This kernel was chosen from a run of Mauna datapoints.
    kernel = ( fk.SqExpKernel(-0.7, -1.3) + fk.SqExpKernel(4.8, 2.3) ) * \
             ( fk.SqExpKernel(3.0, 0.5) + fk.SqExpPeriodicKernel(0.4, -0.0, -0.9) ) 
        
    X = np.linspace(0,50,500)
    
    # Todo: set random seed.
    sample = gpml.sample_from_gp_prior(kernel, X)
    
    pylab.figure()
    pylab.plot(X, sample)
    pylab.title('( SqExp(ell=-0.7, sf=-1.3) + SqExp(ell=4.8, sf=2.3) ) \n x ( SqExp(ell=3.0, sf=0.5) + Periodic(ell=0.4, p=-0.0, sf=-0.9) )')
def sample_mauna_best():
    # This kernel was chosen from a run of Mauna datapoints.
    kernel = ( fk.SqExpKernel(-0.7, -1.3) + fk.SqExpKernel(4.8, 2.3) ) * \
             ( fk.SqExpKernel(3.0, 0.5) + fk.SqExpPeriodicKernel(0.4, -0.0, -0.9) )

    X = np.linspace(0, 50, 500)

    # Todo: set random seed.
    sample = gpml.sample_from_gp_prior(kernel, X)

    pylab.figure()
    pylab.plot(X, sample)
    pylab.title(
        '( SqExp(ell=-0.7, sf=-1.3) + SqExp(ell=4.8, sf=2.3) ) \n x ( SqExp(ell=3.0, sf=0.5) + Periodic(ell=0.4, p=-0.0, sf=-0.9) )'
    )
def plot_gef_load_Z01():
    # This kernel was chosen from a run of gef_load datapoints.
    #    kernel = eval(ProductKernel([ covMask(ndim=12, active_dimension=0, base_kernel=RQKernel(lengthscale=0.268353, output_variance=-0.104149, alpha=-2.105742)), covMask(ndim=12, active_dimension=9, base_kernel=SqExpKernel(lengthscale=1.160242, output_variance=0.004344)), SumKernel([ covMask(ndim=12, active_dimension=0, base_kernel=SqExpPeriodicKernel(lengthscale=-0.823413, period=0.000198, output_variance=-0.917064)), covMask(ndim=12, active_dimension=0, base_kernel=RQKernel(lengthscale=-0.459219, output_variance=-0.077250, alpha=-2.212718)) ]) ]))

    X, y, D = fear_load_mat('../data/gef_load_full_Xy.mat', 1)

    kernel = fk.MaskKernel(D, 0, fk.RQKernel(0.268353, -0.104149, -2.105742)) * fk.MaskKernel(D, 9, fk.SqExpKernel(1.160242, 0.004344)) * \
             (fk.MaskKernel(D, 0, fk.SqExpPeriodicKernel(-0.823413, 0.000198, -0.917064)) + fk.MaskKernel(D, 0, fk.RQKernel(-0.459219, -0.077250, -2.212718)))

    # Todo: set random seed.
    sample = gpml.sample_from_gp_prior(kernel, X[0:499, :])

    pylab.figure()
    pylab.plot(X[0:499, 0], y[0:499])
    pylab.title('GEFCom2012 Z01 and T09 - first 500 data points')
    pylab.xlabel('Time')
    pylab.ylabel('Load')
Exemple #6
0
def plot_gef_load_Z01():
    # This kernel was chosen from a run of gef_load datapoints.
#    kernel = eval(ProductKernel([ covMask(ndim=12, active_dimension=0, base_kernel=RQKernel(lengthscale=0.268353, output_variance=-0.104149, alpha=-2.105742)), covMask(ndim=12, active_dimension=9, base_kernel=SqExpKernel(lengthscale=1.160242, output_variance=0.004344)), SumKernel([ covMask(ndim=12, active_dimension=0, base_kernel=SqExpPeriodicKernel(lengthscale=-0.823413, period=0.000198, output_variance=-0.917064)), covMask(ndim=12, active_dimension=0, base_kernel=RQKernel(lengthscale=-0.459219, output_variance=-0.077250, alpha=-2.212718)) ]) ]))

    X, y, D = fear_load_mat('../data/gef_load_full_Xy.mat', 1)
    
    kernel = fk.MaskKernel(D, 0, fk.RQKernel(0.268353, -0.104149, -2.105742)) * fk.MaskKernel(D, 9, fk.SqExpKernel(1.160242, 0.004344)) * \
             (fk.MaskKernel(D, 0, fk.SqExpPeriodicKernel(-0.823413, 0.000198, -0.917064)) + fk.MaskKernel(D, 0, fk.RQKernel(-0.459219, -0.077250, -2.212718)))
    
    # Todo: set random seed.
    sample = gpml.sample_from_gp_prior(kernel, X[0:499,:])
    
    pylab.figure()
    pylab.plot(X[0:499,0], y[0:499])
    pylab.title('GEFCom2012 Z01 and T09 - first 500 data points')
    pylab.xlabel('Time')
    pylab.ylabel('Load')