import numpy as np

def GenerateBeta(d, nz, seed, Random):
    beta = np.zeros((d, 1))
    np.random.seed(seed)
    if Random:
        beta[0:nz] = np.random.normal(0, 2, size=(nz, 1))
    else:
        beta[0:nz] = np.ones((nz, 1))
    #beta[0:30] += np.random.normal(0.5, 0.5, size=(30, 1))
    return beta