This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 | |
H 1.01361 -0.43872 0.05166 | |
H -0.37629 -0.59645 0.04850 | |
H 1.62350 -1.33635 0.06931 | |
H -0.80859 -1.59316 0.06357 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 | |
H -0.65849 1.79875 0.00662 | |
H 0.73147 1.95418 0.00966 | |
H -1.29266 2.67914 -0.01097 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 | |
H 2.96821 1.08475 0.03403 | |
H 3.24493 2.05794 0.01754 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 | |
Energy: -11.4541449 | |
C -1.20080 0.52014 0.02618 | |
C -0.65849 1.79875 0.00662 | |
C 0.73147 1.95418 0.00966 | |
C 1.58002 0.83735 0.03236 | |
C 1.01361 -0.43872 0.05166 | |
C -0.37629 -0.59645 0.04850 | |
C 3.99063 0.15254 0.05602 | |
C 5.34795 0.81013 0.04860 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Calculate 95% confidence interval for rapported MAE. | |
The data is assumed to follow a laplacian distribution. | |
See https://waset.org/publications/8809/confidence-intervals-for-double-exponential-distribution-a-simulation-approach | |
for derivation. | |
""" | |
import numpy as np | |
import scipy.stats as ss |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def jread(filename, atomnumber): | |
couplings = np.zeros((atomnumber, atomnumber), dtype=float) | |
with open(filename) as f: | |
skip = True | |
for line in f: | |
if "Total nuclear spin-spin coupling J (Hz):" in line: | |
skip = False | |
continue | |
elif "End of Minotr" in line: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from sklearn.linear_model import Lasso, LinearRegression | |
# Generate 100 samples of y = x**2 plus some small random error | |
n = 100 | |
x = np.random.random(100) | |
y = x**2 + 0.1*np.random.random(n) | |
# Create [x,x**2] as different features | |
f = np.asarray([x,x**2]).T | |
# Train a linear regression model as comparison |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
outer_cv = KFold(5, shuffle=True) | |
for train, test in outer_cv.split(range(n_datapoints)): | |
for n in [100, 300, 1000, 3000, 10000, 30000, 100000]: | |
# save file for osprey containing the indices of train[:n] | |
# save file with test indices to get test errors after finding best params with osprey |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import copy | |
K # shape (N,N) | |
# Create a list with all the indices of the submatrix | |
idx = np.arange(N-1) + 1 | |
for i in range(N): | |
# when i==0, idx will be [1,2,3,4...] | |
# when i==1, idx will become [0,2,3,4...] etc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from simtk import openmm, unit | |
from simtk.openmm import app | |
import numpy as np | |
import sys | |
# Create an integrator | |
timestep = 1.0 * unit.femtoseconds | |
integrator = openmm.VerletIntegrator(timestep) | |
# Open Amber files |