Skip to content

Instantly share code, notes, and snippets.

View janfait's full-sized avatar

Jan Fait janfait

  • bizmachine.com
  • Czech Republic
View GitHub Profile
@janfait
janfait / gist:7563185f54d97d2c057e
Last active August 26, 2015 12:06 — forked from CerebralMastication/gist:8039120
Example of iman conover
import pandas as pd
## dummy covariance matrix
cov = eye(2) + -.7
fill_diagonal(cov, 1)
# a little bit of non correalted random variates
# also sometimes called the marginal distributions
n = 10000
@janfait
janfait / monte-carlo-sample.r
Last active August 26, 2015 08:29 — forked from jkeirstead/monte-carlo-sample.r
Generate a Monte Carlo sample with Sobol' LDQR sequence
# Generate a Monte Carlo sample using Sobol' low-discrepancy quasi-random sequences
# James Keirstead
# 3 February 2012
#
# Random sampling with R's standard methods is inefficient for Monte Carlo analysis as
# the sampled values do not cover the parameter space evenly. This Gist allows users
# to create parameter samples using Sobol' sequences to get around this problem.
# makeMCSample
# Makes a Monte Carlo sample using Sobol' sequences
#!/usr/bin/python
import cgi
import requests
import json
from simple_salesforce import Salesforce
#login here:
#https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=3MVG9A2kN3Bn17hsWsLDatw._IVMEUBoPKv.7ksp0tz7xLX4tWDVgyzwTCA7i_yTfP.qYuNOsSoPNcdVH6DuE&redirect_uri=http://localhost/cgi-bin/python/oauth.py
@janfait
janfait / server.r
Last active August 29, 2015 14:11 — forked from wch/app.r
max_plots <- 5
shinyServer(function(input, output) {
# Insert the right number of plot output objects into the web page
output$plots <- renderUI({
plot_output_list <- lapply(1:input$n, function(i) {
plotname <- paste("plot", i, sep="")
plotOutput(plotname, height = 280, width = 250)
})
#!/bin/sh
# download
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.4.zip
# unzip and start
unzip elasticsearch-0.20.4.zip
cd elasticsearch-0.20.4
# remove data in case you have defined some analyzers in the past (e.g. stop/start)
rm -rf data/
####################################################################
# Simulated Annealing je Monte Carlo metoda, která vychází z
# fyzikálního pozorování - při kalení oceli je vhodné její
# teplotu snižovat postupně, protože molekuly při pomalém tuhnutí
# zaujímají prostorovou konfiguraci s minimální energetickou
# náročností vazeb - to se projevuje v pevnosti (a křehkosti kovu)
# annealing si půjčuje myšlenku, že postupným zkracováním
# vzdálenosti pátrače od dosud nejlepšího lokálního minima se
# velmi často dosáhne globálního minima, nebo alespoň minima,
# které je mu blízké.