optimization

Why the parameter I am trying to estimate is “not found”?

青春壹個敷衍的年華 提交于 2019-12-25 08:56:35
问题 I am trying to optimise my likelihood function of R_j and R_m using optim to estimate al_j , au_j , b_j and sigma_j . This is what I did. a = read.table("D:/ff.txt",header=T) attach(a) a R_j R_m 1 2e-03 0.026567295 2 3e-03 0.009798475 3 5e-02 0.008497274 4 -1e-02 0.012464578 5 -9e-04 0.002896023 6 9e-02 0.000879473 7 1e-02 0.003194435 8 6e-04 0.010281122 The parameters al_j, au_j, b_j and sigma_j need to be estimated. llik=function(R_j,R_m) if(R_j< 0) { sum[log(1/(2*pi*(sigma_j^2)))-(1/(2*

Scipy optimizations methods select nan for input parameter

﹥>﹥吖頭↗ 提交于 2019-12-25 08:47:01
问题 I've a mathematical function by 4 parameters input. Also there are bounds in parameters: a = [0,2] b = [-1,1] c = [eps, inf] d = [-inf, inf] I want to minimize the final value and find best parameter in function. In Scipy there are just 3 functions to support bounding optimization problems as 'TNC', 'SLSQP' and 'L-BFGS-B' [refrence: optimizations]. The problem is when SLSQP and sometimes other methods select nan for parameters and thus, result of function goes to nan for value. It's happend

MySQL poor performance in Centos 7

给你一囗甜甜゛ 提交于 2019-12-25 08:35:33
问题 I run a very simple MySQL database construct. I only have like id, TimeStamp and OP_fs155e columns which I consider is extremely basic setup. MariaDB [gadbdfm]> desc optical_power; +-----------+------------------+------+-----+----------------------+-----------------------------+ | Field | Type | Null | Key | Default | Extra | +-----------+------------------+------+-----+----------------------+-----------------------------+ | id_record | int(10) unsigned | NO | PRI | NULL | auto_increment | |

Distance between two points

倖福魔咒の 提交于 2019-12-25 08:06:58
问题 Is there any difference between: distance = point1.subtract(point2).length; and distance = Point.distance(point1, point2); 回答1: Since this question is tagged Optimization, the longhand for the pythagorean theorem will be the most efficient way to find the distance between two points in AS3, provided that you don't: Instantiate an object while doing it Call any more Math functions than necessary (manually do an Abs, for example) Don't actually call any functions if you can help it Almost all

MLE error in R: non-finite finite-difference value/ value in 'vmmin' is not finite

醉酒当歌 提交于 2019-12-25 07:59:16
问题 I am working on a loss aversion model in R (beginner) and want to estimate some parameters, from a dataset with 3 columns (loss/gain values (both continous and a column with decisions coded as 0 or 1 (binary)) dropbox.com/s/fpw3obrqcx8ld1q/GrandAverage.RData?dl=0 The part of the code if have to use for this I am using is given below: set <- GrandAverage[, 5:7]; Beh.Parameters <- function (lambda, alpha, temp) { u = 0.5 * set$Gain^alpha + 0.5 * lambda * set$Loss^alpha GambleProbability <- 1 /

MySQL query - weight-based search engine

给你一囗甜甜゛ 提交于 2019-12-25 07:52:27
问题 Here is the database structure for a medical MIS table: CREATE TABLE IF NOT EXISTS `ab_med` ( `med_id` bigint(20) NOT NULL AUTO_INCREMENT, `med_title` varchar(200) DEFAULT NULL, `med_posted_date` varchar(200) DEFAULT NULL, `med_company_name` varchar(200) DEFAULT NULL, `med_experience` varchar(200) DEFAULT NULL, `med_salary` varchar(200) DEFAULT NULL, `med_city` varchar(200) DEFAULT NULL, `med_description_short` text, `med_details_link` varchar(500) DEFAULT NULL, `med_from_city_type` int(1)

Extensions for Computationally-Intensive Cypher queries

纵然是瞬间 提交于 2019-12-25 07:31:16
问题 As a follow up to a previous question of mine, I want to find all 30 pathways that exist between two given nodes within a depth of 4. Something to the effect of this: start startnode = node(1), endnode(1000) match startnode-[r:rel_Type*1..4]->endnode return r limit 30; My database contains ~50k nodes and 2M relationships. Expectedly, the computation time for this query is very, very large; I even ended up with the following GC message in the message.log file: GC Monitor: Application threads

Getting an error “could not broadcast input array from shape (252,4) into shape (4)” in optimization

試著忘記壹切 提交于 2019-12-25 07:16:58
问题 I a relatively new to python scipy library. I was trying to use the scipy.optimize to find the maximum value of the sharpe() function in the following code def sharpe(dr, wts): portfolio=np.ones(dr.shape[0]) dr[0:]=wts*dr[0:] sharpe_ratio=-np.mean(np.sum(dr, axis=1))/np.std(np.sum(dr, axis=1)) return sharpe_ratio def wts_con(wts): return wts[0]+wts[1]+wts[2]+wts[3]-1 def sharpe_optimize(dr, sharpe_func): wts_guess=np.array([0.25,0.25,0.25,0.25]) con=[{"type":"eq", "fun":wts_con}] bnds=((0,1),

Getting an error “could not broadcast input array from shape (252,4) into shape (4)” in optimization

不想你离开。 提交于 2019-12-25 07:16:07
问题 I a relatively new to python scipy library. I was trying to use the scipy.optimize to find the maximum value of the sharpe() function in the following code def sharpe(dr, wts): portfolio=np.ones(dr.shape[0]) dr[0:]=wts*dr[0:] sharpe_ratio=-np.mean(np.sum(dr, axis=1))/np.std(np.sum(dr, axis=1)) return sharpe_ratio def wts_con(wts): return wts[0]+wts[1]+wts[2]+wts[3]-1 def sharpe_optimize(dr, sharpe_func): wts_guess=np.array([0.25,0.25,0.25,0.25]) con=[{"type":"eq", "fun":wts_con}] bnds=((0,1),

R stockPortfolio Package not connecting to Yahoo

*爱你&永不变心* 提交于 2019-12-25 07:04:10
问题 I am trying to replicate this example as I am new to portfolio optimization through R: http://economistatlarge.com/portfolio-theory/r-optimized-portfolio However, I keep getting the following error: R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or