This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = applyModel(model, estimationInput); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var model = buildModel(input); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var input = new Array(); | |
input['x'][0] = 1; input['y'][0] = 0.5; | |
input['x'][1] = 2; input['y'][1] = 1.6; | |
input['x'][2] = 3; input['y'][2] = 4.5; | |
input['x'][3] = 4; input['y'][3] = 7.6; | |
input['x'][4] = 5; input['y'][4] = 10.1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FORMULA: theta = pinv(X'*X)*X'*y; | |
function generateTheta(X, y) | |
{ | |
// Get the transpose of X | |
Xt = X.transpose(); | |
// Multiple X by its transpose | |
var Xmain = X.x(Xt); | |
// Get the inverse of the result of multiplying X by its transpose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var input = new Array(); | |
input['x'][0] = 1; input['y'][0] = 0.5; | |
input['x'][1] = 2; input['y'][1] = 1.6; | |
input['x'][2] = 3; input['y'][2] = 4.5; | |
input['x'][3] = 4; input['y'][3] = 7.6; | |
input['x'][4] = 5; input['y'][4] = 10.1; | |
var estimationInput = new Array(); | |
estimationInput['x'][0] = 6; | |
estimationInput['x'][1] = 7; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[FlurryAppCircle setAppCircleEnabled:YES]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pointer into the AppCircle library | |
static NSObject *gAppCircleDelegate = nil; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// if AppCircle is enabled, pass the ad data buffer to it and parse it | |
if(gAppCircleDelegate != nil) { | |
if ([gAppCircleDelegate respondsToSelector:@selector(parseData:bufferLength:)]) { | |
pCurBufferPos = (char *)[gAppCircleDelegate parseData:pDataBuffer bufferLength:remainingBufferLength]; | |
} else { // throw some exception } | |
} |