Category "optimization"

efficient frontier/stock analyze

Consider the following task. Using a 10-year period I should calculate the portfolio weights in January and then use these weights in February to calculate the

Import error: 'SimpleExperiment' while running BOTORCH example code

I am trying to work with Bayesian Optimisation for my Numerical model run, Optimising its parameters. For this I am using BoTorch. Its example code is given as

How to have a single csv file after applying partitionBy in Pysark

I have to first partition by a "customer group" but I also want to make sure that I have a single csv file per "customer_group" . This is because it is timeseri

Distibuted Computing in Julia Slower than Serial

I have a julia function that seems very amenable to optimization. Each iteration only manipulates the stuff in its particular index. Yet this function, when imp

Inline index addition in gams

I want to use an index equation to iterate over a tensors, whereas I always want to extract the value at index i and index i+1. An example: Variable x; x.up = 1

How to minimize and then maxmize one function sequentially with DOcplex in python?

I want to solve a problem like this: maxy∈Y{minx∈X(y) cTx} which is to firstly minimize cTx with x in X(y), and we get the result with y still uncer

Fastest way to count event occurences in a Pandas dataframe?

I have a Pandas dataframe with ~100,000,000 rows and 3 columns (Names str, Time int, and Values float), which I compiled from ~500 CSV files using glob.glob(pat

Loading large files into memory with Python

When doing work with large files and datasets (usually 1 or 2 gb+), the process is killed do to running out of RAM. What tools and methods are available to allo

PostgreSQL first query slow

I implemented cursor pagination. And for first rows it works realy well but the more I scroll down, the first query I send is slower. I run this query: SELECT *

Why docplex optimization gives no answer

I am working on an optimizatiom model which is set to maximize NPV. I am getting some results, however my cap_ele should represent the max value in the el_to_el

ARIMA model won't work: error in optim function

hopefully someone can help me out. I want to do an autoregressive regression on some monthly logreturns (60 observations). I found that only lag 1,3,11,18 are s

Should I put the base image in all project's images?

Ok, my question is all about Am I doing it right? if not, what's the best practice? Recently I've used Docker for my project. Currently, I build a new docker

Reasonable neighbours for a bees algorithm on a not-complete digraph

I am trying to solve an optimization problem for a graph, where basically there is a cost for transporting "package" over a single edge, and I have multiple sou

Convert a set of overlapping cuiboids to a minumum set of non-overlapping cuiboids

I am trying to decompose an overlapping set of cuboids to non-overlapping ones, the fewer non-overlapping cuboids used the better. For example, in the case belo

List in Python help needed: how to Avoid calling repetitive code

I have a function shown below: def _extract_parent(matched_list, json_data, info_type): return [json_data[match_lst][info_type] for match_lst in matched_lis

How to find minimum number of NAND gates for a given Boolean Expression by Using Genetic Alogorith(How to write a Code )

I have been trying to write a code using gentic algorithm to find minimum number of NAND gates,but i have no idea of how to take a chromosome or case to find na

Longest increasing subsequence with minimum sum

I know there is a longest increasing subsequence algorithm that runs in O(nlogn) (https://www.geeksforgeeks.org/longest-monotonically-increasing-subsequence-siz

Emulating Polymorphism without virtual pointers/overhead

Before reading I must emphasise I have demanding performance requirements (not premature optimization- processing millions of messages and need to design with p

do two instances from the same Spark Streaming can be in conflict?

I want to run the same Java Spark Streaming (10 seconds micro batch) through 2 instances (sparkStr1 and sparkStr2). Mainly, they consume the same kafka topic (3

Most insanely fastest way to convert 9 char digits into an int or unsigned int

#include <stdio.h> #include <iostream> #include <string> #include <chrono> #include <memory> #include <cstdlib> #include <