Giter Site home page Giter Site logo

gmmcluster's Introduction

Visit QuantNet

Visit QuantNet GMMcluster Visit QuantNet 2.0

Name of Quantlet: GMMcluster

Published in: 'Metis Variational Bayes'

Description: 'Clustering CRIX Currency Index and its volatility VCRIX with Gaussian Mixture Model (GMM)'

Keywords: 'Clustering, Gaussian Mixture Model, Currency Index, CRIX, VCRIX'

Author: Rui Ren

Submitted: 'Wed, Jan 9 2019 by Rui Ren'

Picture1

PYTHON Code

import matplotlib.pyplot as plt
import seaborn as sns; sns.set()
import numpy as np
from sklearn.mixture import GaussianMixture
import pandas as pd


data=pd.read_csv('cvc.csv')
vol=data['VCRIX'] #volatility of CRIX
cp=data['CRIX']
X=pd.concat([vol, cp], axis=1)

from sklearn.datasets.samples_generator import make_blobs
#X, y_true = make_blobs(n_samples=400, centers=4, cluster_std=0.60, random_state=0)
#X = X[:, ::-1] # flip axes for better plotting

gmm =GaussianMixture(n_components=4).fit(X)
labels = gmm.predict(X)
#plt.scatter(X[:, 0], X[:, 1], c=labels, s=40, cmap='viridis')
plt.scatter(cp, vol, c=labels, s=40, cmap='viridis')
plt.xlabel('CRIX')
plt.ylabel('VCRIX')
plt.show()

automatically created on 2019-01-09

gmmcluster's People

Contributors

rui666666 avatar quantletteam avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

Forkers

michaelalthof

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.