function validate( opts, options ) {
	if ( !isObject( options ) ) {
		return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
	}
	if ( hasOwnProp( options, 'epsilon' ) ) {
		opts.epsilon = options.epsilon;
		if ( !isPositiveNumber( opts.epsilon ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a positive number. Option: `%s`.', 'epsilon', opts.epsilon ) );
		}
	}
	if ( hasOwnProp( options, 'eta0' ) ) {
		opts.eta0 = options.eta0;
		if ( !isPositiveNumber( opts.eta0 ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a positive number. Option: `%s`.', 'eta0', opts.eta0 ) );
		}
	}
	if ( hasOwnProp( options, 'lambda' ) ) {
		opts.lambda = options.lambda;
		if ( !isNonNegativeNumber( opts.lambda ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'lambda', opts.lambda ) );
		}
	}
	if ( hasOwnProp( options, 'learningRate' ) ) {
		opts.learningRate = options.learningRate;
		if ( !isString( opts.learningRate ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'learningRate', opts.learningRate ) );
		}
	}
	if ( hasOwnProp( options, 'loss' ) ) {
		opts.loss = options.loss;
		if ( !isString( opts.loss ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'loss', opts.loss ) );
		}
	}
	if ( hasOwnProp( options, 'intercept' ) ) {
		opts.intercept = options.intercept;
		if ( !isBoolean( opts.intercept ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'intercept', opts.intercept ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination object
@param {Options} options - function options
@param {PositiveNumber} [options.epsilon] - insensitivity parameter
@param {PositiveNumber} [options.eta0] - constant learning rate
@param {PositiveNumber} [options.lambda] - regularization parameter
@param {string} [options.learningRate] - the learning rate to use
@param {string} [options.loss] -  the loss function to use
@param {boolean} [options.intercept] - specifies whether an intercept should be included
@returns {(Error|null)} null or an error object

@example
var opts = {};
var options = {};
var err = validate( opts, options );
if ( err ) {
    throw err;
}