optimization

Alternative optimization algorithms for lmer

喜欢而已 提交于 2021-02-08 06:17:19
问题 The function lmer in the lme4 package uses by default bobyqa from the minqa package as optimization algorithm. According to the following post https://stat.ethz.ch/pipermail/r-sig-mixed-models/2013q1/020075.html, it is possible to use also the other optimization algorirthms in the minqa package How can one use uobyqa or newuoa as optimization algorithm for lmer ? library(lme4) fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy, control=lmerControl(optimizer="bobyqa")) 回答1: You can't

Alternative optimization algorithms for lmer

狂风中的少年 提交于 2021-02-08 06:17:14
问题 The function lmer in the lme4 package uses by default bobyqa from the minqa package as optimization algorithm. According to the following post https://stat.ethz.ch/pipermail/r-sig-mixed-models/2013q1/020075.html, it is possible to use also the other optimization algorirthms in the minqa package How can one use uobyqa or newuoa as optimization algorithm for lmer ? library(lme4) fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy, control=lmerControl(optimizer="bobyqa")) 回答1: You can't

LP: postive reduced costs corresponding to positive variables?

谁说我不能喝 提交于 2021-02-08 06:16:38
问题 I have the next LP problem Maximize 1000 x1 + 500 x2 - 500 x5 - 250 x6 Subject To c1: x1 + x2 - x3 - x4 = 0 c2: - x3 + x5 = 0 c3: - x4 + x6 = 0 With these Bounds 0 <= x1 <= 10 0 <= x2 <= 15 0 <= x5 <= 15 0 <= x6 <= 5 By solving this problem with Cplex dual algorithm I get an optimal solution of 6250. But checking the reduced costs of the variables I get the next results Variable value reduced cost 1 10.0 500.0 1 0.0 -0.0 2 5.0 -0.0 3 5.0 -0.0 4 5.0 -0.0 5 5.0 250.0 Is it possible to have a

LP: postive reduced costs corresponding to positive variables?

心不动则不痛 提交于 2021-02-08 06:16:26
问题 I have the next LP problem Maximize 1000 x1 + 500 x2 - 500 x5 - 250 x6 Subject To c1: x1 + x2 - x3 - x4 = 0 c2: - x3 + x5 = 0 c3: - x4 + x6 = 0 With these Bounds 0 <= x1 <= 10 0 <= x2 <= 15 0 <= x5 <= 15 0 <= x6 <= 5 By solving this problem with Cplex dual algorithm I get an optimal solution of 6250. But checking the reduced costs of the variables I get the next results Variable value reduced cost 1 10.0 500.0 1 0.0 -0.0 2 5.0 -0.0 3 5.0 -0.0 4 5.0 -0.0 5 5.0 250.0 Is it possible to have a

Hill climbing problem requiring Dynamic programming

人走茶凉 提交于 2021-02-08 05:44:22
问题 So, basically the problem is that there is a series of hill points. we can only move from one hill point to the next greater hill point. Please see the below image to get an idea. On above image black points are hill tops, each hill top has some spices with some taste value. we can move from one hill top to another tasting spices in them. Please See below image to know valid movements. green lines gives valid movements . So, Now we will be given a query with 2 integers b,c and for each query

How to search a string for multiple substrings

笑着哭i 提交于 2021-02-08 05:24:13
问题 I need to check a short string for matches with a list of substrings. Currently, I do this like shown below (working code on ideone) bool ContainsMyWords(const std::wstring& input) { if (std::wstring::npos != input.find(L"white")) return true; if (std::wstring::npos != input.find(L"black")) return true; if (std::wstring::npos != input.find(L"green")) return true; // ... return false; } int main() { std::wstring input1 = L"any text goes here"; std::wstring input2 = L"any text goes here black";

How to convince Lisp SBCL to do inline fixnum arithmetic?

為{幸葍}努か 提交于 2021-02-08 05:02:03
问题 I've found some techniques in other SO answers, but apparently I've been unable to convince SBCL to do inline fixnum arithmetic: (declaim (optimize (speed 2) (safety 1))) (declaim (ftype (function (fixnum fixnum) double-float) fixnumtest) (inline fixnumtest)) (defun fixnumtest (i j) (declare (type fixnum i j)) (let* ((n (the fixnum (+ i j))) (n+1 (the fixnum (1+ n)))) (declare (type fixnum n n+1)) (/ 1.0d0 (the fixnum (* n n+1)) ) ) ) (defun main () (format t "~11,9F~%" (fixnumtest 2 3)) )

How to convince Lisp SBCL to do inline fixnum arithmetic?

℡╲_俬逩灬. 提交于 2021-02-08 05:01:36
问题 I've found some techniques in other SO answers, but apparently I've been unable to convince SBCL to do inline fixnum arithmetic: (declaim (optimize (speed 2) (safety 1))) (declaim (ftype (function (fixnum fixnum) double-float) fixnumtest) (inline fixnumtest)) (defun fixnumtest (i j) (declare (type fixnum i j)) (let* ((n (the fixnum (+ i j))) (n+1 (the fixnum (1+ n)))) (declare (type fixnum n n+1)) (/ 1.0d0 (the fixnum (* n n+1)) ) ) ) (defun main () (format t "~11,9F~%" (fixnumtest 2 3)) )

Iterate over different columns using withcolumn in Java Spark

最后都变了- 提交于 2021-02-08 04:10:47
问题 I have to modify a Dataset<Row> according to some rules that are in a List<Row> . I want to iterate over the Datset<Row> columns using Dataset.withColumn(...) as seen in the next example: (import necesary libraries...) SparkSession spark = SparkSession .builder() .appName("appname") .config("spark.some.config.option", "some-value") .getOrCreate(); Dataset<Row> dfToModify = spark.read().table("TableToModify"); List<Row> ListListWithInfo = new ArrayList<>(Arrays.asList()); ListWithInfo.add(0

Python Optimization using gekko

回眸只為那壹抹淺笑 提交于 2021-02-08 04:10:07
问题 I'm using gekko for the first time to do optimization with python. I don't have a lot of experience with python, but I know the basics. I get error code -13 when I run the optimization: #import Gekko optimization package from gekko import gekko import math #create gekko model m = gekko() #constants pi = math.pi #initialize needed variables frictionLoss = m.Var() empirical = m.Var(value=1) widthInlet = m.Var(value=1) #in meters heightInlet = m.Var(value=1) #in meters diameterOutlet = m.Var