- Home
- Tag: optimization
Posts tagged optimization
Tag: optimization
Non-linear Optimization of Nelson-Siegel model using nloptr R package
Feed: R-bloggers. Author: sang-heon lee. #========================================================## Quantitative ALM, Financial Econometrics & Derivatives # ML/DL using R, Python, Tensorflow by Sang-Heon Lee ## https://kiandlee.blogspot.com#——————————————————–## Nelson-Siegel using nloptr function#========================================================#graphics.off(); rm(list = ls())library(nloptr)#———————————————–# objective function#———————————————– objfunc – function(para, y, m) { beta – para[1:3]; la – para[4] C – cbind( rep(1,length(m)), (1–exp(–la*m))/(la*m), (1–exp(–la*m))/(la*m)–exp(–la*m)) return(sqrt(mean((y – C%*%beta)^2))) }#———————————————–# constraint function ( #———————————————– # beta0 + beta1 > 0 constfunc – function(para, y, m) { beta – para[1:3] lhs – –beta[1]–beta[2] return(lhs) }#=======================================================# 1. Read data#======================================================= # b1, b2, b3, lambda, rmse for comparisons ns_reg_para_rmse1 – c( 4.26219396, –4.08609206, –4.90893865, 0.02722607, 0.04883786) ns_reg_para_rmse2 – c( 4.97628654, –4.75365297, –6.40263059, 0.05046789, 0.04157326) str.zero – “ mat rate1 rate2 3 0.0781 0.0591 6 0.1192 0.0931 9 0.1579 0.1270 12 0.1893 0.1654 24 0.2669 0.3919 36 0.3831 0.8192 48 0.5489 1.3242 60 0.7371 1.7623 72 0.9523 2.1495 84 1.1936 2.4994 96 1.4275 2.7740 108 1.6424 2.9798 120 1.8326 3.1662 144 2.1715 3.4829 180 2.5489 3.7827 240 2.8093 3.9696″ df – read.table(text = str.zero, header=TRUE) m – df$mat y1 – df$rate1; y2 – df$rate2#=======================================================# 2. Nonlinear least squares with constraints#======================================================= # Set optimization options. opts – list(“algorithm” = “NLOPT_GN_ISRES”, “xtol_rel” = 1.0e–16, “maxeval” = 500000, “print_level” = 1 ) #——————————————— # NS estimation with 1st data #——————————————— y – y1 x_init – c(y[16], y[1]–y[16], 2*y[6]–y[1]–y[16], 0.0609) m_nloptr – nloptr( x0 = x_init, y = y, m = m, eval_f = objfunc, eval_g_ineq = constfunc, # beta0 > 0, 0.01 lb = c( 0,–30,–30, 0.001), ub = c(30, 30, 30, 0.1), opts = opts ) ns_nloptr_out1 – c(m_nloptr$solution, m_nloptr$objective) #——————————————— # NS estimation with 2nd data #——————————————— y – y2 x_init – c(y[16], y[1]–y[16], 2*y[6]–y[1]–y[16], 0.0609) m_nloptr – nloptr( x0 = x_init, y = y, m = m, eval_f = objfunc, eval_g_ineq = constfunc, # beta0 > 0, 0.01 lb = c( 0,–30,–30, 0.001), ub = c(30, 30, 30, 0.1), opts = opts ) ns_nloptr_out2 – c(m_nloptr$solution, m_nloptr$objective)#=======================================================# 3. Results and Comparisons#======================================================= ns_reg_para_rmse1 ns_nloptr_out1 ns_reg_para_rmse2 ns_nloptr_out2 ... Read More
David Christensen: Postgres Query Optimization: LEFT JOIN vs UNION ALL
Feed: Planet PostgreSQL. IntroductionThe PostgreSQL optimizer is an amazing thing, getting only more amazing with each release. It is able to take information about your data definitions, your data distribution, constraints, and the specific queries and come up with the generally most efficient way to return the results of that query. Since SQL is a declarative language, we're explicitly giving up defining how the database determines the results and trusting it to get the correct results in whatever method it deems most efficient. Sometimes we can structure queries in a certain way to get a better result than we get ... Read More
Least-squares optimization and the Gauss-Newton method

Feed: SAS Blogs. Author: Rick Wicklin.
A previous article showed how to use SAS to compute finite-difference derivatives of smooth vector-valued multivariate functions. The article uses the NLPFDD subroutine in SAS/IML to compute the finite-difference derivatives. The article
states that the third output argument of the NLPFDD subroutine "contains the matrix product J`*J, where J is the Jacobian matrix. This product is used in some numerical methods, such as the Gauss-Newton algorithm, to minimize the value of a vector-valued function."
This article expands on that statement and shows that you can use the SAS/IML matrix language to implement ... Read More
MySQL Query Optimization: Top 3 Tips
Feed: Planet MySQL; Author: Oracle MySQL Group; MySQL Query Optimization is usually simple engineering. But seeking information about how to tune queries is treated on many web reference sites like some Harry Potter-ish spell casting. There are simple tips you need to be aware of to get the best of your queries ... Read More
Nikolay Samokhvalov: EXPLAIN (ANALYZE) needs BUFFERS to improve the Postgres query optimization process
Feed: Planet PostgreSQL. Jupiter's moon Io. Credit: ALMA (ESO/NAOJ/NRAO), I. de Pater et al.; NRAO/AUI NSF, S. Dagnello; NASA/JPL/Space Science InstituteSQL query optimization is challenging for those who have just started working with PostgreSQL. There are many objective reasons for this, such as:the difficulty of the field of system performance in general,lack of good "playground" environments where people can experience how databases work at a larger scale,lack of certain capabilities in Postgres observability tools that are still developing (though, at a good pace),insufficiency of good educational materials.All these barriers are reasonable. They limit the number of engineers possessing well-developed Postgres ... Read More
AWS Trusted Advisor adds three optimization checks for Microsoft SQL Server on Amazon EC2
Feed: Recent Announcements. AWS Trusted Advisor now supports new recommendations that help you simplify your SQL Server optimization on Amazon EC2. The checks inspect your SQL Server workloads and automatically lists your SQL Server instances that need optimization. You can then take recommended actions to reduce costs and improve security. You can find the details of the three checks below. 1. Amazon EC2 Instances with Microsoft SQL Server End of Support - Checks the SQL Server versions for Amazon EC2 instances and alerts you if the versions are near or have reached the end of support. For example, SQL Server ... Read More
20. How to Use Data Science for Search Engine Optimization
Feed: Top Blog Posts. Author: Saajan Sharma. Data science is one of the hottest topics in the market nowadays. It is one of those industries that has revolutionized the world. It associates two chief technologies, big data and artificial intelligence, and utilizes them to examine and process datasets. It also uses machine learning, which helps to strengthen artificial intelligence. Data science has thoroughly improved and modernized every industry it has touched, including marketing, finance, social media, SEO, etc. If you wish to excel in your profession, there is a high chance you will have to use data science with python. Data ... Read More
17. How to Use Data Science for Search Engine Optimization
Feed: Top Blog Posts. Author: Saajan Sharma. Data science is one of the hottest topics in the market nowadays. It is one of those industries that has revolutionized the world. It associates two chief technologies, big data and artificial intelligence, and utilizes them to examine and process datasets. It also uses machine learning, which helps to strengthen artificial intelligence. Data science has thoroughly improved and modernized every industry it has touched, including marketing, finance, social media, SEO, etc. If you wish to excel in your profession, there is a high chance you will have to use data science with python. Data ... Read More
19. How to Use Data Science for Search Engine Optimization
Feed: Top Blog Posts. Author: Saajan Sharma. Data science is one of the hottest topics in the market nowadays. It is one of those industries that has revolutionized the world. It associates two chief technologies, big data and artificial intelligence, and utilizes them to examine and process datasets. It also uses machine learning, which helps to strengthen artificial intelligence. Data science has thoroughly improved and modernized every industry it has touched, including marketing, finance, social media, SEO, etc. If you wish to excel in your profession, there is a high chance you will have to use data science with python. Data ... Read More
AWS Lake Formation support Governed Tables, storage optimization and row-level security
Feed: Recent Announcements. AWS Lake Formation is excited to announce the general availability of three new capabilities that simplify building, securing, and managing data lakes. First, Lake Formation Governed Tables, a new type of table on Amazon S3, that simplifies building resilient data pipelines with multi-table transaction support. As data is added or changed, Lake Formation automatically manages conflicts and errors to ensure that all users see a consistent view of the data. This eliminates the need for customers to create custom error handling code or batch their updates. Second, Governed Tables monitor and automatically optimize how data is stored so ... Read More
Recent Comments