Search in sources :

Example 1 with Logsig

use of org.gitia.froog.transferfunction.Logsig in project froog by mroodschild.

the class LogsigTest method testDerivative_SimpleMatrix_double.

/**
 * Test of derivative method, of class Logsig.
 */
@Test
public void testDerivative_SimpleMatrix_double() {
    System.out.println("derivative");
    SimpleMatrix a = new SimpleMatrix(1, 5, true, -0.25, -0.1, 0, 0.2, 0.5);
    double b = 0.1;
    Logsig instance = new Logsig();
    double[] esperado = { -0.212500, -0.010000, 0.100000, 0.260000, 0.350000 };
    double[] salida = instance.derivative(a, b).getMatrix().getData();
    assertArrayEquals(esperado, salida, 0.000000001);
}
Also used : Logsig(org.gitia.froog.transferfunction.Logsig) SimpleMatrix(org.ejml.simple.SimpleMatrix) Test(org.junit.Test)

Example 2 with Logsig

use of org.gitia.froog.transferfunction.Logsig in project froog by mroodschild.

the class LogsigTest method testOutput.

/**
 * Test of output method, of class Logsig.
 */
@Test
public void testOutput() {
    System.out.println("output");
    SimpleMatrix a = new SimpleMatrix(1, 5, true, -0.25, -0.1, 0, 0.2, 0.5);
    Logsig instance = new Logsig();
    double[] esperado = { 0.4378234991142, 0.4750208125211, 0.5000000000000, 0.5498339973125, 0.6224593312019 };
    double[] salida = instance.output(a).getMatrix().getData();
    assertArrayEquals(esperado, salida, 0.000000001);
}
Also used : Logsig(org.gitia.froog.transferfunction.Logsig) SimpleMatrix(org.ejml.simple.SimpleMatrix) Test(org.junit.Test)

Example 3 with Logsig

use of org.gitia.froog.transferfunction.Logsig in project froog by mroodschild.

the class LogsigTest method testDerivative_SimpleMatrix_SimpleMatrix.

/**
 * Test of derivative method, of class Logsig.
 */
@Test
public void testDerivative_SimpleMatrix_SimpleMatrix() {
    System.out.println("derivative");
    SimpleMatrix yCalc = new SimpleMatrix(1, 5, true, -0.25, -0.1, 0, 0.2, 0.5);
    SimpleMatrix yObs = new SimpleMatrix(1, 5, true, -0.10, 0.05, 0.15, 0.35, 0.65);
    Logsig instance = new Logsig();
    double[] esperado = { 0.046875, 0.0165, 0, -0.024, -0.0375 };
    double[] salida = instance.derivative(yCalc, yObs).getMatrix().getData();
    assertArrayEquals(esperado, salida, 0.000000001);
}
Also used : Logsig(org.gitia.froog.transferfunction.Logsig) SimpleMatrix(org.ejml.simple.SimpleMatrix) Test(org.junit.Test)

Example 4 with Logsig

use of org.gitia.froog.transferfunction.Logsig in project froog by mroodschild.

the class LogsigTest method testDerivative_SimpleMatrix.

/**
 * Test of derivative method, of class Logsig.
 */
@Test
public void testDerivative_SimpleMatrix() {
    System.out.println("derivative");
    SimpleMatrix a = new SimpleMatrix(1, 5, true, -0.25, -0.1, 0, 0.2, 0.5);
    Logsig instance = new Logsig();
    double[] esperado = { -0.312500, -0.110000, 0.000000, 0.160000, 0.250000 };
    double[] salida = instance.derivative(a).getMatrix().getData();
    assertArrayEquals(esperado, salida, 0.000000001);
}
Also used : Logsig(org.gitia.froog.transferfunction.Logsig) SimpleMatrix(org.ejml.simple.SimpleMatrix) Test(org.junit.Test)

Example 5 with Logsig

use of org.gitia.froog.transferfunction.Logsig in project froog by mroodschild.

the class LogsigTest method testToString.

/**
 * Test of toString method, of class Logsig.
 */
@Test
public void testToString() {
    System.out.println("toString");
    Logsig instance = new Logsig();
    String expResult = TransferFunction.LOGSIG;
    String result = instance.toString();
    assertEquals(expResult, result);
}
Also used : Logsig(org.gitia.froog.transferfunction.Logsig) Test(org.junit.Test)

Aggregations

Logsig (org.gitia.froog.transferfunction.Logsig)6 SimpleMatrix (org.ejml.simple.SimpleMatrix)5 Test (org.junit.Test)5 Random (java.util.Random)1 Clock (org.gitia.froog.statistics.Clock)1