Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean Palate committed Oct 16, 2017
2 parents 25341ce + 4cd04b8 commit c8546ec
Show file tree
Hide file tree
Showing 16 changed files with 764 additions and 177 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# jdemetra-benchmarking
# Benchmarking extension for JDemetra+

This module provides some experimental methods for temporal disaggregation and multi-variate benchmarking:
Chow-Lin, Fernandez, Litterman, Cholette, Calendarization...

It has been originally designed for internal use at the NBB.
273 changes: 170 additions & 103 deletions nbdemetra-benchmarking/pom.xml
Original file line number Diff line number Diff line change
@@ -1,103 +1,170 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>eu.europa.ec.joinup.sat</groupId>
<artifactId>nbdemetra-parent</artifactId>
<version>2.0.0</version>
</parent>

<artifactId>nbdemetra-benchmarking</artifactId>
<packaging>nbm</packaging>

<name>NbDemetra - Benchmarking</name>
<description>This module provides some experimental methods for temporal disaggregation and multi-variate benchmarking:
Chow-Lin, Fernandez, Litterman, Cholette, Calendarization...
It has been originally designed for internal use at the NBB.
</description>

<dependencies>
<!-- NetBeans -->
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-api-annotations-common</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-core-multiview</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-windows</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util-lookup</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-awt</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-modules-settings</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-io</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-dialogs</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-modules-options-api</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-nodes</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-filesystems</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-explorer</artifactId>
</dependency>

<!-- NbDemetra -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>nbdemetra-core</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>nbdemetra-ui</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>nbdemetra-spreadsheet</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<publicPackages>
</publicPackages>
</configuration>
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>eu.europa.ec.joinup.sat</groupId>
<artifactId>nbdemetra-benchmarking</artifactId>
<packaging>nbm</packaging>
<version>2.2.0</version>

<name>NbDemetra - Benchmarking</name>
<description>This module provides some experimental methods for temporal disaggregation and multi-variate benchmarking:
Chow-Lin, Fernandez, Litterman, Cholette, Calendarization...
It has been originally designed for internal use at the NBB.
</description>

<properties>
<!-- build -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdk.version>1.8</jdk.version>
<netbeans.version>RELEASE82</netbeans.version>
<maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
<maven-jar-plugin.version>2.6</maven-jar-plugin.version>
<nbm-maven-plugin.version>3.14</nbm-maven-plugin.version>
<!-- dependencies -->
<demetra.version>2.2.0</demetra.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>eu.europa.ec.joinup.sat</groupId>
<artifactId>nbdemetra-parent</artifactId>
<version>${demetra.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- NetBeans -->
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-api-annotations-common</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-core-multiview</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-windows</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util-lookup</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util-ui</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-filesystems-nb</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-awt</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-modules-settings</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-io</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-dialogs</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-modules-options-api</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-nodes</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-filesystems</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-explorer</artifactId>
</dependency>

<!-- NbDemetra -->
<dependency>
<groupId>eu.europa.ec.joinup.sat</groupId>
<artifactId>nbdemetra-core</artifactId>
</dependency>
<dependency>
<groupId>eu.europa.ec.joinup.sat</groupId>
<artifactId>nbdemetra-ui</artifactId>
</dependency>
<dependency>
<groupId>eu.europa.ec.joinup.sat</groupId>
<artifactId>nbdemetra-spreadsheet</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>

<repositories>
<repository>
<id>netbeans-releases</id>
<url>http://bits.netbeans.org/nexus/content/groups/netbeans/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>joinup-releases</id>
<url>https://joinup.ec.europa.eu/nexus/content/repositories/releases/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>joinup-snapshots</id>
<url>https://joinup.ec.europa.eu/nexus/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration>
<!-- to have the jar plugin pickup the nbm generated manifest -->
<useDefaultManifestFile>true</useDefaultManifestFile>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<version>${nbm-maven-plugin.version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright 2013 National Bank of Belgium
*
* Licensed under the EUPL, Version 1.1 or – as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://ec.europa.eu/idabc/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
package ec.benchmarking;

import ec.tss.Ts;
import ec.tss.disaggregation.documents.BenchmarkingResults;
import ec.tss.disaggregation.documents.UniCholetteSpecification;
import ec.tss.disaggregation.processors.CholetteProcessor;
import ec.tss.documents.MultiTsDocument;
import ec.tstoolkit.algorithm.ProcessingContext;

/**
*
* @author Jean Palate
*/
public class CholetteDocument2 extends MultiTsDocument2<UniCholetteSpecification, BenchmarkingResults> {

public CholetteDocument2() {
super(CholetteProcessor.instance);
setSpecification(new UniCholetteSpecification());
}

public CholetteDocument2(ProcessingContext context) {
super(CholetteProcessor.instance, context);
setSpecification(new UniCholetteSpecification());
}

@Override
public void setInput(Ts[] s) {
if (s != null && s.length != 2) {
throw new IllegalArgumentException("Cholette requires 2 time series");
}
super.setInput(s);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright 2013 National Bank of Belgium
*
* Licensed under the EUPL, Version 1.1 or – as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://ec.europa.eu/idabc/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/

package ec.benchmarking;

import ec.tss.Ts;
import ec.tss.disaggregation.documents.BenchmarkingResults;
import ec.tss.disaggregation.documents.DentonSpecification;
import ec.tss.disaggregation.processors.DentonProcessor;
import ec.tss.documents.ActiveDocument;
import ec.tss.documents.MultiTsDocument;
import ec.tstoolkit.algorithm.ProcessingContext;
import java.util.Arrays;

/**
*
* @author Jean Palate
*/
public class DentonDocument2 extends MultiTsDocument2<DentonSpecification, BenchmarkingResults> {

public DentonDocument2() {
super(DentonProcessor.instance);
setSpecification(new DentonSpecification());
}

public DentonDocument2(ProcessingContext context) {
super(DentonProcessor.instance, context);
setSpecification(new DentonSpecification());
}

@Override
public void setInput(Ts[] s) {
if (s != null && s.length != 2) {
throw new IllegalArgumentException("Denton requires 2 time series");
}
Ts[] frozen=new Ts[2];
for (int i=0; i<s.length; ++i){
if (s[i] != null)
frozen[i]=s[i].freeze();
}
super.setInput(frozen);
}
}
Loading

0 comments on commit c8546ec

Please sign in to comment.