List of usage examples for java.lang Double MIN_VALUE
double MIN_VALUE
To view the source code for java.lang Double MIN_VALUE.
Click Source Link
From source file:com.diversityarrays.kdxplore.curate.TraitsAndInstancesPanel2.java
private OutlierSelection createOutlierSelection(SimpleStatistics<?> stats, TraitInstance ti) { Bag<?> lowOutliers = stats.getLowOutliers(); Bag<?> highOutliers = stats.getHighOutliers(); Double maxMin = Double.MAX_VALUE; Double maxMax = 0.0;/*from ww w . j av a 2 s . c om*/ Comparable<?> max = stats.getMaxValue(); int count = 0; for (Object o : highOutliers) { String val = String.valueOf(o); try { Double inter = Double.parseDouble(val); if (inter < maxMin) { maxMin = inter; } if (count == 0) { maxMax = Double.parseDouble(String.valueOf(max)); } count++; } catch (NumberFormatException e) { e.printStackTrace(); } } Double minMin = 0.0; Double minMax = Double.MIN_VALUE; Comparable<?> min = stats.getMinValue(); count = 0; for (Object o : lowOutliers) { String val = String.valueOf(o); try { Double inter = Double.parseDouble(val); if (inter > minMax) { minMax = inter; } if (count == 0) { minMin = Double.parseDouble(String.valueOf(min)); } count++; } catch (NumberFormatException e) { e.printStackTrace(); } } OutlierSelection selection = new OutlierSelection(minMin, minMax, maxMin, maxMax, ti); return selection; }
From source file:org.apache.hadoop.hive.ql.stats.StatsUtils.java
private static Range getRangePartitionColumn(Set<Partition> partitions, String partColName, String colType, String defaultPartName) { Range range = null;//w w w . j a va 2 s .com String partVal; if (colType.equalsIgnoreCase(serdeConstants.TINYINT_TYPE_NAME) || colType.equalsIgnoreCase(serdeConstants.SMALLINT_TYPE_NAME) || colType.equalsIgnoreCase(serdeConstants.INT_TYPE_NAME) || colType.equalsIgnoreCase(serdeConstants.BIGINT_TYPE_NAME)) { long min = Long.MAX_VALUE; long max = Long.MIN_VALUE; for (Partition partition : partitions) { partVal = partition.getSpec().get(partColName); if (partVal.equals(defaultPartName)) { // partition column value is null. continue; } else { long value = Long.parseLong(partVal); min = Math.min(min, value); max = Math.max(max, value); } } range = new Range(min, max); } else if (colType.equalsIgnoreCase(serdeConstants.FLOAT_TYPE_NAME) || colType.equalsIgnoreCase(serdeConstants.DOUBLE_TYPE_NAME)) { double min = Double.MAX_VALUE; double max = Double.MIN_VALUE; for (Partition partition : partitions) { partVal = partition.getSpec().get(partColName); if (partVal.equals(defaultPartName)) { // partition column value is null. continue; } else { double value = Double.parseDouble(partVal); min = Math.min(min, value); max = Math.max(max, value); } } range = new Range(min, max); } else if (colType.startsWith(serdeConstants.DECIMAL_TYPE_NAME)) { double min = Double.MAX_VALUE; double max = Double.MIN_VALUE; for (Partition partition : partitions) { partVal = partition.getSpec().get(partColName); if (partVal.equals(defaultPartName)) { // partition column value is null. continue; } else { double value = new BigDecimal(partVal).doubleValue(); min = Math.min(min, value); max = Math.max(max, value); } } range = new Range(min, max); } else { // Columns statistics for complex datatypes are not supported yet return null; } return range; }
From source file:org.voltdb.regressionsuites.RegressionSuite.java
static protected void validateTableColumnOfScalarFloat(VoltTable vt, int col, double[] expected) { assertNotNull(expected);/* www .j a va 2s .c o m*/ assertEquals(expected.length, vt.getRowCount()); int len = expected.length; for (int i = 0; i < len; i++) { assertTrue(vt.advanceRow()); double actual = vt.getDouble(col); if (expected[i] == Double.MIN_VALUE) { assertTrue(vt.wasNull()); assertEquals(null, actual); } else { assertEquals(expected[i], actual, 0.00001); } } }
From source file:org.fhcrc.cpl.viewer.align.Aligner.java
protected PanelWithChart createChart(Pair<Double, Double>[] allPairedScans, Pair<Double, Double>[] restrictedPairs, double[] warpedValues) { PanelWithScatterPlot pwsp = new PanelWithScatterPlot(); double[] restrictedScans1 = new double[restrictedPairs.length]; double[] restrictedScans2 = new double[restrictedPairs.length]; for (int i = 0; i < restrictedScans1.length; i++) { restrictedScans1[i] = restrictedPairs[i].first; restrictedScans2[i] = restrictedPairs[i].second; }/*from w w w . j a v a2 s.c o m*/ pwsp.addData(restrictedScans1, restrictedScans2, "Used in regression"); double[] scans1 = new double[allPairedScans.length]; double[] scans2 = new double[allPairedScans.length]; double minScan1 = Double.MAX_VALUE; double maxScan1 = Double.MIN_VALUE; for (int i = 0; i < scans1.length; i++) { scans1[i] = allPairedScans[i].first; scans2[i] = allPairedScans[i].second; if (scans1[i] < minScan1) minScan1 = scans1[i]; if (scans1[i] > maxScan1) maxScan1 = scans1[i]; } pwsp.addData(scans1, scans2, "all"); int firstBaseVal = Math.max((int) minScan1 - 100, 0); int lastBaseVal = Math.min((int) maxScan1 + 100, warpedValues.length - 1); double[] plottedWarpedValues = new double[lastBaseVal - firstBaseVal + 1]; System.arraycopy(warpedValues, firstBaseVal, plottedWarpedValues, 0, plottedWarpedValues.length); double[] unwarpedValues = new double[plottedWarpedValues.length]; for (int i = 0; i < plottedWarpedValues.length; i++) unwarpedValues[i] = i + firstBaseVal; pwsp.addData(unwarpedValues, plottedWarpedValues, "alignment map"); pwsp.setAxisLabels("Time in run 1", "Time in run 2"); alignmentChart = pwsp; return pwsp; }
From source file:com.smartitengineering.cms.api.impl.content.ContentLoaderImpl.java
public FieldValue getSimpleValueFor(String value, FieldValueType type) { final FieldValue result; switch (type) { case BOOLEAN: logger.debug("Getting as boolean"); MutableBooleanFieldValue booleanFieldValue = createBooleanFieldValue(); result = booleanFieldValue;/*from w w w . j ava 2 s . co m*/ booleanFieldValue.setValue(Boolean.parseBoolean(value)); break; case CONTENT: logger.debug("Getting as content"); MutableContentFieldValue contentFieldValue = createContentFieldValue(); if (logger.isDebugEnabled()) { logger.debug("Content value: " + value); } try { DataInputStream inputStream = new DataInputStream( new ByteArrayInputStream(StringUtils.getBytesUtf8(value))); ContentIdImpl idImpl = new ContentIdImpl(); idImpl.readExternal(inputStream); contentFieldValue.setValue(idImpl); } catch (Exception ex) { throw new RuntimeException(ex); } result = contentFieldValue; break; case INTEGER: logger.debug("Getting as integer"); MutableNumberFieldValue integerFieldValue = createIntegerFieldValue(); integerFieldValue.setValue(NumberUtils.toInt(value, Integer.MIN_VALUE)); result = integerFieldValue; break; case DOUBLE: logger.debug("Getting as double"); MutableNumberFieldValue doubleFieldValue = createDoubleFieldValue(); doubleFieldValue.setValue(NumberUtils.toDouble(value, Double.MIN_VALUE)); result = doubleFieldValue; break; case LONG: logger.debug("Getting as long"); MutableNumberFieldValue longFieldValue = createLongFieldValue(); longFieldValue.setValue(NumberUtils.toLong(value, Long.MIN_VALUE)); result = longFieldValue; break; case DATE_TIME: logger.debug("Getting as date time"); MutableDateTimeFieldValue valueOf; try { valueOf = DateTimeFieldValueImpl.valueOf(value); } catch (Exception ex) { throw new RuntimeException(ex); } result = valueOf; break; case OTHER: logger.debug("Getting as other"); MutableOtherFieldValue otherFieldValue = createOtherFieldValue(); otherFieldValue.setValue(Base64.decodeBase64(value)); result = otherFieldValue; break; case STRING: default: logger.debug("Getting as else or string"); MutableStringFieldValue fieldValue = createStringFieldValue(); fieldValue.setValue(value); result = fieldValue; } return result; }
From source file:com.nridge.core.base.field.Field.java
/** * Returns a <i>double</i> representation of the field * value string.//from ww w. j ava2 s. c o m * * @param aValue Numeric string value. * * @return Converted value. */ public static double createDouble(String aValue) { if (StringUtils.isNotEmpty(aValue)) return Double.parseDouble(aValue); else return Double.MIN_VALUE; }
From source file:com.opengamma.maths.lowlevelapi.linearalgebra.blas.BLAS1.java
/** * IDMAX: amax <-- 1st k where |Re{x_k}| == max(Re{x_i}) * Finds the index of the first value that equals the absolute maximum. * @param x a vector/*from ww w . j a va 2 s . c o m*/ * @return idx the first index at which the maximum value occurs */ public static int idmax(double[] x) { Validate.notNull(x); double max = Double.MIN_VALUE; int idx = -1; final int n = x.length; for (int i = 0; i < n; i++) { if (x[i] > max) { max = x[i]; idx = i; } } return idx; }
From source file:com.nridge.core.base.field.Field.java
/** * Returns a <i>Double</i> representation of the field * value string.//from w ww. j ava 2 s .c o m * * @param aValue Numeric string value. * * @return Converted value. */ public static Double createDoubleObject(String aValue) { if (StringUtils.isNotEmpty(aValue)) return Double.valueOf(aValue); else return Double.MIN_VALUE; }
From source file:ca.uhn.hl7v2.testpanel.ui.editor.Hl7V2MessageEditorPanel.java
/** * Create the panel.// ww w. ja va 2 s . c o m */ public Hl7V2MessageEditorPanel(final Controller theController) { setBorder(null); myController = theController; ButtonGroup encGrp = new ButtonGroup(); setLayout(new BorderLayout(0, 0)); mysplitPane = new JSplitPane(); mysplitPane.setResizeWeight(0.5); mysplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT); add(mysplitPane); mysplitPane.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent theEvt) { double ratio = (double) mysplitPane.getDividerLocation() / mysplitPane.getHeight(); ourLog.debug("Resizing split to ratio: {}", ratio); Prefs.getInstance().setHl7EditorSplit(ratio); } }); EventQueue.invokeLater(new Runnable() { public void run() { mysplitPane.setDividerLocation(Prefs.getInstance().getHl7EditorSplit()); } }); messageEditorContainerPanel = new JPanel(); messageEditorContainerPanel.setBorder(null); mysplitPane.setRightComponent(messageEditorContainerPanel); messageEditorContainerPanel.setLayout(new BorderLayout(0, 0)); myMessageEditor = new JEditorPane(); Highlighter h = new UnderlineHighlighter(); myMessageEditor.setHighlighter(h); // myMessageEditor.setFont(Prefs.getHl7EditorFont()); myMessageEditor.setSelectedTextColor(Color.black); myMessageEditor.setCaret(new EditorCaret()); myMessageScrollPane = new JScrollPane(myMessageEditor); messageEditorContainerPanel.add(myMessageScrollPane); JToolBar toolBar = new JToolBar(); messageEditorContainerPanel.add(toolBar, BorderLayout.NORTH); toolBar.setFloatable(false); toolBar.setRollover(true); myFollowToggle = new JToggleButton("Follow"); myFollowToggle.setToolTipText("Keep the message tree (above) and the message editor (below) in sync"); myFollowToggle.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { theController.setMessageEditorInFollowMode(myFollowToggle.isSelected()); } }); myFollowToggle.setIcon(new ImageIcon( Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/updown.png"))); myFollowToggle.setSelected(theController.isMessageEditorInFollowMode()); toolBar.add(myFollowToggle); myhorizontalStrut = Box.createHorizontalStrut(20); toolBar.add(myhorizontalStrut); mylabel_4 = new JLabel("Encoding"); toolBar.add(mylabel_4); myRdbtnEr7 = new JRadioButton("ER7"); myRdbtnEr7.setMargin(new Insets(1, 2, 0, 1)); toolBar.add(myRdbtnEr7); myRdbtnXml = new JRadioButton("XML"); myRdbtnXml.setMargin(new Insets(1, 5, 0, 1)); toolBar.add(myRdbtnXml); encGrp.add(myRdbtnEr7); encGrp.add(myRdbtnXml); treeContainerPanel = new JPanel(); mysplitPane.setLeftComponent(treeContainerPanel); treeContainerPanel.setLayout(new BorderLayout(0, 0)); mySpinnerIconOn = new ImageIcon( Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/spinner.gif")); mySpinnerIconOff = new ImageIcon(); myTreePanel = new Hl7V2MessageTree(theController); myTreePanel.setWorkingListener(new IWorkingListener() { public void startedWorking() { mySpinner.setText(""); mySpinner.setIcon(mySpinnerIconOn); mySpinnerIconOn.setImageObserver(mySpinner); } public void finishedWorking(String theStatus) { mySpinner.setText(theStatus); mySpinner.setIcon(mySpinnerIconOff); mySpinnerIconOn.setImageObserver(null); } }); myTreeScrollPane = new JScrollPane(myTreePanel); myTopTabBar = new JTabbedPane(); treeContainerPanel.add(myTopTabBar); myTopTabBar.setBorder(null); JPanel treeContainer = new JPanel(); treeContainer.setLayout(new BorderLayout(0, 0)); treeContainer.add(myTreeScrollPane); myTopTabBar.add("Message Tree", treeContainer); mytoolBar_1 = new JToolBar(); mytoolBar_1.setFloatable(false); treeContainer.add(mytoolBar_1, BorderLayout.NORTH); mylabel_3 = new JLabel("Show"); mytoolBar_1.add(mylabel_3); myShowCombo = new JComboBox(); mytoolBar_1.add(myShowCombo); myShowCombo.setPreferredSize(new Dimension(130, 27)); myShowCombo.setMinimumSize(new Dimension(130, 27)); myShowCombo.setMaximumSize(new Dimension(130, 32767)); collapseAllButton = new JButton(); collapseAllButton.setBorderPainted(false); collapseAllButton.addMouseListener(new HoverButtonMouseAdapter(collapseAllButton)); collapseAllButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { myTreePanel.collapseAll(); } }); collapseAllButton.setToolTipText("Collapse All"); collapseAllButton.setIcon(new ImageIcon( Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/collapse_all.png"))); mytoolBar_1.add(collapseAllButton); expandAllButton = new JButton(); expandAllButton.setBorderPainted(false); expandAllButton.addMouseListener(new HoverButtonMouseAdapter(expandAllButton)); expandAllButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { myTreePanel.expandAll(); } }); expandAllButton.setToolTipText("Expand All"); expandAllButton.setIcon(new ImageIcon( Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/expand_all.png"))); mytoolBar_1.add(expandAllButton); myhorizontalGlue = Box.createHorizontalGlue(); mytoolBar_1.add(myhorizontalGlue); mySpinner = new JButton(""); mySpinner.setForeground(Color.DARK_GRAY); mySpinner.setHorizontalAlignment(SwingConstants.RIGHT); mySpinner.setMaximumSize(new Dimension(200, 15)); mySpinner.setPreferredSize(new Dimension(200, 15)); mySpinner.setMinimumSize(new Dimension(200, 15)); mySpinner.setBorderPainted(false); mySpinner.setSize(new Dimension(16, 16)); mytoolBar_1.add(mySpinner); myProfileComboboxModel = new ProfileComboModel(); myTablesComboModel = new TablesComboModel(myController); mytoolBar = new JToolBar(); mytoolBar.setFloatable(false); mytoolBar.setRollover(true); treeContainerPanel.add(mytoolBar, BorderLayout.NORTH); myOutboundInterfaceCombo = new JComboBox(); myOutboundInterfaceComboModel = new DefaultComboBoxModel(); mylabel_1 = new JLabel("Send"); mytoolBar.add(mylabel_1); myOutboundInterfaceCombo.setModel(myOutboundInterfaceComboModel); myOutboundInterfaceCombo.setMaximumSize(new Dimension(200, 32767)); mytoolBar.add(myOutboundInterfaceCombo); mySendButton = new JButton("Send"); mySendButton.addMouseListener(new HoverButtonMouseAdapter(mySendButton)); mySendButton.setBorderPainted(false); mySendButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // int selectedIndex = // myOutboundInterfaceComboModel.getIndexOf(myOutboundInterfaceComboModel.getSelectedItem()); int selectedIndex = myOutboundInterfaceCombo.getSelectedIndex(); OutboundConnection connection = myController.getOutboundConnectionList().getConnections() .get(selectedIndex); activateSendingActivityTabForConnection(connection); myController.sendMessages(connection, myMessage, mySendingActivityTable.provideTransmissionCallback()); } }); myhorizontalStrut_2 = Box.createHorizontalStrut(20); myhorizontalStrut_2.setPreferredSize(new Dimension(2, 0)); myhorizontalStrut_2.setMinimumSize(new Dimension(2, 0)); myhorizontalStrut_2.setMaximumSize(new Dimension(2, 32767)); mytoolBar.add(myhorizontalStrut_2); mySendOptionsButton = new JButton("Options"); mySendOptionsButton.setBorderPainted(false); final HoverButtonMouseAdapter sendOptionsHoverAdaptor = new HoverButtonMouseAdapter(mySendOptionsButton); mySendOptionsButton.addMouseListener(sendOptionsHoverAdaptor); mySendOptionsButton.setIcon(new ImageIcon( Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/sendoptions.png"))); mytoolBar.add(mySendOptionsButton); mySendOptionsButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent theE) { if (mySendOptionsPopupDialog != null) { mySendOptionsPopupDialog.doHide(); mySendOptionsPopupDialog = null; return; } mySendOptionsPopupDialog = new SendOptionsPopupDialog(Hl7V2MessageEditorPanel.this, myMessage, mySendOptionsButton, sendOptionsHoverAdaptor); Point los = mySendOptionsButton.getLocationOnScreen(); mySendOptionsPopupDialog.setLocation(los.x, los.y + mySendOptionsButton.getHeight()); mySendOptionsPopupDialog.setVisible(true); } }); mySendButton.setIcon(new ImageIcon( Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/button_execute.png"))); mytoolBar.add(mySendButton); myhorizontalStrut_1 = Box.createHorizontalStrut(20); mytoolBar.add(myhorizontalStrut_1); mylabel_2 = new JLabel("Validate"); mytoolBar.add(mylabel_2); myProfileCombobox = new JComboBox(); mytoolBar.add(myProfileCombobox); myProfileCombobox.setPreferredSize(new Dimension(200, 27)); myProfileCombobox.setMinimumSize(new Dimension(200, 27)); myProfileCombobox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (myHandlingProfileComboboxChange) { return; } myHandlingProfileComboboxChange = true; try { if (myProfileCombobox.getSelectedIndex() == 0) { myMessage.setValidationContext(null); } else if (myProfileCombobox.getSelectedIndex() == 1) { myMessage.setValidationContext(new DefaultValidation()); } else if (myProfileCombobox.getSelectedIndex() > 0) { ProfileGroup profile = myProfileComboboxModel.myProfileGroups .get(myProfileCombobox.getSelectedIndex()); myMessage.setRuntimeProfile(profile); // } else if (myProfileCombobox.getSelectedItem() == // ProfileComboModel.APPLY_CONFORMANCE_PROFILE) { // IOkCancelCallback<Void> callback = new // IOkCancelCallback<Void>() { // public void ok(Void theArg) { // myProfileComboboxModel.update(); // } // // public void cancel(Void theArg) { // myProfileCombobox.setSelectedIndex(0); // } // }; // myController.chooseAndLoadConformanceProfileForMessage(myMessage, // callback); } } catch (ProfileException e2) { ourLog.error("Failed to load profile", e2); } finally { myHandlingProfileComboboxChange = false; } } }); myProfileCombobox.setMaximumSize(new Dimension(300, 32767)); myProfileCombobox.setModel(myProfileComboboxModel); myhorizontalStrut_4 = Box.createHorizontalStrut(20); myhorizontalStrut_4.setPreferredSize(new Dimension(2, 0)); myhorizontalStrut_4.setMinimumSize(new Dimension(2, 0)); myhorizontalStrut_4.setMaximumSize(new Dimension(2, 32767)); mytoolBar.add(myhorizontalStrut_4); // mySendingPanel = new JPanel(); // mySendingPanel.setBorder(null); // myTopTabBar.addTab("Sending", null, mySendingPanel, null); // mySendingPanel.setLayout(new BorderLayout(0, 0)); mySendingActivityTable = new ActivityTable(); mySendingActivityTable.setController(myController); myTopTabBar.addTab("Sending", null, mySendingActivityTable, null); // mySendingPanelScrollPanel = new JScrollPane(); // mySendingPanelScrollPanel.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); // mySendingPanelScrollPanel.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); // mySendingPanelScrollPanel.setColumnHeaderView(mySendingActivityTable); // // mySendingPanel.add(mySendingPanelScrollPanel, BorderLayout.CENTER); bottomPanel = new JPanel(); bottomPanel.setPreferredSize(new Dimension(10, 20)); bottomPanel.setMinimumSize(new Dimension(10, 20)); add(bottomPanel, BorderLayout.SOUTH); GridBagLayout gbl_bottomPanel = new GridBagLayout(); gbl_bottomPanel.columnWidths = new int[] { 98, 74, 0 }; gbl_bottomPanel.rowHeights = new int[] { 16, 0 }; gbl_bottomPanel.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE }; gbl_bottomPanel.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; bottomPanel.setLayout(gbl_bottomPanel); mylabel = new JLabel("Terser Path:"); mylabel.setHorizontalTextPosition(SwingConstants.LEFT); mylabel.setHorizontalAlignment(SwingConstants.LEFT); GridBagConstraints gbc_label = new GridBagConstraints(); gbc_label.fill = GridBagConstraints.VERTICAL; gbc_label.weighty = 1.0; gbc_label.anchor = GridBagConstraints.NORTHWEST; gbc_label.gridx = 0; gbc_label.gridy = 0; bottomPanel.add(mylabel, gbc_label); myTerserPathTextField = new JLabel(); myTerserPathTextField.setForeground(Color.BLUE); myTerserPathTextField.setFont(new Font("Lucida Console", Font.PLAIN, 13)); myTerserPathTextField.setBorder(null); myTerserPathTextField.setBackground(SystemColor.control); myTerserPathTextField.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (StringUtils.isNotEmpty(myTerserPathTextField.getText())) { myTerserPathPopupMenu.show(myTerserPathTextField, 0, 0); } } }); GridBagConstraints gbc_TerserPathTextField = new GridBagConstraints(); gbc_TerserPathTextField.weightx = 1.0; gbc_TerserPathTextField.fill = GridBagConstraints.HORIZONTAL; gbc_TerserPathTextField.gridx = 1; gbc_TerserPathTextField.gridy = 0; bottomPanel.add(myTerserPathTextField, gbc_TerserPathTextField); initLocal(); }
From source file:gamlss.smoothing.PB.java
/** * GAIC smoothing method./*from w w w. ja v a 2 s .co m*/ * @param lambda - smoothing parameter * @return fitted values */ private ArrayRealVector functionGAIC(Double lambda) { //lambda <- nlminb(lambda, fnGAIC, //lower = 1.0e-7, upper = 1.0e7, k=control$k)$par lambda = optimizer.optimize(Controls.BOBYQA_MAX_EVAL, nonLinObj, GoalType.MINIMIZE, new double[] { lambda, lambda }, new double[] { Double.MIN_VALUE, Double.MIN_VALUE }, new double[] { Double.MAX_VALUE, Double.MAX_VALUE }).getPoint()[0]; if (lambda > 1.0e+7) { lambda = 1.0e+7; } if (lambda < 1.0e-7) { lambda = 1.0e-7; } //fit <- regpen(y=y, X=X, w=w, lambda=lambda, D) beta = regpen(lambda); //fv <- X %*% fit$beta fv = (ArrayRealVector) basisM.operate(beta); //assign(startLambdaName, lambda, envir=gamlss.env) setLambda(lambda); return fv; }