# Path: celerite/terms.py
# @property
# def terms(self):
#     """A list of all the terms included in a sum of terms"""
#     return [self]


import os
import sys
import argparse
import numpy as np
        import george
from scipy.linalg import cho_factor, cho_solve
from celerite import terms
from celerite.timer import benchmark
from celerite.solver import CholeskySolver
        from george.kernels import CeleriteKernel
    fn += "_george"
elif args.carma:
    fn += "_carma"

fn += ".csv"
fn = os.path.join(args.outdir, fn)
print("filename: {0}".format(fn))
with open(fn, "w") as f:
    f.write(header)
print(header, end="")

# Simulate a "dataset"
np.random.seed(42)
t = np.sort(np.random.rand(np.max(N)))
yerr = np.random.uniform(0.1, 0.2, len(t))
y = np.sin(t)

def numpy_compute(kernel, x, yerr):
    K = kernel.get_value(x[:, None] - x[None, :])
    K[np.diag_indices_from(K)] += yerr ** 2
    return cho_factor(K)

def numpy_log_like(factor, y):
    np.dot(y, cho_solve(factor, y)) + np.sum(np.log(np.diag(factor[0])))

for xi, j in enumerate(J):
    kernel = terms.RealTerm(1.0, 0.1)
    for k in range((2*j - 1) % 2):
        kernel += terms.RealTerm(1.0, 0.1)
    for k in range((2*j - 1) // 2):

# Path: celerite/terms.py
# @property
# def terms(self):
#     """A list of all the terms included in a sum of terms"""
#     return [self]


# Path: examples/benchmark/run.py
import os
import sys
import argparse
import numpy as np
        import george
from scipy.linalg import cho_factor, cho_solve
from celerite import terms
from celerite.timer import benchmark
from celerite.solver import CholeskySolver
        from george.kernels import CeleriteKernel

    fn += "_george"
elif args.carma:
    fn += "_carma"

fn += ".csv"
fn = os.path.join(args.outdir, fn)
print("filename: {0}".format(fn))
with open(fn, "w") as f:
    f.write(header)
print(header, end="")

# Simulate a "dataset"
np.random.seed(42)
t = np.sort(np.random.rand(np.max(N)))
yerr = np.random.uniform(0.1, 0.2, len(t))
y = np.sin(t)

def numpy_compute(kernel, x, yerr):
    K = kernel.get_value(x[:, None] - x[None, :])
    K[np.diag_indices_from(K)] += yerr ** 2
    return cho_factor(K)

def numpy_log_like(factor, y):
    np.dot(y, cho_solve(factor, y)) + np.sum(np.log(np.diag(factor[0])))

for xi, j in enumerate(J):
    kernel = terms.RealTerm(1.0, 0.1)
    for k in range((2*j - 1) % 2):
        kernel += terms.RealTerm(1.0, 0.1)
    for k in range((2*j - 1) // 2):

        kernel += terms.ComplexTerm(0.1, 2.0, 1.6)